:root{font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#203c30;background:#f5f6f2;font-size:14px;line-height:1.5;--green:#006b4c;--line:#e0e7df;--muted:#63776b}
.ledger-filters{display:flex;flex-wrap:wrap;align-items:end;gap:16px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:22px;margin-bottom:20px}
.ledger-filters label{margin:0;flex:1 1 150px;min-width:0}.ledger-filters .ledger-search{flex:2 1 260px}.ledger-filters input,.ledger-filters select{width:100%;min-width:0}.ledger-filter-actions{display:flex;gap:8px;padding-bottom:1px}.ledger-quick{flex:1 0 100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px}.ledger-quick button{padding:6px 12px;min-height:34px;font-size:13px}.ledger-quick span{font-size:13px;color:var(--green)}
.ledger-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-bottom:24px}.ledger-metrics .metric:first-child{background:#006b4c;color:white}.ledger-metrics .metric:first-child strong{color:white}.ledger-metrics small{display:block;margin-top:5px;font-size:12px}.ledger-metrics strong{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.ledger-results.card{padding:0;overflow:hidden}.ledger-result-bar,.ledger-result-info,.ledger-pagination{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:12px;padding:18px 22px}.ledger-result-info{padding-top:0;color:var(--muted);font-size:13px}.ledger-tabs{display:flex;gap:4px;flex-wrap:wrap}.ledger-tabs button{border-color:transparent}.ledger-tabs button[aria-pressed=true]{background:#eaf3eb;color:var(--green);font-weight:650}.ledger-table{overflow:auto;max-height:620px;min-height:180px;border-top:1px solid var(--line)}.ledger-table table{min-width:1080px}.ledger-table th,.ledger-table td{padding:15px 18px}.ledger-table th{z-index:1}.ledger-table .number{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.ledger-account{min-width:130px}.ledger-account strong,.ledger-account small{display:block}.ledger-account small{margin-top:4px;color:var(--muted)}.ledger-ref{max-width:220px;font-size:12px;color:var(--muted)}.ledger-empty{text-align:center;padding:50px!important;color:var(--muted)}
.ledger-pagination{border-top:1px solid var(--line);justify-content:flex-end}.ledger-pagination>label{margin-right:auto}.ledger-pagination label,.ledger-jump{display:flex;align-items:center;gap:8px;margin-top:0;margin-bottom:0}.ledger-pagination select{width:80px}.ledger-jump input{width:70px}.ledger-page-buttons{display:flex;gap:6px}.ledger-error{padding:14px 18px;margin-bottom:18px;border:1px solid #f0c3bc;border-radius:9px;color:#a63628;background:#fff5f2}
@media(max-width:950px){.ledger-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.ledger-pagination{justify-content:flex-start}}
@media(max-width:640px){.ledger-filters{padding:16px;gap:12px}.ledger-metrics{gap:12px}.ledger-result-bar,.ledger-result-info,.ledger-pagination{padding:14px 12px}.ledger-pagination>label{margin-right:0}.ledger-page-buttons button{padding:8px}.ledger-tabs button{padding:10px}.ledger-quick button{min-height:44px}}
*{box-sizing:border-box}body{margin:0}h1,h2,h3,p{margin:0}h1{font-size:24px;color:#174333}h2{font-size:18px;color:#174333}h3{font-size:14px}p{margin:10px 0}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}[hidden]{display:none!important}
body>header{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:28px;min-height:80px;padding:14px clamp(20px,2.4vw,48px);background:white;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:12px;white-space:nowrap;font-size:17px;font-weight:650;color:#174333}.brand img{width:90px;height:48px;object-fit:contain}
nav{display:flex;gap:4px;flex:1;justify-content:center}nav button{border-color:transparent;background:transparent;white-space:nowrap}nav button[aria-current=true]{color:var(--green);background:#eaf3eb}
.account-actions{display:flex;gap:10px;align-items:center;margin-left:auto;white-space:nowrap}#identity{font-size:12px;color:var(--muted)}
button,input,select,textarea{font:inherit;color:inherit;border:1px solid var(--line);border-radius:9px;background:#fff;padding:10px 12px;min-height:42px;max-width:100%}button{cursor:pointer;font-weight:600;transition:background .15s}button:hover{background:#eaf3eb}button:disabled{opacity:.45;cursor:default}.primary{background:var(--green);color:#fff;border-color:var(--green)}.primary:hover{background:#00573e}.danger{color:#aa4037}.quiet{border:0;background:transparent;color:var(--muted)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #80bba5;outline-offset:3px}input::placeholder,textarea::placeholder{color:#87968d}input[type=checkbox]{min-height:0;accent-color:var(--green);width:16px;height:16px}
#logout{color:#006b4c;background:#ffffff;white-space:nowrap}#logout:hover{color:#00573e;background:#eaf3eb}#logout:focus-visible{outline:3px solid #80bba5;outline-offset:3px}
.attention-button{display:inline-flex;align-items:center;gap:6px;color:var(--green)}.attention-button:focus-visible{outline:3px solid #80bba5;outline-offset:3px}.attention-count{border-radius:12px;background:#b74035;color:white;min-width:21px;padding:1px 5px;font-size:12px}
main{max-width:2200px;margin:24px auto;padding:0 clamp(20px,2.4vw,48px)}.page-heading,.section-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:24px;margin-bottom:20px;min-width:0}.card h2{margin-bottom:18px}.narrow{max-width:440px;margin:12vh auto}.narrow h2{font-size:25px;margin-bottom:28px}.narrow button{width:100%;margin-top:10px}label{display:block;margin:14px 0;color:var(--muted)}label input:not([type=checkbox]),label select,label textarea{display:block;width:100%;margin-top:7px;color:#203c30}textarea{resize:vertical}form>.row{margin-top:16px}.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.row input{flex:1;min-width:160px}.muted{color:var(--muted);font-size:12px}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-bottom:20px}.metric{border:1px solid var(--line);border-radius:14px;background:#fff;padding:20px;color:var(--muted);font-size:13px}.metric strong{display:block;margin-top:8px;font-size:25px;color:#174333}
.customer-workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;height:max(580px,calc(100dvh - 184px))}.customer-workspace.has-detail{grid-template-columns:minmax(0,1fr) minmax(390px,32%)}.customer-list,.customer-detail{min-width:0;min-height:0;background:white;border:1px solid var(--line);border-radius:14px;overflow:hidden}.customer-list{display:flex;flex-direction:column}
.list-toolbar{display:flex;flex-wrap:wrap;gap:10px;padding:18px 18px 10px}.search-field{flex:1 1 230px;margin:0}.list-toolbar .search-field input{margin:0;width:100%}.list-toolbar select{flex:1 1 140px;min-width:0}.comment-filters{display:flex;flex-wrap:wrap;align-items:end;gap:10px;padding:0 18px 14px}.comment-filters label{margin:0;font-size:12px}.comment-filters select{min-width:150px}.comment-date-range{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.comment-date-range>span{padding-bottom:10px}.comment-filters #commentDateError{flex-basis:100%;margin:0}.list-summary{display:flex;align-items:center;gap:12px;padding:10px 18px;border-top:1px solid var(--line);flex-wrap:wrap}.list-summary strong{font-size:13px}.list-summary span{color:var(--muted);font-size:12px}.list-summary button{padding:5px 8px;min-height:30px;font-size:12px}#trashToggle{margin-left:auto}#clearSelection{border:0;background:transparent}
.selection-toolbar{padding:0 18px 14px;display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line)}.selection-toolbar button{font-size:12px;padding:7px 10px;min-height:34px}.trash-notice{background:#fff5df;color:#846324;padding:8px 18px;margin:0}
.table-stage{flex:1;min-height:180px;overflow:hidden}#leadList{border:0;background:white;font-size:13px}#leadList .tabulator-header{border-bottom:1px solid var(--line);background:#f5f7f3;color:var(--muted);font-weight:600}#leadList .tabulator-header .tabulator-col{background:transparent;border-right:0}#leadList .tabulator-col-content{padding:14px 12px}#leadList .tabulator-row{background:white;border-bottom:1px solid #edf0eb;min-height:58px}#leadList .tabulator-row:hover{background:#f6f9f5}#leadList .tabulator-row.customer-active{background:#eaf3eb}#leadList .tabulator-cell{border-right:0;padding:12px;white-space:normal;display:inline-flex;align-items:center}#leadList .tabulator-header .tabulator-col.tabulator-frozen{background:#f5f7f3}#leadList .tabulator-row .tabulator-cell.tabulator-frozen{background:inherit}#leadList .tabulator-tableholder{scrollbar-width:thin}.customer-name{border:0;padding:0;background:none;min-height:30px;text-align:left;color:#174333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.comment-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.grid-actions{display:flex;gap:10px}.grid-actions button{border:0;background:none;padding:0;min-height:30px;font-size:12px}
.pill{display:inline-block;white-space:nowrap;border-radius:6px;padding:3px 7px;font-size:12px;font-weight:500;background:#f0f3ef;color:var(--muted);margin-right:5px}.pill.sent,.pill.waiting_customer{background:#edf2fd;color:#456393}.pill.failed,.pill.stopped{background:#fdefeb;color:#a03c32}.pill.engaged{background:#e2f2e8;color:#006b4c}.pill.unengaged,.pill.waiting_human{background:#fff3d7;color:#916c20}.pill.intent{background:#f0f3ef;color:#63776b}
.list-footer{padding:12px 18px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px}#leadPagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap}#leadPagination label{margin:0}#leadPagination .tabulator-pages{display:inline-flex;gap:4px}#leadPagination button{min-width:30px;min-height:32px;padding:4px 8px;font-weight:500}#leadPagination button.active{background:var(--green);color:white;border-color:var(--green)}#leadPagination select{min-height:32px;padding:4px 7px}.page-jump{display:flex;align-items:center;gap:12px;color:var(--muted)}.page-jump label{display:flex;align-items:center;gap:6px;margin:0}.page-jump input{display:inline-block;width:52px;margin:0!important;padding:4px 6px;min-height:32px}.page-jump button{min-height:32px;padding:4px 10px}
.customer-detail{overflow:auto;display:flex;flex-direction:column}.detail-header{padding:20px;border-bottom:1px solid var(--line);flex-shrink:0}.detail-title{display:flex;justify-content:space-between;gap:12px;align-items:start}.detail-title>div{min-width:0}.detail-title h2{overflow-wrap:anywhere;margin-bottom:10px}.detail-title .quiet{min-height:30px;padding:3px 0}.detail-reason{font-size:12px;color:var(--muted);overflow-wrap:anywhere;margin:10px 0}.detail-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:14px}.detail-actions button{font-size:12px;padding:7px 9px;min-height:34px}.detail-actions a{margin-left:auto;font-size:12px}
.send-failure-reason{background:#fff4ef;border-radius:9px;padding:10px 12px;color:#a03c32}.send-failure-log{font-size:12px;margin:8px 0;color:var(--muted)}summary{cursor:pointer;font-weight:600;color:#174333}summary:hover{color:var(--green)}.send-failure-log dl{display:grid;grid-template-columns:72px 1fr;gap:6px 10px;padding:12px;background:#f6f7f4;border-radius:9px}.send-failure-log dd{margin:0;overflow-wrap:anywhere}
.detail-scroll{flex:1 1 auto;min-height:120px;overflow:auto;padding:20px;scrollbar-width:thin;overscroll-behavior:contain}.demand-summary{border-radius:9px;background:#f5f7f3;padding:14px;margin-bottom:20px}.demand-summary h3{color:var(--muted);font-size:12px}.demand-summary p{margin:8px 0 0;overflow-wrap:anywhere}.history-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.lead-remarks{border:1px solid var(--line);border-radius:9px;padding:12px;margin:0 0 14px}.lead-remarks label{font-size:12px}.lead-remarks button{font-size:12px;margin-right:8px;padding:6px 9px;min-height:32px}.message{border-left:2px solid #dce8dd;padding:0 0 0 12px;margin:20px 0;overflow-wrap:anywhere;white-space:pre-wrap}.message small{font-size:11px;color:var(--muted)}.message p{font-size:13px;margin:6px 0}.message a{font-size:12px}.message button{font-size:12px;padding:4px 8px;min-height:30px}
.followup-composer{border-top:1px solid var(--line);padding:16px 20px;flex-shrink:0;background:#fff}.composer-heading{margin-bottom:10px}.followup-composer>select{width:100%;margin-bottom:8px;font-size:12px;min-height:34px;padding:6px 10px}.followup-composer textarea{display:block;width:100%;min-height:68px;max-height:120px;font-size:13px}.composer-actions{display:flex;justify-content:space-between;align-items:center;margin-top:10px}.composer-actions button{font-size:12px;min-height:34px;padding:6px 12px}.detail-empty{padding:30px;color:var(--muted)}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.fields>label{margin:0;background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px;font-weight:600}.fields textarea{border:0;background:#f7f8f5;padding:14px;font-weight:400;min-height:140px}.split{display:grid;grid-template-columns:1fr 1fr;gap:20px}.admin-create summary{font-size:16px}.admin-create form{margin-top:20px}.admin-create form>button{margin-top:8px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#eaf3eb;padding:14px;border-radius:9px}pre:empty{display:none}
table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;vertical-align:middle;padding:15px 14px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}th{color:var(--muted);background:#f5f7f3;white-space:nowrap}td button{min-height:32px;font-size:12px;padding:5px 9px}div:has(>table){overflow:auto;max-height:540px}table th{position:sticky;top:0}
#status{position:fixed;top:90px;left:50%;transform:translateX(-50%);z-index:30;background:#174333;color:#fff;padding:12px 20px;border-radius:10px;max-width:calc(100vw - 32px);box-shadow:0 8px 24px #17433320;pointer-events:none}#status:empty{display:none}
dialog{max-width:min(500px,calc(100vw - 32px));border:1px solid var(--line);border-radius:14px;padding:24px;color:#203c30}dialog::backdrop{background:#173d3055}dialog .row{justify-content:flex-end}#managementConfirmText{white-space:pre-wrap;overflow-wrap:anywhere}#engagementName{width:100%;margin:8px 0 20px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1250px){body>header{gap:14px;flex-wrap:wrap}.brand{font-size:15px}nav{order:3;flex-basis:100%;justify-content:start}.customer-workspace{height:max(600px,calc(100dvh - 230px))}.customer-workspace.has-detail{grid-template-columns:minmax(0,1fr) 390px}#identity{font-size:11px}}
@media(max-width:950px){.customer-workspace,.customer-workspace.has-detail{grid-template-columns:1fr;height:auto}.customer-list{height:700px}.customer-detail{height:760px;grid-row:1}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.split{grid-template-columns:1fr;gap:0}.detail-scroll{min-height:200px}.list-toolbar select{flex:1 1 140px}}
@media(max-width:640px){body>header{padding:12px 16px;gap:12px}.brand{font-size:15px}.brand img{width:70px;height:38px}.account-actions{width:100%;justify-content:flex-end;gap:8px}#identity{margin-right:auto;white-space:normal}nav{overflow:auto;flex-wrap:nowrap;gap:0}nav button{padding:8px 10px;font-size:13px;min-height:44px}main{padding:0 16px;margin:18px auto}.page-heading{margin-bottom:16px}h1{font-size:21px}.card{padding:18px}.fields{grid-template-columns:1fr;gap:16px}.metrics{gap:12px}.metric{padding:14px}.metric strong{font-size:18px}.list-toolbar,.comment-filters{padding-left:12px;padding-right:12px}.search-field{flex-basis:100%}.comment-filters label{flex:1;min-width:130px}.comment-filters select{min-width:0;width:100%}.comment-date-range{flex-basis:100%}.list-summary,.selection-toolbar,.list-footer{padding-left:12px;padding-right:12px}.list-footer{gap:10px}.page-jump{width:100%;justify-content:flex-end}.page-jump>span{margin-right:auto}#leadPagination [data-page=first],#leadPagination [data-page=last]{display:none}.customer-list{height:760px}.customer-detail{height:800px}.narrow{margin:8vh auto}.detail-header,.detail-scroll,.followup-composer{padding:16px}.row button,form>button{min-height:44px}}
