:root {
  color-scheme: light;
  --bg:#f1f5f4;--surface:#fff;--soft:#f7f9f8;--text:#152622;--muted:#71807b;--line:#dfe7e4;
  --brand:#0e7c66;--brand-dark:#075f4f;--brand-soft:#dff3ed;--amber:#b9631f;--amber-soft:#fff0df;
  --red:#ad4141;--red-soft:#fbe8e8;--on-brand:#fff;--shadow:0 18px 45px rgba(22,53,45,.08);--radius:22px;
}
html[data-theme="dark"]{color-scheme:dark;--bg:#121416;--surface:#1a1d20;--soft:#23272b;--text:#eef1f1;--muted:#9ba3a6;--line:#343a3e;--brand:#55bda3;--brand-dark:#8dd8c5;--brand-soft:#253430;--amber:#e7aa70;--amber-soft:#3b3027;--red:#e88b8f;--red-soft:#3d292c;--on-brand:#09201b;--shadow:0 18px 48px rgba(0,0,0,.3)}
*{box-sizing:border-box} html{scroll-behavior:smooth}
body{margin:0;min-width:320px;min-height:100vh;background:radial-gradient(circle at 7% 0%,rgba(14,124,102,.11),transparent 28rem),var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,textarea{font:inherit} button{cursor:pointer}
.app-shell{width:min(1540px,100%);margin:0 auto;padding:28px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}
.brand{display:flex;align-items:center;gap:14px}.brand-mark{display:grid;width:46px;height:46px;place-items:center;border-radius:15px;background:var(--text);color:var(--surface);box-shadow:0 12px 25px rgba(20,38,34,.18);font-size:20px;font-weight:800;letter-spacing:-.06em}
.brand h1{margin:0;font-size:clamp(22px,3vw,30px);letter-spacing:-.04em}.brand p{margin:3px 0 0;color:var(--muted);font-size:14px}
.header-actions{display:flex;align-items:center;gap:10px}.theme-toggle{display:grid;width:46px;height:46px;place-items:center;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--text);box-shadow:var(--shadow);font-size:20px;transition:.16s}.theme-toggle:hover{background:var(--soft);transform:translateY(-1px)}
.primary-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:46px;padding:0 18px;border:0;border-radius:14px;background:var(--brand);color:var(--on-brand);font-weight:750;box-shadow:0 11px 24px rgba(14,124,102,.2);transition:.16s}
.primary-button:hover{background:var(--brand-dark);transform:translateY(-1px)}.plus{font-size:21px;font-weight:400;line-height:1}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}
.metric-card{position:relative;min-height:140px;overflow:hidden;padding:22px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.metric-card::after{position:absolute;top:-30px;right:-26px;width:95px;height:95px;border-radius:50%;background:var(--accent-soft,var(--brand-soft));content:""}
.metric-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.metric-label{color:var(--muted);font-size:14px;font-weight:650}
.metric-icon{position:relative;z-index:1;display:grid;width:36px;height:36px;place-items:center;border-radius:11px;background:var(--accent-soft,var(--brand-soft));color:var(--accent,var(--brand));font-size:17px;font-weight:800}
.metric-value{margin-top:18px;font-size:clamp(25px,3vw,35px);font-weight:790;letter-spacing:-.045em}.metric-foot{margin-top:4px;overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.metric-foot strong{color:var(--brand)}
.purchase-panel{margin-bottom:20px}.purchase-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 22px;border-bottom:1px solid var(--line)}.purchase-header h2{margin:0;font-size:18px;letter-spacing:-.025em}.purchase-header p{margin:4px 0 0;color:var(--muted);font-size:12px}.purchase-content{padding:18px 22px 20px}.purchase-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.purchase-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--soft)}.purchase-provider{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:760}.provider-dot{width:10px;height:10px;border-radius:50%;background:#6d8dd7;box-shadow:0 0 0 4px rgba(109,141,215,.14)}.provider-dot.activation{background:var(--brand);box-shadow:0 0 0 4px var(--brand-soft)}.purchase-average{text-align:right}.purchase-average strong{display:block;font-size:20px;letter-spacing:-.035em}.purchase-average span,.purchase-meta{color:var(--muted);font-size:10px}.purchase-meta{margin-top:5px}.purchase-history{margin-top:17px}.purchase-history-title{margin-bottom:8px;color:var(--muted);font-size:10px;font-weight:760;letter-spacing:.07em;text-transform:uppercase}.purchase-row{display:grid;grid-template-columns:100px minmax(120px,1fr) 85px 100px 100px 30px;gap:12px;align-items:center;min-height:42px;padding:8px 10px;border-top:1px solid var(--line);font-size:11px}.purchase-row.head{min-height:auto;border-top:0;background:var(--soft);color:var(--muted);font-size:9px;font-weight:760;letter-spacing:.06em;text-transform:uppercase}.purchase-row .small-button{width:28px;min-height:28px;padding:0;color:var(--red)}.purchase-empty{padding:18px;color:var(--muted);font-size:12px;text-align:center}.calc-preview{display:grid;grid-template-columns:1fr 1fr;gap:10px;grid-column:1/-1;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--brand-soft)}.calc-preview span{color:var(--muted);font-size:11px}.calc-preview strong{display:block;margin-top:4px;color:var(--text);font-size:17px}
.workspace{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(350px,.72fr);gap:20px;align-items:start}
.panel{overflow:hidden;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.list-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px;border-bottom:1px solid var(--line)}.list-header h2{margin:0;font-size:18px;letter-spacing:-.025em}.result-count{margin:4px 0 0;color:var(--muted);font-size:13px}
.search-wrap{position:relative;width:min(360px,100%)}.search-icon{position:absolute;top:50%;left:14px;color:var(--muted);transform:translateY(-50%)}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#searchInput{width:100%;height:43px;padding:0 15px 0 41px;border:1px solid var(--line);border-radius:13px;outline:0;background:var(--soft);color:var(--text)}#searchInput:focus{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 4px var(--brand-soft)}
.table-head,.customer-row{display:grid;grid-template-columns:minmax(155px,1.2fr) minmax(160px,1.05fr) minmax(120px,.9fr) 82px 88px minmax(100px,.8fr) 20px;gap:13px;align-items:center}
.table-head{padding:14px 20px;background:var(--soft);color:var(--muted);font-size:10px;font-weight:760;letter-spacing:.07em;text-transform:uppercase}
.customer-row{width:100%;min-height:76px;padding:13px 20px;border:0;border-top:1px solid var(--line);background:var(--surface);color:var(--text);text-align:left;transition:background .15s}.customer-row:first-child{border-top:0}.customer-row:hover{background:var(--soft)}.customer-row.is-active{background:var(--brand-soft);box-shadow:inset 4px 0 0 var(--brand)}
.identity{display:flex;align-items:center;min-width:0;gap:11px}.avatar{display:grid;flex:0 0 auto;width:40px;height:40px;place-items:center;border-radius:12px;background:var(--avatar,var(--brand-soft));color:var(--avatar-ink,var(--brand-dark));font-size:13px;font-weight:800}
.name,.panel-cell,.app-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.name{font-size:13px;font-weight:730}.user-preview{display:block;margin-top:3px;overflow:hidden;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.date-cell{color:var(--muted);font-size:11px;line-height:1.55}.date-cell strong{color:var(--text);font-weight:700}.panel-cell,.app-cell{color:var(--muted);font-size:12px}.price-cell{font-size:12px;font-weight:750}
.paid-cell{display:inline-grid;width:25px;height:25px;place-items:center;border-radius:8px;background:var(--brand-soft);color:var(--brand-dark);font-size:14px;font-weight:900}.paid-cell.open{background:var(--red-soft);color:var(--red)}.chevron{color:#8b9995;font-size:20px}
.status{display:inline-flex;width:max-content;align-items:center;gap:7px;padding:6px 9px;border-radius:999px;background:var(--brand-soft);color:var(--brand-dark);font-size:11px;font-weight:720}.status::before{width:6px;height:6px;border-radius:50%;background:currentColor;content:""}.status.soon{background:var(--amber-soft);color:var(--amber)}.status.expired{background:var(--red-soft);color:var(--red)}
.empty-state{padding:50px 24px;color:var(--muted);text-align:center}.empty-state strong{display:block;margin-bottom:5px;color:var(--text)}
.detail-panel{position:sticky;top:24px}.detail-header{padding:22px 24px 20px;border-bottom:1px solid var(--line)}.detail-label-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.detail-label{color:var(--muted);font-size:11px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}
.edit-button,.small-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font-size:11px;font-weight:720;text-decoration:none}.edit-button:hover,.small-button:hover{border-color:var(--brand);background:var(--soft)}
.profile{display:flex;align-items:center;gap:14px}.profile .avatar{width:52px;height:52px;border-radius:16px;font-size:16px}.profile h3{margin:0;font-size:19px;letter-spacing:-.025em}.profile-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:6px}.profile-meta>span:not(.status){color:var(--muted);font-size:12px}
.detail-body{padding:20px 24px 25px}.credential-box{margin-bottom:20px;padding:15px;border:1px solid var(--line);border-radius:15px;background:var(--brand-soft)}.credential-title{margin-bottom:12px;color:var(--brand-dark);font-size:10px;font-weight:790;letter-spacing:.08em;text-transform:uppercase}
.credential-row{display:grid;grid-template-columns:62px minmax(0,1fr) auto;gap:8px;align-items:center}.credential-row+.credential-row{margin-top:9px}.credential-row>span:first-child{color:var(--muted);font-size:11px}.credential-value{overflow:hidden;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.credential-actions{display:flex;gap:5px}.credential-actions .small-button{min-height:28px;padding:0 8px;font-size:10px}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px 18px}.detail-item.full{grid-column:1/-1}.detail-item>span{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:720;letter-spacing:.06em;text-transform:uppercase}.detail-item p{margin:0;color:var(--text);font-size:12px;line-height:1.55}.payment{display:inline-flex!important;align-items:center;gap:6px;font-weight:700}.payment.yes{color:var(--brand-dark)}.payment.no{color:var(--red)}
.note-box{margin-top:20px;padding:15px;border:1px solid var(--line);border-radius:15px;background:var(--soft)}.note-box span{display:block;margin-bottom:6px;color:var(--muted);font-size:10px;font-weight:720;letter-spacing:.06em;text-transform:uppercase}.note-box p,.note-box a{margin:0;color:var(--text);font-size:12px;line-height:1.55;text-decoration:none;overflow-wrap:anywhere}.note-box a:hover{color:var(--brand)}
dialog{width:min(720px,calc(100% - 30px));max-height:calc(100vh - 30px);padding:0;overflow:auto;border:0;border-radius:24px;background:var(--surface);box-shadow:0 30px 90px rgba(15,35,30,.28)}dialog::backdrop{background:rgba(16,33,29,.55);backdrop-filter:blur(5px)}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 18px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0;font-size:21px}.modal-head p{margin:5px 0 0;color:var(--muted);font-size:13px}.icon-button{display:grid;width:36px;height:36px;place-items:center;border:0;border-radius:11px;background:var(--soft);color:var(--muted);font-size:22px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px;padding:22px 26px}.form-field.full{grid-column:1/-1}.form-field label{display:block;margin-bottom:7px;color:var(--text);font-size:12px;font-weight:720}.form-field input,.form-field select,.form-field textarea{width:100%;border:1px solid var(--line);border-radius:12px;outline:0;background:var(--soft);color:var(--text)!important;-webkit-text-fill-color:var(--text);opacity:1;color-scheme:inherit}.form-field input,.form-field select{height:43px;padding:0 12px}.form-field select{cursor:pointer}.form-field option{background:var(--surface);color:var(--text);-webkit-text-fill-color:var(--text)}.form-field input::placeholder,.form-field textarea::placeholder{color:var(--muted);-webkit-text-fill-color:var(--muted);opacity:1}.form-field textarea{min-height:82px;padding:11px 12px;resize:vertical}.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 4px var(--brand-soft)}
.check-field{display:flex;align-items:center;gap:10px;min-height:43px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}.check-field input{width:18px;height:18px;accent-color:var(--brand)}.check-field label{margin:0}.modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:17px 26px 24px;border-top:1px solid var(--line)}.secondary-button{min-height:43px;padding:0 17px;border:1px solid var(--line);border-radius:13px;background:var(--surface);color:var(--text);font-weight:720}
.privacy-note{margin:16px 4px 0;color:var(--muted);font-size:11px;text-align:center}.toast{position:fixed;right:24px;bottom:24px;z-index:20;padding:13px 17px;border-radius:13px;background:var(--text);color:var(--surface);box-shadow:0 15px 40px rgba(20,38,34,.24);font-size:13px;opacity:0;pointer-events:none;transform:translateY(12px);transition:.18s}.toast.show{opacity:1;transform:translateY(0)}:focus-visible{outline:3px solid rgba(14,124,102,.33);outline-offset:2px}
html[data-theme="dark"] body{background:radial-gradient(circle at 7% 0%,rgba(124,137,134,.12),transparent 28rem),var(--bg)}html[data-theme="dark"] .metric-card:nth-child(2){--accent:#85b4d2!important;--accent-soft:#27343d!important}html[data-theme="dark"] .metric-card:nth-child(3){--accent:#e7aa70!important;--accent-soft:#3b3027!important}html[data-theme="dark"] .metric-card:nth-child(4){--accent:#e88b8f!important;--accent-soft:#3d292c!important}
@media(max-width:1120px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace{grid-template-columns:1fr}.detail-panel{position:static}}
@media(max-width:780px){.app-shell{padding:18px}.topbar{align-items:flex-start}.brand p{display:none}.header-actions .primary-button .button-label{display:none}.header-actions .primary-button{width:46px;padding:0}.purchase-header{align-items:flex-start}.purchase-summary{grid-template-columns:1fr}.purchase-row{grid-template-columns:85px minmax(100px,1fr) 65px 82px 28px}.purchase-row span:nth-child(5),.purchase-row.head span:nth-child(5){display:none}.list-header{align-items:stretch;flex-direction:column}.search-wrap{width:100%}.table-head{display:none}.customer-row{grid-template-columns:minmax(0,1fr) auto 20px;gap:10px;padding:15px 18px}.date-cell{grid-column:1;grid-row:2;padding-left:51px}.panel-cell,.price-cell,.app-cell{display:none}.paid-cell{grid-column:2;grid-row:1}.chevron{grid-column:3;grid-row:1/span 2}}
@media(max-width:520px){.app-shell{padding:14px}.brand-mark{width:42px;height:42px}.brand h1{font-size:21px}.metrics{gap:10px}.metric-card{min-height:116px;padding:16px;border-radius:18px}.metric-label{font-size:12px}.metric-icon{width:30px;height:30px}.metric-value{margin-top:14px;font-size:24px}.metric-foot{display:none}.panel{border-radius:18px}.purchase-header{flex-direction:column}.purchase-header .secondary-button{width:100%}.purchase-content{padding:14px}.purchase-row{grid-template-columns:72px minmax(90px,1fr) 55px 28px;gap:7px;padding:8px 4px}.purchase-row span:nth-child(4),.purchase-row.head span:nth-child(4){display:none}.detail-grid,.form-grid{grid-template-columns:1fr}.form-field.full{grid-column:auto}.calc-preview{grid-template-columns:1fr}.credential-row{grid-template-columns:58px minmax(0,1fr)}.credential-actions{grid-column:2}.form-grid{padding:20px}.modal-head,.modal-actions{padding-left:20px;padding-right:20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
.customer-section-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 14px;padding:4px}.customer-section-header h2{margin:0;font-size:19px}.customer-section-header p{margin:5px 0 0;color:var(--muted);font-size:12px}.customer-section-header button{flex-shrink:0;min-height:44px}.workspace[hidden]{display:none!important}
.guv-section{margin-bottom:22px}.guv-content{padding:20px 22px}.guv-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.guv-card{min-width:0;padding:18px;border:1px solid var(--line);border-radius:15px;background:var(--soft)}.guv-card h3{margin:0;color:var(--muted);font-size:12px;font-weight:700}.guv-card strong{display:block;margin:10px 0 7px;color:var(--text);font-size:clamp(20px,2.4vw,29px);letter-spacing:-.025em;overflow-wrap:anywhere}.guv-card p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.guv-positive{color:var(--brand-dark)!important}.guv-negative{color:var(--red)!important}.guv-coverage{margin:16px 0;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--muted);font-size:12px;line-height:1.6}.guv-coverage.incomplete{color:var(--amber);background:var(--amber-soft)}.guv-table-wrap{overflow-x:auto}.guv-table{width:100%;min-width:570px;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums}.guv-table caption{text-align:left;margin-bottom:10px;color:var(--muted);font-size:11px}.guv-table th,.guv-table td{padding:12px 10px;text-align:right;border-bottom:1px solid var(--line)}.guv-table th:first-child,.guv-table td:first-child{text-align:left}.guv-table thead{color:var(--muted);background:var(--soft);font-size:10px}.guv-table tfoot{font-weight:750;background:var(--soft)}.guv-note{margin:15px 0 0;color:var(--muted);font-size:11px;line-height:1.7}
@media(max-width:620px){.guv-content{padding:14px}.guv-metrics{grid-template-columns:1fr}.guv-card{padding:14px}.guv-card strong{font-size:24px}}
.promoter-cell{min-width:0;overflow:hidden;color:var(--text);font-size:12px;font-weight:750;text-overflow:ellipsis;white-space:nowrap}.promoter-label{display:none}.name{display:block}
@media(min-width:781px){.table-head,.customer-row{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr) 60px 88px 55px minmax(0,.8fr) 16px;gap:10px}.table-head>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:780px){.promoter-cell{grid-column:1/-1;grid-row:3;padding-left:51px;white-space:normal;overflow-wrap:anywhere}.promoter-label{display:inline;color:var(--muted);font-weight:500}}
.sync-status{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:0 11px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--muted);font-size:11px;font-weight:700;white-space:nowrap}.sync-dot{width:8px;height:8px;border-radius:50%;background:#9aa3a0;box-shadow:0 0 0 3px rgba(154,163,160,.15)}.sync-status.syncing .sync-dot{background:#d3a44c;animation:pulse 1s infinite}.sync-status.synced .sync-dot{background:var(--brand)}.sync-status.error .sync-dot{background:var(--red)}.logout-button{min-height:42px}.loading-state{padding:42px 24px;color:var(--muted);font-size:13px;text-align:center}@keyframes pulse{50%{opacity:.38}}
.login-page,.setup-page{display:grid;min-height:100vh;place-items:center;padding:24px}.login-card,.setup-card{width:min(460px,100%);padding:30px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:var(--shadow)}.login-brand{display:flex;align-items:center;gap:14px;margin-bottom:24px}.login-card h1,.setup-card h1{margin:0;font-size:25px;letter-spacing:-.04em}.login-card p,.setup-card p{margin:5px 0 0;color:var(--muted);font-size:13px;line-height:1.55}.login-form{display:grid;gap:16px}.login-form .primary-button{width:100%;margin-top:4px}.form-error,.form-success,.setup-hint{margin:0 0 18px!important;padding:12px 14px;border:1px solid rgba(173,65,65,.25);border-radius:12px;background:var(--red-soft);color:var(--red)!important;font-weight:650}.form-success{border-color:rgba(14,124,102,.25);background:var(--brand-soft);color:var(--brand-dark)!important}.setup-hint{border-color:var(--line);background:var(--soft);color:var(--text)!important;font-weight:500}.setup-list{margin:16px 0;padding-left:21px;color:var(--text);font-size:13px;line-height:1.8}.setup-card{width:min(620px,100%)}.setup-card code{padding:2px 5px;border-radius:5px;background:var(--soft);font-size:12px}.setup-actions{display:flex;gap:10px;margin-top:20px}.setup-actions a{text-decoration:none}.version-note{margin-top:18px!important;font-size:11px!important;text-align:center}
.user-create-form{border-bottom:1px solid var(--line)}.user-section{padding:20px 26px 26px}.user-section-title{margin-bottom:10px;color:var(--muted);font-size:10px;font-weight:760;letter-spacing:.07em;text-transform:uppercase}.user-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:12px 4px;border-top:1px solid var(--line)}.user-row:first-child{border-top:0}.user-identity strong{display:block;font-size:13px}.user-identity span{color:var(--muted);font-size:10px}.user-badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:var(--brand-soft);color:var(--brand-dark);font-size:9px;font-weight:760;text-transform:uppercase}.user-badge.inactive{background:var(--red-soft);color:var(--red)}.user-actions{display:flex;gap:6px}.user-actions .small-button.danger{color:var(--red)}
.user-form-note{grid-column:1/-1;margin:-6px 0 0;color:var(--muted);font-size:11px}.detail-actions{display:flex;align-items:center;gap:8px}.mobile-detail-close{display:none}
.customer-filters{padding:16px 20px;border-bottom:1px solid var(--line);background:var(--surface)}.filter-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.filter-heading strong{font-size:12px}.filter-reset{min-height:36px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text);font-size:11px}.filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.filter-grid .form-field{min-width:0}.filter-grid select{min-width:0;font-size:12px}.filter-note{margin:12px 0 0;color:var(--muted);font-size:11px}
.customer-row{position:relative}.customer-open{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;border-radius:0;cursor:pointer}.customer-row>span{pointer-events:none}.customer-open:focus-visible{outline-offset:-3px}.paid-control{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:5px;border:1px solid var(--line);border-radius:10px;background:var(--brand-soft);color:var(--brand-dark);font-size:10px;font-weight:750;cursor:pointer}.paid-control.is-unpaid{background:var(--red-soft);color:var(--red)}.paid-control.is-saving{opacity:.65;cursor:wait}.paid-control input{flex:0 0 auto;width:17px;height:17px;margin:0;accent-color:var(--brand);cursor:inherit}.paid-control span{white-space:nowrap}.paid-control:focus-within{outline:2px solid var(--brand);outline-offset:2px}
@media(max-width:1120px){body.detail-open{overflow:hidden}body.detail-open::before{position:fixed;inset:0;z-index:39;background:rgba(8,12,11,.62);content:""}.detail-panel.mobile-open{position:fixed;inset:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom));z-index:40;display:block;overflow:auto;border-radius:20px;box-shadow:0 28px 80px rgba(0,0,0,.45);overscroll-behavior:contain}.detail-panel.mobile-open .mobile-detail-close{display:grid}.mobile-detail-close{width:36px;height:36px;place-items:center;border:1px solid var(--line);border-radius:11px;background:var(--soft);color:var(--text);font-size:20px}.detail-panel.mobile-open .detail-header{position:sticky;top:0;z-index:2;background:var(--surface)}}
@media(max-width:780px){.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.customer-filters{padding:14px 18px}.paid-control{grid-column:2;grid-row:1;min-width:88px}}
@media(max-width:780px){.sync-status{order:4;width:100%;justify-content:center}.header-actions{flex-wrap:wrap;justify-content:flex-end}.logout-button{padding:0 12px}}
@media(max-width:520px){.user-row{grid-template-columns:minmax(0,1fr) auto}.user-actions{grid-column:1/-1;justify-content:flex-end}.detail-panel.mobile-open{inset:max(6px,env(safe-area-inset-top)) 6px max(6px,env(safe-area-inset-bottom));border-radius:16px}.detail-actions .edit-button{padding:0 9px}.detail-actions .edit-button span{display:none}}

