/* Service Billing — UI styles. No build step. */
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f8fafc; --border: #e5e7eb; --border-strong: #d1d5db;
  --text: #0f172a; --text-2: #475569; --muted: #64748b;
  --primary: #4f46e5; --primary-600: #4338ca; --primary-50: #eef2ff; --primary-100: #e0e7ff;
  --green: #059669; --green-50: #ecfdf5; --red: #dc2626; --red-50: #fef2f2; --amber: #d97706; --amber-50: #fffbeb;
  --blue: #2563eb; --blue-50: #eff6ff; --violet: #7c3aed; --violet-50: #f5f3ff; --gray-50: #f1f5f9;
  --sidebar: #0f172a; --sidebar-text: #cbd5e1; --sidebar-muted: #64748b; --sidebar-active: #1e293b;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --c-plan: #a5b4fc; --c-actual: #4f46e5; --c-forecast: #f59e0b; --c-dep: #14b8a6; --c-muted: #94a3b8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --border: #1f2937; --border-strong: #334155;
    --text: #e5e7eb; --text-2: #cbd5e1; --muted: #94a3b8;
    --primary: #818cf8; --primary-600: #a5b4fc; --primary-50: #1e1b4b; --primary-100: #312e81;
    --green: #34d399; --green-50: #052e2b; --red: #f87171; --red-50: #3b0d0d; --amber: #fbbf24; --amber-50: #3a2a05;
    --blue: #60a5fa; --blue-50: #0c1d3a; --violet: #a78bfa; --violet-50: #241a42; --gray-50: #1f2937;
    --sidebar: #060a14; --sidebar-active: #111827;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
    --c-plan: #4c51bf; --c-actual: #a5b4fc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --border: #1f2937; --border-strong: #334155;
  --text: #e5e7eb; --text-2: #cbd5e1; --muted: #94a3b8;
  --primary: #818cf8; --primary-600: #a5b4fc; --primary-50: #1e1b4b; --primary-100: #312e81;
  --green: #34d399; --green-50: #052e2b; --red: #f87171; --red-50: #3b0d0d; --amber: #fbbf24; --amber-50: #3a2a05;
  --blue: #60a5fa; --blue-50: #0c1d3a; --violet: #a78bfa; --violet-50: #241a42; --gray-50: #1f2937;
  --sidebar: #060a14; --sidebar-active: #111827;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  --c-plan: #4c51bf; --c-actual: #a5b4fc;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; margin-bottom: 12px; } h3 { font-size: 15px; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 600; } .nowrap { white-space: nowrap; }
