:root { color-scheme: light; --ink:#192235; --muted:#6e7789; --line:#e2e6ed; --soft:#f5f7fb; --violet:#6758e8; --violet-dark:#5143c7; --green:#16845b; --red:#b74343; }
* { box-sizing:border-box; }
body { margin:0; background:#f6f7fa; color:var(--ink); font-family:Inter,Segoe UI,Arial,sans-serif; }
button,input,textarea { font:inherit; }
select { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
.topbar { height:68px; display:flex; align-items:center; justify-content:space-between; padding:0 max(24px,calc((100vw - 1240px)/2)); background:#12182a; color:white; }
.brand { display:flex; align-items:center; gap:11px; color:white; text-decoration:none; }
.brand span { width:35px; height:35px; display:grid; place-items:center; border-radius:10px; background:var(--violet); font-weight:900; }
.top-actions { display:flex; align-items:center; gap:12px; }
.top-actions a,.top-actions button { border:0; background:transparent; color:#cdd4e4; text-decoration:none; }
main { max-width:1240px; margin:0 auto; padding:34px 24px 70px; }
.login-card { max-width:500px; margin:12vh auto 0; padding:34px; border:1px solid var(--line); border-radius:20px; background:white; text-align:center; box-shadow:0 20px 60px #1a26420f; }
.login-card h1 { margin:12px 0 8px; }
.login-card p { color:var(--muted); line-height:1.55; }
.login-card form { display:grid; gap:16px; margin-top:24px; text-align:left; }
.login-icon { font-size:34px; }
.page-heading { display:grid; grid-template-columns:1fr 180px 180px; gap:16px; align-items:stretch; margin-bottom:24px; }
.page-heading h1 { margin:4px 0 5px; font-size:30px; }
.page-heading p { margin:0; color:var(--muted); }
.eyebrow { color:var(--violet)!important; font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.summary { display:flex; flex-direction:column; justify-content:center; padding:18px; border:1px solid var(--line); border-radius:16px; background:white; }
.summary strong { font-size:25px; }
.summary span { margin-top:3px; color:var(--muted); font-size:12px; }
.tabs { display:flex; gap:6px; margin-bottom:18px; padding:5px; width:max-content; border:1px solid var(--line); border-radius:12px; background:white; }
.tabs button { padding:9px 13px; border:0; border-radius:8px; background:transparent; color:var(--muted); }
.tabs button.active { background:#eeecff; color:var(--violet-dark); font-weight:750; }
.tab-panel { padding:24px; border:1px solid var(--line); border-radius:18px; background:white; box-shadow:0 10px 35px #24304d0a; }
.section-title { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.section-title h2 { margin:0 0 5px; font-size:20px; }
.section-title p { margin:0; color:var(--muted); font-size:13px; line-height:1.45; }
.primary,.secondary { padding:10px 14px; border:0; border-radius:10px; font-weight:750; }
.primary { background:var(--violet); color:white; }
.primary:hover { background:var(--violet-dark); }
.secondary { background:#edf0f5; color:#3d4659; }
.cards,.rules,.audit { display:grid; gap:10px; }
.company-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.company-card { min-height:160px; display:flex; flex-direction:column; padding:17px; border:1px solid var(--line); border-radius:15px; background:white; color:inherit; text-align:left; transition:.16s; }
.company-card:hover { transform:translateY(-2px); border-color:#bcb5fa; box-shadow:0 10px 28px #25304c12; }
.company-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.company-monogram { width:40px; height:40px; display:grid; place-items:center; border-radius:11px; background:#eeecff; color:var(--violet); font-weight:850; }
.provider-state { padding:5px 7px; border-radius:999px; background:#e8f7f0; color:var(--green); font-size:10px; font-weight:750; }
.provider-state.warning { background:#fff2dd; color:#9a6617; }
.company-card h3 { margin:14px 0 4px; font-size:16px; }
.company-card>span { color:var(--muted); font-size:11px; }
.company-metrics { display:flex; gap:16px; margin-top:auto; padding-top:14px; }
.company-metrics strong { display:block; font-size:14px; }
.company-metrics small { color:var(--muted); font-size:10px; }
.back-button { margin-bottom:18px; padding:0; border:0; background:transparent; color:var(--violet-dark); font-weight:700; }
.company-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.company-heading h2 { margin:4px 0 5px; font-size:24px; }
.company-heading p { margin:0; color:var(--muted); font-size:12px; }
.company-actions { display:flex; gap:9px; }
.rules-help { margin:16px 0; padding:11px 13px; border-radius:10px; background:#f5f4ff; color:#5b5483; font-size:12px; }
.form-note { margin:16px 0 0; padding:11px; border-radius:10px; background:#fff5e5; color:#835b1d; font-size:12px; line-height:1.45; }
.manager-row,.rule-row,.audit-row { display:grid; align-items:center; gap:14px; padding:15px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.manager-row { grid-template-columns:minmax(180px,1fr) minmax(190px,1fr) 110px 90px; }
.rule-row { grid-template-columns:minmax(160px,1.1fr) minmax(210px,1.4fr) 150px 110px 90px; }
.row-title strong { display:block; }
.row-title span,.cell span { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
.cell { font-size:13px; line-height:1.45; }
.badge { display:inline-flex; width:max-content; padding:5px 8px; border-radius:999px; background:#e8f7f0; color:var(--green); font-size:11px; font-weight:750; }
.badge.off { background:#f2f3f6; color:#7c8493; }
.edit { padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:white; color:#445066; }
.audit-row { grid-template-columns:150px 140px 1fr; align-items:start; }
.audit-row time,.audit-row span { color:var(--muted); font-size:12px; }
.audit-row pre { max-height:100px; margin:5px 0 0; overflow:auto; color:#566074; font:11px/1.4 Consolas,monospace; white-space:pre-wrap; }
label { display:grid; gap:6px; color:#60697a; font-size:12px; font-weight:650; }
input,textarea,select { width:100%; padding:10px 11px; border:1px solid #d9dee7; border-radius:9px; background:white; color:var(--ink); outline:none; }
input:focus,textarea:focus,select:focus { border-color:#a49bf4; box-shadow:0 0 0 3px #6a59e814; }
.history-filters { display:grid; grid-template-columns:170px 170px minmax(220px,1fr) auto; gap:12px; align-items:end; margin-bottom:18px; padding:15px; border-radius:13px; background:var(--soft); }
.history-note { margin-bottom:16px; padding:11px 13px; border-radius:10px; background:#fff5e5; color:#80591d; font-size:12px; line-height:1.45; }
.history-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.history-kpis>div { padding:15px; border:1px solid var(--line); border-radius:13px; background:white; }
.history-kpis strong { display:block; font-size:24px; }
.history-kpis span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.history-chart-panel { padding:16px; border:1px solid var(--line); border-radius:14px; }
.history-chart-title { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.history-chart-title span { color:var(--muted); font-size:12px; }
.history-chart { height:190px; display:flex; align-items:flex-end; gap:5px; overflow-x:auto; padding:8px 2px 0; border-bottom:1px solid var(--line); }
.history-bar-column { min-width:24px; height:100%; display:flex; flex:1 0 24px; flex-direction:column; justify-content:flex-end; align-items:center; }
.history-bar-column>span { min-height:16px; color:var(--muted); font-size:9px; }
.history-bar { width:min(22px,75%); min-height:2px; border-radius:5px 5px 0 0; background:linear-gradient(180deg,var(--violet),#9488f4); }
.history-bar-column small { padding:5px 0; color:var(--muted); font-size:9px; white-space:nowrap; }
.history-table-wrap { margin-top:16px; overflow:auto; border:1px solid var(--line); border-radius:13px; }
.history-table { width:100%; border-collapse:collapse; font-size:12px; }
.history-table th,.history-table td { padding:11px 12px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
.history-table th:first-child,.history-table th:nth-child(2),.history-table td:first-child,.history-table td:nth-child(2) { text-align:left; }
.history-table thead { background:var(--soft); color:var(--muted); }
.history-table tbody tr:last-child td { border-bottom:0; }
.positive { color:var(--green); }.negative { color:var(--red); }.empty-cell { padding:25px!important; color:var(--muted); text-align:center!important; }
dialog { width:min(760px,calc(100% - 28px)); max-height:90vh; padding:0; border:0; border-radius:18px; box-shadow:0 30px 90px #151d3050; }
dialog::backdrop { background:#151d3070; backdrop-filter:blur(2px); }
dialog form { padding:24px; overflow:auto; }
.dialog-heading { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; }
.dialog-heading h2 { margin:3px 0 0; }
.close { width:34px; height:34px; border:0; border-radius:9px; background:#eff1f5; color:#70798a; font-size:22px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-grid.three { grid-template-columns:repeat(3,1fr); }
.wide { grid-column:1/-1; }.wide-all { grid-column:1/-1; }
.switch { display:flex; flex-direction:row; align-items:center; gap:9px; }
.switch input { width:17px; height:17px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:22px; }
.toast { position:fixed; right:24px; bottom:24px; max-width:360px; padding:13px 16px; border-radius:11px; background:#182135; color:white; opacity:0; transform:translateY(8px); pointer-events:none; transition:.18s; }
.toast.show { opacity:1; transform:none; }
.empty { padding:30px; border:1px dashed var(--line); border-radius:12px; color:var(--muted); text-align:center; }
[hidden] { display:none!important; }
@media(max-width:900px){.company-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.page-heading{grid-template-columns:1fr 1fr}.page-heading>div:first-child{grid-column:1/-1}.manager-row,.rule-row,.audit-row{grid-template-columns:1fr 1fr}.form-grid.three{grid-template-columns:1fr 1fr}.section-title,.company-heading{flex-direction:column}.tabs{max-width:100%;overflow:auto}.history-filters{grid-template-columns:1fr 1fr}.history-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:520px){main{padding:22px 14px}.topbar{padding:0 14px}.brand strong{display:none}.page-heading,.manager-row,.rule-row,.audit-row,.form-grid,.form-grid.three,.company-grid,.history-filters,.history-kpis{grid-template-columns:1fr}.wide,.wide-all{grid-column:auto}.summary{padding:14px}.tab-panel{padding:16px}.tabs{width:100%}.tabs button{white-space:nowrap}.section-title .primary,.company-actions,.company-actions button{width:100%}.company-actions{flex-direction:column}}