.ap-panel{margin-bottom:22px}.ap-content,.ap-dialog-content{padding:20px 22px}.ap-summary{display:grid;grid-template-columns:minmax(170px,.6fr) minmax(0,1.4fr);gap:22px;padding:18px;border:1px solid var(--line);background:var(--soft);border-radius:15px}.ap-label{display:block;color:var(--muted);font-size:12px;font-weight:700}.ap-credit{display:block;margin:8px 0;font-size:32px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.ap-muted{color:var(--muted);font-size:12px;line-height:1.65}.ap-connection{align-self:center;min-width:0}.ap-connection strong{font-size:15px}.ap-connection p{font-size:12px;line-height:1.6;color:var(--muted);margin:7px 0 0;overflow-wrap:anywhere}.ap-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.ap-toolbar button,.ap-dialog-content button{min-height:44px}.ap-message{font-size:13px;line-height:1.65;white-space:pre-line;overflow-wrap:anywhere;margin:12px 0}.ap-message:empty{display:none}.ap-message.error{color:var(--red)}.ap-message.success{color:var(--brand-dark)}.ap-log{white-space:pre-wrap;overflow-wrap:anywhere;max-height:190px;overflow:auto;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--muted);font:12px/1.7 inherit}.ap-customer{margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}.ap-customer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.ap-customer strong{font-size:12px}.ap-customer p{margin:8px 0 0}.ap-customer .small-button{min-height:40px}.ap-toolbar [hidden],.ap-log[hidden]{display:none!important}#apDialog{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}#apKeyForm{display:grid;gap:10px}#apKeyForm .ap-muted{margin:0 0 4px}#apRequirements:not(:empty){border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--soft)}.ap-panel button:disabled,.ap-dialog-content button:disabled{opacity:.5;cursor:not-allowed}.ap-line-status{display:block;margin-top:4px;color:var(--muted);font-size:10px}
@media(max-width:620px){.ap-summary{grid-template-columns:1fr;gap:15px}.ap-content,.ap-dialog-content{padding:14px}.ap-panel .purchase-header{align-items:flex-start;flex-wrap:wrap}.ap-toolbar button{flex:1 1 150px}.ap-credit{font-size:28px}}