.inline { display: inline; }
input, select, textarea, button { font: inherit; color: inherit; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; color: var(--sidebar-muted); }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.nav-group { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-muted); font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; margin: 1px 10px; padding: 8px 12px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500; }
.nav-link:hover { background: var(--sidebar-active); text-decoration: none; color: #fff; }
.nav-link.active { background: rgba(99,102,241,.18); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.sidebar-foot { margin-top: auto; padding: 16px 20px; font-size: 11px; color: var(--sidebar-muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.only-mobile { display: none !important; }
.backdrop { display: none; }

/* User menu */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 10px; text-align: left; font-weight: 600; }
.user-btn:hover { background: var(--gray-50); }
.user-btn small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-100); color: var(--primary-600); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 230px; padding: 6px; display: none; z-index: 30; }
.dropdown.open { display: block; }
.dropdown a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.dropdown a:hover { background: var(--gray-50); text-decoration: none; }

/* Page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--gray-50); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.3); }
:root[data-theme="dark"] .btn-primary { color: #0b1120; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0b1120; } }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-50); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.btn-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.btn-icon:hover { background: var(--gray-50); color: var(--text); text-decoration: none; }
.btn-icon.danger:hover { background: var(--red-50); color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--gray-50); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; cursor: pointer; white-space: nowrap; }
a.chip:hover { text-decoration: none; border-color: var(--primary); }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
details.card > summary { cursor: pointer; list-style: none; margin: 0; }
details.card[open] > summary { margin-bottom: 14px; }
.link { font-size: 13px; font-weight: 550; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.grid-2 > .card, .grid-2-1 > .card { margin-bottom: 18px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .8; }
.kpi.warn::after { background: var(--amber); } .kpi.alert::after { background: var(--red); } .kpi.ok::after { background: var(--green); }
.kpi-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.kpi.warn .kpi-ic { background: var(--amber-50); color: var(--amber); } .kpi.alert .kpi-ic { background: var(--red-50); color: var(--red); } .kpi.ok .kpi-ic { background: var(--green-50); color: var(--green); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--muted); }

/* Hints & tips */
.hint { background: linear-gradient(0deg, var(--primary-50), var(--primary-50)); border: 1px solid var(--primary-100); border-radius: var(--radius); margin-bottom: 18px; color: var(--text-2); }
.hint summary { display: flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--primary-600); list-style: none; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary::after { content: "Сховати"; margin-left: auto; font-weight: 500; font-size: 12px; opacity: .7; }
.hint:not([open]) summary::after { content: "Показати"; }
.hint-body { padding: 0 16px 12px 40px; }
.hint-body ul { margin: 4px 0 8px; padding-left: 18px; }
.hint-body p:last-child { margin-bottom: 0; }
.tip { position: relative; display: inline-flex; vertical-align: middle; color: var(--muted); cursor: help; margin-left: 2px; }
.tip:hover, .tip:focus { color: var(--primary); outline: none; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; background: #0f172a; color: #f8fafc; font-size: 12px; font-weight: 400; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 50; white-space: normal; text-transform: none; letter-spacing: 0; }
.report-desc { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-gray { background: var(--gray-50); color: var(--text-2); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--gray-50); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.delta { white-space: nowrap; } .delta.neg, td.neg { color: var(--red); } .delta.pos, td.pos { color: var(--green); }
.delta small { opacity: .8; }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table th:first-child { border-top-left-radius: 8px; } .table th:last-child { border-top-right-radius: 8px; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table.compact td { padding: 7px 10px; } .table.compact th { padding: 8px 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text); }
.table th.sorted-asc::after { content: " ▲"; font-size: 9px; } .table th.sorted-desc::after { content: " ▼"; font-size: 9px; }
.row-muted td { opacity: .55; }
.row-hl td { background: var(--primary-50) !important; font-weight: 600; }
.row-new td { background: var(--surface-2); }
.details-cell { max-width: 420px; word-break: break-word; color: var(--muted); }
.table td input:not([type=checkbox]):not([type=color]) { width: 100%; }

/* Progress */
.bar { height: 7px; background: var(--gray-50); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.bar-warn span { background: var(--amber); } .bar-alert span { background: var(--red); } .bar-info span { background: var(--primary); }

/* Filters */
.filters { display: flex; gap: 8px; }
.filters-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 18px; }
.filters-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.filters-bar input, .filters-bar select { min-width: 150px; }

/* Forms */
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.input-sm { width: 70px !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; } .field-row > .field.narrow { flex: 0 0 110px; }
.span-2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; align-self: end; padding-bottom: 8px; }
.form-section { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.form > .form-section:first-of-type, .form fieldset > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix input { padding-right: 46px !important; text-align: right; }
.input-suffix span { position: absolute; right: 10px; color: var(--muted); font-size: 12.5px; pointer-events: none; }
.input-suffix.narrow { width: 110px; flex: 0 0 110px; }
.input-btn { display: flex; gap: 8px; }
.presets { display: flex; gap: 6px; margin-top: 4px; }
.calc-preview:not(:empty) { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 13px; }
.calc-preview b { color: var(--text); }
.alloc { display: flex; flex-direction: column; gap: 8px; }
.alloc-row { display: flex; gap: 8px; align-items: center; }
.alloc-row select { flex: 1; }
.alloc-row > .input-suffix:not(.narrow) { width: 170px; flex: 0 0 170px; }
.alloc-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.alloc-sum { margin-left: auto; font-weight: 600; font-size: 13px; }
.alloc-sum.ok { color: var(--green); } .alloc-sum.bad { color: var(--red); }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-color: var(--red-50); }
.danger-zone p { margin: 2px 0 0; }

/* Flash */
.flash { position: relative; padding: 11px 40px 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash-success { background: var(--green-50); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.flash-error { background: var(--red-50); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.flash-warning { background: var(--amber-50); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.flash-x { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 20px; cursor: pointer; color: inherit; opacity: .6; }

/* Empty */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { opacity: .5; }
.empty h2 { color: var(--text); margin: 0; }

/* Entity cards */
.entity-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.entity-head { display: flex; gap: 12px; align-items: flex-start; }
.entity-head > div { flex: 1; }
.entity-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stats-row b { display: block; font-size: 18px; } .stats-row span { font-size: 11.5px; color: var(--muted); }
.entity-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* Tabs */
.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-color: var(--primary); }
.tabs-right { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; }
.tabs-right select { width: auto; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rtab { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 550; font-size: 13px; }
.rtab:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.rtab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Misc */
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.tl-date { font-size: 12px; color: var(--muted); }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.pager a { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.best-practices ul { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); }
.best-practices li { margin-bottom: 6px; }
.steps { padding-left: 20px; } .steps li { margin-bottom: 8px; }
.tree { background: var(--surface-2); border-radius: 8px; padding: 14px; font-size: 13px; overflow-x: auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 8px; color: var(--text-2); }
canvas { max-width: 100%; }

/* Auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% 10%, rgba(99,102,241,.18), transparent), radial-gradient(900px 500px at 90% 90%, rgba(139,92,246,.15), transparent), var(--bg); padding: 20px; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 940px; width: 100%; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.auth-side { background: linear-gradient(160deg, #1e1b4b, #312e81 60%, #4338ca); color: #e0e7ff; padding: 40px; display: flex; flex-direction: column; gap: 22px; }
.auth-side h2 { color: #fff; font-size: 22px; line-height: 1.35; }
.brand.big { padding: 0; }
.brand.big small { color: #a5b4fc; }
.auth-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-list li { display: flex; gap: 10px; align-items: center; }
.auth-card { padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 24px; }

/* Responsive */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .grid-2, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
  .only-mobile { display: inline-grid !important; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; }
  .hide-mobile { display: none; }
  .table-scroll, .card > .table { display: block; overflow-x: auto; }
  .alloc-row { flex-wrap: wrap; } .alloc-row select { flex-basis: 100%; }
  .dl { grid-template-columns: 1fr; } .dl dt { margin-top: 6px; }
  .filters-bar input, .filters-bar select { min-width: 0; }
  .filters-bar label { flex: 1 1 140px; }
}
@media print {
  .sidebar, .topbar, .filters-bar, .page-actions, .report-tabs, .hint, .best-practices { display: none !important; }
  .content { padding: 0; } .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

.chart-box { position: relative; width: 100%; }
.chart-box + .table, .chart-box + .table-scroll { margin-top: 14px; }