.renewal-section{margin-bottom:22px}.renewal-row{padding:18px 0;border-top:1px solid var(--line)}.renewal-row:first-child{border-top:0}.renewal-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;flex-wrap:wrap}.renewal-top strong{font-size:14px}.renewal-values{display:flex;flex-wrap:wrap;gap:8px 18px;margin:12px 0;font-size:12px;font-variant-numeric:tabular-nums}.renewal-badge{border:1px solid var(--line);border-radius:999px;padding:5px 9px;background:var(--soft);color:var(--muted);font-size:11px}.renewal-badge.attention{background:var(--amber-soft);color:var(--amber)}.renewal-badge.success{background:var(--brand-soft);color:var(--brand-dark)}.renewal-row p{margin:7px 0}.renewal-review{background:var(--soft);padding:16px;border:1px solid var(--line);border-radius:12px;font-size:13px;line-height:1.9}.renewal-review strong{display:block;font-size:16px}.renewal-warning{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--amber-soft);color:var(--amber);font-size:12px;line-height:1.7}.renewal-section [hidden],#renewDialog [hidden]{display:none!important}#renewDialog,#renewResolveDialog{width:min(650px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}#renewResolveForm{display:grid;gap:14px}.renewal-fields{padding:0;gap:14px}.renewal-fields .check-field{align-self:center}.renewal-section .small-button{min-height:40px}.renewal-paid{display:inline-flex;gap:8px;align-items:center;min-height:40px;font-size:12px}.renewal-paid input{width:18px;height:18px;accent-color:var(--brand)}.renewal-mini{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}.renewal-mini p{font-size:11px;line-height:1.7;margin:6px 0;color:var(--muted)}.renewal-status-wrap{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

/* Compact AP dashboard only; confirmation dialogs keep their full-size layout. */
.ap-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:stretch;margin-bottom:22px}
.ap-overview>.panel{min-width:0;margin:0;display:flex;flex-direction:column}
.ap-overview>section:only-of-type{grid-column:1/-1}
.ap-overview>.panel>.purchase-header{min-height:80px;padding:14px 16px;gap:12px;flex-direction:row;align-items:center;flex-wrap:wrap}
.ap-overview .purchase-header h2{font-size:16px;line-height:1.4}
.ap-overview .purchase-header p{font-size:11px;line-height:1.5}
.ap-overview .purchase-header .secondary-button{width:auto;min-height:44px;padding:0 12px;font-size:12px}
.ap-overview>.panel>.ap-content{display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px 16px}
.ap-overview .ap-content>.ap-muted,.ap-overview .ap-content>.ap-message{margin:0}
.ap-overview .ap-summary{grid-template-columns:minmax(125px,.8fr) minmax(0,1.2fr);gap:14px;padding:14px;border-radius:12px}
.ap-overview .ap-credit{font-size:28px;margin:6px 0}
.ap-overview .ap-label{font-size:11px}
.ap-overview .ap-connection strong{font-size:13px}
.ap-overview .ap-connection p{font-size:11px;line-height:1.5}
.ap-overview .ap-content>.ap-toolbar{gap:8px;margin:0}
.ap-overview>.panel .ap-toolbar button{min-height:44px;font-size:12px;padding:0 12px;white-space:normal}
.ap-overview .ap-help{color:var(--muted);font-size:12px;line-height:1.6}
.ap-overview .ap-help summary{min-height:44px;align-content:center;cursor:pointer;font-weight:650}
.ap-overview .ap-help p{margin:4px 0 8px}
.ap-overview .ap-help summary:focus-visible,.renewal-history-scroll:focus-visible{outline:2px solid var(--brand);outline-offset:-2px;border-radius:6px}
.ap-overview .guv-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ap-overview .guv-card{padding:12px;border-radius:12px}
.ap-overview .guv-card h3{font-size:11px;line-height:1.4}
.ap-overview .guv-card strong{font-size:22px;margin:6px 0;line-height:1.2;font-variant-numeric:tabular-nums}
.ap-overview .guv-card p{font-size:10px;line-height:1.5}
.ap-overview #renewalCoverage{font-size:11px}
.renewal-history-scroll{min-width:0;max-height:220px;overflow-y:auto;scrollbar-gutter:stable;overflow-wrap:anywhere;border-top:1px solid var(--line)}
.ap-overview .renewal-row{padding:12px 0}
.ap-overview .renewal-top strong{font-size:13px}
.ap-overview .renewal-values{gap:6px 12px;margin:8px 0}
.ap-overview .renewal-row p{margin:5px 0;font-size:11px}
.ap-overview .renewal-row .ap-toolbar{margin:8px 0 0;gap:8px}
.ap-overview .renewal-paid{min-height:44px}
.ap-overview .renewal-status-wrap,.ap-overview .renewal-top>div{min-width:0}
@media(max-width:1039px){
  .ap-overview{grid-template-columns:minmax(0,1fr);gap:16px}
  .ap-overview>.panel>.purchase-header{min-height:0}
}
@media(max-width:480px){
  .ap-overview>.panel>.ap-content,.ap-overview>.panel>.purchase-header{padding:12px 14px}
  .ap-overview .ap-summary{grid-template-columns:minmax(0,1fr);gap:10px;padding:12px}
  .ap-overview .guv-metrics{grid-template-columns:minmax(0,1fr);gap:6px}
  .ap-overview .guv-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px 10px;padding:10px 12px}
  .ap-overview .guv-card h3{grid-column:1;grid-row:1}
  .ap-overview .guv-card p{grid-column:1;grid-row:2}
  .ap-overview .guv-card strong{grid-column:2;grid-row:1/span 2;align-self:center;margin:0;text-align:right;font-size:20px}
  .ap-overview .renewal-history-scroll{max-height:300px;max-height:min(300px,55dvh)}
}

/* Second compact dashboard row; scoped to finance cards, never to the dialogs. */
.finance-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:stretch;margin-bottom:22px}
.finance-overview>.panel{display:flex;flex-direction:column;min-width:0;margin:0}
.finance-overview>.panel>.purchase-header{min-height:80px;padding:14px 16px;gap:12px;flex-direction:row;align-items:center;flex-wrap:wrap}
.finance-overview .purchase-header h2{font-size:16px;line-height:1.4}
.finance-overview .purchase-header p{font-size:11px;line-height:1.5}
.finance-overview .purchase-header .secondary-button{width:auto;min-height:44px;padding:0 12px;font-size:12px}
.finance-overview .purchase-content,.finance-overview .guv-content{display:flex;flex-direction:column;gap:12px;min-width:0;padding:14px 16px}
.finance-overview .purchase-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.finance-overview .purchase-card{min-width:0;gap:8px;padding:12px;border-radius:12px}
.finance-overview .purchase-card>div{min-width:0;overflow-wrap:anywhere}
.finance-overview .purchase-provider{gap:8px;font-size:12px}
.finance-overview .provider-dot{flex-shrink:0;width:8px;height:8px}
.finance-overview .purchase-average strong{font-size:20px;font-variant-numeric:tabular-nums}
.finance-overview .purchase-meta{line-height:1.5}
.finance-overview .purchase-history{min-width:0;margin:0}
.finance-overview .purchase-history-title{margin:0 0 8px}
.finance-overview .purchase-table-scroll{max-height:286px;overflow:auto;scrollbar-gutter:stable;border:1px solid var(--line);border-radius:10px}
.finance-overview .purchase-row{grid-template-columns:70px minmax(30px,.55fr) minmax(56px,.8fr) minmax(76px,1fr) minmax(76px,1fr) 44px;gap:6px;min-width:402px;padding:5px 10px;font-size:11px}
.finance-overview .purchase-row>span{display:block;min-width:0;overflow-wrap:anywhere}
.finance-overview .purchase-row.head{position:sticky;top:0;z-index:1;min-height:32px;font-size:9px;background:var(--soft)}
.finance-overview .purchase-row .small-button{width:44px;min-height:44px;padding:0}
.finance-overview .purchase-empty{padding:20px 12px}
.finance-overview .guv-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.finance-overview .guv-card{padding:12px;border-radius:12px}
.finance-overview .guv-card h3{font-size:11px;line-height:1.4}
.finance-overview .guv-card strong{font-size:22px;line-height:1.2;margin:6px 0;font-variant-numeric:tabular-nums}
.finance-overview .guv-card p{font-size:10px;line-height:1.5}
.finance-overview .guv-coverage{margin:0;padding:9px 11px;font-size:11px;line-height:1.5}
.finance-overview .guv-table-wrap{min-width:0}
.finance-overview .guv-table{min-width:440px;font-size:11px}
.finance-overview .guv-table th,.finance-overview .guv-table td{padding:9px 7px}
.finance-overview .guv-table td{white-space:nowrap}
.finance-overview .guv-table caption{font-size:10px}
.finance-overview .finance-help{font-size:12px;line-height:1.6;color:var(--muted)}
.finance-overview .finance-help summary{min-height:44px;align-content:center;cursor:pointer;font-weight:650}
.finance-overview .guv-note{margin:4px 0 0}
.finance-overview .purchase-table-scroll:focus-visible,.finance-overview .guv-table-wrap:focus-visible,.finance-overview .finance-help summary:focus-visible{outline:2px solid var(--brand);outline-offset:-2px;border-radius:6px}
@media(max-width:1039px){
  .finance-overview{grid-template-columns:minmax(0,1fr);gap:16px}
  .finance-overview>.panel>.purchase-header{min-height:0}
}
@media(max-width:480px){
  .finance-overview .purchase-content,.finance-overview .guv-content,.finance-overview>.panel>.purchase-header{padding:12px 14px}
  .finance-overview .purchase-summary{grid-template-columns:minmax(0,1fr);gap:6px}
  .finance-overview .purchase-card{padding:10px 12px}
  .finance-overview .guv-metrics{grid-template-columns:minmax(0,1fr);gap:6px}
  .finance-overview .guv-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px 10px;padding:10px 12px}
  .finance-overview .guv-card h3{grid-column:1;grid-row:1}
  .finance-overview .guv-card p{grid-column:1;grid-row:2}
  .finance-overview .guv-card strong{grid-column:2;grid-row:1/span 2;align-self:center;margin:0;text-align:right;font-size:20px}
  .finance-overview .purchase-table-scroll{max-height:286px;max-height:min(286px,55dvh)}
}

.ap-create-box{margin:16px 26px 0;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.ap-create-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 0;padding:12px 0 0;border:0;border-top:1px solid var(--line);min-width:0}
.ap-create-options legend{font-size:12px;font-weight:700;padding:0 8px 0 0;color:var(--text)}
.ap-create-options .full{grid-column:1/-1}.ap-create-options button{align-self:end;min-height:44px}
.ap-create-message{margin:12px 26px}.ap-create-reference{overflow-wrap:anywhere}
#apCreateReviewPanel>button{margin-top:12px;min-height:44px}
.ap-create-history-scroll{max-height:240px;overflow:auto;scrollbar-gutter:stable}
.ap-create-history-row{padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.ap-create-history-row p{margin:5px 0}.ap-create-history-row strong{font-size:12px}
.ap-create-history .ap-toolbar{margin:8px 0 0;gap:8px}
.ap-create-history-scroll:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
#apCreateResolveDialog{width:min(660px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}
#apCreateResolveForm{display:grid;gap:14px}
#customerForm [hidden],#apCreateResolveDialog [hidden]{display:none!important}
@media(max-width:520px){.ap-create-box{margin:12px 16px 0;padding:12px}.ap-create-options{grid-template-columns:minmax(0,1fr)}.ap-create-options .full{grid-column:auto}.ap-create-message{margin:12px 16px}}


/* Kompaktes Konto-Menü: Sicherheit und Benutzerverwaltung ohne überladene Kopfzeile. */
.header-actions{position:relative}
.account-button-icon{display:none;font-size:19px;line-height:1}
.account-dialog{width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:0}
.account-menu-content{display:grid;gap:8px;padding:18px 20px 22px}
.account-menu-item{display:grid;width:100%;min-height:68px;grid-template-columns:38px minmax(0,1fr) 18px;gap:12px;align-items:center;padding:11px 13px;border:1px solid var(--line);border-radius:14px;background:var(--soft);color:var(--text);text-align:left;text-decoration:none;transition:.16s}
.account-menu-item:hover{border-color:var(--brand);background:var(--brand-soft);transform:translateY(-1px)}
.account-menu-item:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.account-menu-item strong,.account-menu-item small{display:block}
.account-menu-item strong{font-size:13px}.account-menu-item small{margin-top:3px;color:var(--muted);font-size:10px;line-height:1.45}
.account-menu-icon{display:grid;width:36px;height:36px;place-items:center;border-radius:11px;background:var(--surface);color:var(--brand);font-size:20px;font-weight:800}
.account-menu-logout .account-menu-icon{color:var(--red)}
@media(max-width:780px){
  .header-actions{flex-wrap:nowrap}.topbar .sync-status{order:0;width:auto}.account-button{width:46px;min-width:46px;height:46px;padding:0}.account-button-label{display:none}.account-button-icon{display:inline}
}
@media(max-width:680px){
  .topbar{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}.header-actions{display:grid;width:100%;grid-template-columns:minmax(0,1fr) 46px 46px 46px;gap:8px}.topbar .sync-status{grid-column:1;justify-content:flex-start;min-width:0;overflow:hidden}.topbar .sync-status #syncText{overflow:hidden;text-overflow:ellipsis}.header-actions .theme-toggle,.header-actions .account-button,.header-actions>.primary-button{width:46px;min-width:46px}
}
@media(max-width:380px){
  .app-shell{padding:12px}.brand{gap:10px}.brand h1{font-size:19px}.header-actions{grid-template-columns:minmax(0,1fr) 42px 42px 42px}.header-actions .theme-toggle,.header-actions .account-button,.header-actions>.primary-button{width:42px;min-width:42px;height:42px;min-height:42px}.topbar .sync-status{padding:0 8px;font-size:10px}
}
