:root {
  --bg: #eef3f7;
  --bg-soft: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --panel-raised: #f7f9fc;
  --line: rgba(31, 55, 80, 0.11);
  --line-strong: rgba(31, 55, 80, 0.2);
  --text: #17263a;
  --muted: #718196;
  --muted-light: #506176;
  --green: #11966a;
  --green-soft: rgba(17, 150, 106, 0.12);
  --blue: #347fd5;
  --blue-soft: rgba(52, 127, 213, 0.12);
  --amber: #bd7910;
  --amber-soft: rgba(205, 137, 30, 0.13);
  --red: #d84e58;
  --red-soft: rgba(216, 78, 88, 0.11);
  --radius: 18px;
  --shadow: 0 14px 35px rgba(31, 55, 80, 0.09);
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, rgba(64, 132, 205, 0.12), transparent 36%),
    radial-gradient(circle at 85% 5%, rgba(46, 171, 132, 0.09), transparent 31%),
    var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dashboard-page { overflow-x: hidden; }

button, select, input { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .14;
  pointer-events: none;
  z-index: -1;
}
.ambient-one { width: 360px; height: 360px; background: #79b3eb; top: 3%; left: -180px; }
.ambient-two { width: 330px; height: 330px; background: #78d2b4; right: -170px; bottom: 6%; }

.dashboard-shell {
  width: min(1880px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.brand h1 { font-size: clamp(23px, 1.8vw, 34px); line-height: 1; margin: 4px 0 0; letter-spacing: -.035em; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 700; margin: 0; }
.brand-mark {
  width: 45px; height: 45px; border-radius: 13px; background: linear-gradient(145deg, #54d5a0, #18936b);
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 11px;
  box-shadow: 0 10px 30px rgba(65, 205, 150, .18);
}
.brand-mark span { display: block; width: 5px; border-radius: 3px 3px 1px 1px; background: #063a2c; }
.brand-mark span:nth-child(1) { height: 10px; opacity: .6; }
.brand-mark span:nth-child(2) { height: 18px; opacity: .82; }
.brand-mark span:nth-child(3) { height: 25px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.data-clock {
  height: 53px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: 13px;
}
.data-clock > div { display: flex; flex-direction: column; gap: 2px; }
.data-clock strong { font-size: 14px; }
.muted-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.status-dot.warning { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }

.filters { display: flex; gap: 6px; }
.filters > label {
  height: 53px; min-width: 95px; display: flex; flex-direction: column; justify-content: center;
  padding: 5px 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .82); border-radius: 13px;
}
.filters > label > span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.filters > label > select { border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; padding: 2px 21px 1px 0; cursor: pointer; }
.filters option { background: var(--panel-solid); }

.multi-filter { position: relative; }
.multi-filter-trigger {
  height: 53px; min-width: 130px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  column-gap: 12px; align-content: center; text-align: left; padding: 6px 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.82); color: var(--text); border-radius: 13px; cursor: pointer;
}
.multi-filter-trigger > span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.multi-filter-trigger > strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.multi-filter-trigger > i { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--muted); font-style: normal; }
.multi-filter-trigger[aria-expanded="true"] { border-color: rgba(52,127,213,.42); box-shadow: 0 0 0 3px rgba(52,127,213,.08); }
.multi-filter-trigger:disabled { opacity: .58; cursor: not-allowed; }
.direction-filter .multi-filter-trigger { width: 220px; }
.filter-menu {
  position: absolute; z-index: 35; top: calc(100% + 8px); right: 0; width: 240px; padding: 10px;
  background: #ffffff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 18px 45px rgba(31,55,80,.16);
}
.direction-menu { width: 270px; }
.filter-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 3px 8px; }
.filter-menu-head strong { font-size: 12px; }
.filter-menu-head button { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.filter-options { max-height: 286px; overflow-y: auto; display: grid; gap: 2px; padding: 3px 1px; scrollbar-width: thin; }
.filter-option { min-height: 32px; display: grid; grid-template-columns: 17px 1fr; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 8px; color: var(--muted-light); font-size: 12px; cursor: pointer; }
.filter-option:hover { background: var(--blue-soft); color: var(--text); }
.filter-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid rgba(31,55,80,.24); border-radius: 5px; background: white; }
.filter-option input:checked + .custom-check { background: var(--blue); border-color: var(--blue); }
.filter-option input:checked + .custom-check::after { content: ""; width: 7px; height: 4px; border-left: 2px solid white; border-bottom: 2px solid white; transform: translateY(-1px) rotate(-45deg); }
.filter-menu-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; margin-top: 6px; border-top: 1px solid var(--line); }
.filter-text-button, .filter-apply-button { border: 0; border-radius: 8px; padding: 8px 11px; font-size: 11px; font-weight: 750; cursor: pointer; }
.filter-text-button { background: transparent; color: var(--blue); }
.filter-apply-button { background: var(--blue); color: white; }

.icon-button {
  width: 53px; height: 53px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 13px; background: rgba(255, 255, 255, .82); color: var(--muted-light); cursor: pointer;
  transition: .2s ease; text-decoration: none;
}
.icon-button:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.alert-bar {
  margin: -2px 0 13px; padding: 8px 14px; border: 1px solid rgba(189, 121, 16, .2);
  border-radius: 12px; background: #fff8e9; color: #8a5b13; font-size: 13px;
}
.alert-bar.error { border-color: rgba(216,78,88,.2); background: #fff2f3; color: #a43841; }
.hidden { display: none !important; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(310px, .82fr); gap: 14px; margin-bottom: 14px; }
.metric-card, .debt-panel, .table-panel, .admin-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(249, 251, 253, .98));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.metric-card { padding: 20px 22px 18px; position: relative; overflow: hidden; min-height: 218px; }
.metric-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; top: -90px; border-radius: 50%; opacity: .12; }
.sales-card::after { background: var(--green); }
.postup-card::after { background: var(--blue); }
.metric-head, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.metric-kicker { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 750; }
.metric-icon { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 7px; font-size: 13px; }
.sales-icon { background: var(--green-soft); color: var(--green); }
.postup-icon { background: var(--blue-soft); color: var(--blue); }
.metric-context { margin: 5px 0 0 32px; color: var(--muted); font-size: 11px; }
.metric-badge, .percentage-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 800; }
.metric-badge { min-width: 70px; padding: 7px 11px; font-size: 15px; background: rgba(143,163,186,.1); color: var(--muted-light); }
.metric-badge.good, .percentage-pill.good { background: var(--green-soft); color: var(--green); }
.metric-badge.watch, .percentage-pill.watch { background: var(--amber-soft); color: var(--amber); }
.metric-badge.risk, .percentage-pill.risk { background: var(--red-soft); color: var(--red); }
.metric-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 22px; }
.metric-main > div { display: flex; flex-direction: column; gap: 5px; }
.metric-plan { align-items: flex-end; }
.metric-caption { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.metric-value { font-size: clamp(26px, 2vw, 39px); letter-spacing: -.04em; line-height: 1; }
.metric-plan strong { font-size: clamp(16px, 1.2vw, 22px); }
.progress-track { height: 5px; background: rgba(143,163,186,.14); border-radius: 10px; margin-top: 20px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .45s ease; }
.sales-card .progress-track span { background: linear-gradient(90deg, #35ba7e, #6ce8ad); }
.postup-card .progress-track span { background: linear-gradient(90deg, #468eea, #7bb8ff); }
.metric-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; color: var(--muted); font-size: 11px; }
.metric-foot strong { color: var(--text); font-size: 13px; }
.metric-foot strong.positive-gap { color: var(--amber); }
.metric-foot strong.negative-gap { color: var(--green); }
.direction-splits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.direction-splits > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.direction-splits span { color: var(--muted); font-size: 8px; font-weight: 780; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.direction-splits strong { color: var(--text); font-size: 11px; white-space: nowrap; }
.direction-split-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.direction-realization { padding: 2px 5px; border-radius: 999px; font-size: 9px; line-height: 1.2; white-space: nowrap; }
.direction-realization.good { color: var(--green); background: var(--green-soft); }
.direction-realization.watch { color: var(--amber); background: var(--amber-soft); }
.direction-realization.risk { color: var(--red); background: var(--red-soft); }

.debt-panel { padding: 18px 19px; }
.panel-heading h2 { font-size: 19px; margin: 4px 0 0; letter-spacing: -.02em; }
.currency-chip, .status-pill { padding: 5px 9px; border-radius: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.currency-chip { background: rgba(143,163,186,.1); color: var(--muted-light); }
.debt-list { margin-top: 12px; display: grid; gap: 7px; }
.debt-item { background: rgba(238, 243, 248, .68); border: 1px solid rgba(31,55,80,.07); border-radius: 11px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.debt-name { display: flex; align-items: center; gap: 9px; color: var(--muted-light); font-size: 11px; font-weight: 750; }
.debt-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.debt-name i.manual { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.debt-name i.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.debt-amount { font-size: 16px; font-weight: 800; white-space: nowrap; }
.debt-meta { display: block; color: var(--muted); font-size: 9px; text-align: right; margin-top: 2px; }
.debt-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.debt-summary > div { display: flex; flex-direction: column; gap: 2px; }
.debt-summary > div:last-child { text-align: right; }
.debt-summary span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.debt-summary strong { font-size: 13px; }

.table-panel { overflow: hidden; }
.table-heading { padding: 15px 18px 12px; align-items: center; }
.table-heading-actions { display: flex; align-items: center; gap: 18px; }
.table-legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; margin-right: 5px; }
.legend-dot.good { background: var(--green); }
.legend-dot.watch { background: var(--amber); }
.legend-dot.risk { background: var(--red); }
.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; }
.table-panel table { min-width: 1120px; }
th, td { padding: 9px 13px; text-align: right; border-bottom: 1px solid rgba(31,55,80,.07); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; font-weight: 780; }
td { font-size: clamp(11px, .72vw, 13px); font-weight: 620; }
tbody td { transition: background-color .15s ease, color .15s ease; }
tbody tr:hover td { background-color: #e5edf5; }
tbody tr:last-child td { border-bottom: 0; }
.direction-column, td.direction { text-align: left; position: sticky; left: 0; background: var(--panel-solid); z-index: 2; }
td.direction { color: var(--text); font-weight: 780; min-width: 155px; }
.unit-column { width: 82px; min-width: 82px; text-align: center; }
.group-row th { padding-top: 8px; padding-bottom: 6px; text-align: center; }
.group-row .direction-column { text-align: left; }
.table-panel thead th { position: sticky; background: #f8fafc; z-index: 4; }
.table-panel thead .group-row th { top: 0; height: 27px; }
.table-panel thead tr:nth-child(2) th { top: 27px; box-shadow: inset 0 -1px 0 var(--line-strong); }
.table-panel thead .direction-column { top: 0; z-index: 6; box-shadow: inset -1px 0 0 var(--line); }
.table-panel thead .unit-column { top: 0; z-index: 5; box-shadow: inset -1px 0 0 var(--line); }
.sales-group { color: var(--green); border-left: 1px solid var(--line); }
.postup-group { color: var(--blue); border-left: 1px solid var(--line); }
.volume-group { color: #7559bd; border-left: 1px solid var(--line); }
.current-group { color: var(--green); border-left: 1px solid var(--line); }
.history-group { color: var(--blue); border-left: 1px solid var(--line); }
.history-group.older { color: #7559bd; }
.current-start, .history-start { border-left: 1px solid var(--line); }
.postup-start { border-left: 1px solid var(--line); }
.volume-start { border-left: 1px solid var(--line); }
.unit-name { color: var(--muted-light); font-weight: 750; }
.percentage-pill { min-width: 56px; padding: 5px 8px; font-size: 12px; }
.trend-pill { display: inline-flex; min-width: 55px; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.trend-pill.positive { color: var(--green); background: var(--green-soft); }
.trend-pill.negative { color: var(--red); background: var(--red-soft); }
.trend-pill.neutral { color: var(--muted-light); background: rgba(113,129,150,.1); }
.number-muted { color: var(--muted-light); }
.remaining-risk { color: var(--amber); }
.remaining-good { color: var(--green); }
.empty-cell { color: rgba(113,129,150,.55); }
.table-footer { min-height: 35px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 8px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }

.loading-screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; background: rgba(244,248,251,.92); backdrop-filter: blur(8px); z-index: 20; color: var(--muted-light); font-size: 13px; transition: opacity .25s ease; }
.loading-screen.done { opacity: 0; pointer-events: none; }
.loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(143,163,186,.18); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-page { min-height: 100vh; overflow: hidden; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.99), rgba(248,251,253,.98));
  box-shadow: 0 24px 70px rgba(31,55,80,.14);
}
.login-brand { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.035em; }
.login-copy { margin: 25px 0 20px; }
.login-copy h2 { margin: 0; font-size: 20px; }
.login-copy p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 7px; color: var(--muted-light); font-size: 11px; font-weight: 750; }
.login-form input {
  width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 11px;
  outline: 0; background: #fff; color: var(--text); font-size: 14px; transition: .18s ease;
}
.login-form input:focus { border-color: rgba(52,127,213,.55); box-shadow: 0 0 0 4px rgba(52,127,213,.09); }
.login-button { height: 45px; margin-top: 2px; border: 0; border-radius: 11px; background: var(--green); color: white; font-size: 13px; font-weight: 800; cursor: pointer; }
.login-button:hover { background: #0d855d; }
.login-error { margin: -2px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--red-soft); color: #a43841; font-size: 11px; }
.login-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

/* Operator page */
.admin-shell { width: min(1320px, calc(100% - 36px)); margin: 0 auto; padding: 24px 0 50px; }
.admin-topbar { margin-bottom: 22px; }
.admin-header-actions { display: flex; align-items: center; gap: 8px; }
.back-link { color: var(--muted-light); text-decoration: none; border: 1px solid var(--line); background: rgba(255,255,255,.82); padding: 11px 15px; border-radius: 11px; font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--text); border-color: var(--line-strong); }
button.back-link { cursor: pointer; }
.admin-overview { display: grid; grid-template-columns: 1.3fr .7fr; gap: 15px; margin-bottom: 15px; }
.admin-card { padding: 21px; }
.status-pill { background: var(--green-soft); color: var(--green); }
.status-pill.error { background: var(--red-soft); color: var(--red); }
.source-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 20px 0; }
.source-details div { min-width: 0; }
.source-details dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.source-details dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.source-warnings { color: var(--amber); font-size: 11px; margin-bottom: 13px; }
.safety-card p:not(.eyebrow) { color: var(--muted-light); line-height: 1.55; font-size: 13px; }
.safety-flow { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 24px; }
.safety-flow span { background: rgba(113,129,150,.08); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font-size: 11px; font-weight: 700; }
.safety-flow b { color: var(--green); }
.primary-button, .secondary-button, .danger-button, .ghost-button { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 750; font-size: 12px; cursor: pointer; transition: .18s ease; }
.primary-button { background: var(--green); color: #ffffff; }
.primary-button:hover { background: #0d855d; }
.secondary-button { background: var(--blue-soft); color: #2869b3; border: 1px solid rgba(52,127,213,.18); }
.secondary-button:hover { background: rgba(52,127,213,.18); }
.ghost-button { background: rgba(113,129,150,.08); color: var(--muted-light); border: 1px solid var(--line); }
.ghost-button:hover { color: var(--text); }
button:disabled { opacity: .48; cursor: wait; }
.debts-admin { margin-bottom: 15px; }
.admin-section-heading { align-items: center; margin-bottom: 18px; }
.debt-admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.debt-editor { border: 1px solid var(--line); background: rgba(244,247,250,.7); border-radius: 14px; padding: 16px; }
.debt-editor-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.debt-editor h3 { margin: 0; font-size: 15px; }
.debt-editor .current-amount { display: block; margin-top: 8px; font-size: 23px; font-weight: 850; letter-spacing: -.03em; }
.editor-limit { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.method-chip { padding: 4px 7px; border-radius: 7px; font-size: 9px; font-weight: 800; text-transform: uppercase; background: var(--green-soft); color: var(--green); }
.method-chip.manual { background: var(--amber-soft); color: var(--amber); }
.method-chip.error { background: var(--red-soft); color: var(--red); }
.auto-state { min-height: 44px; margin: 13px 0; padding: 9px 10px; border-radius: 9px; background: rgba(113,129,150,.07); color: var(--muted); font-size: 10px; line-height: 1.4; }
.auto-state.error { background: var(--red-soft); color: #a43841; }
.manual-form { display: grid; gap: 8px; }
.manual-form label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.manual-form input { width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff; padding: 9px 10px; color: var(--text); outline: none; }
.manual-form input:focus { border-color: rgba(99,166,255,.5); }
.editor-actions { display: flex; gap: 7px; margin-top: 4px; }
.history-card { padding-bottom: 10px; }
.history-wrap { overflow-x: auto; margin: 14px -21px 0; }
.history-table th, .history-table td { text-align: left; padding: 10px 21px; }
.history-table td { font-size: 11px; color: var(--muted-light); }
.toast { position: fixed; right: 24px; top: 24px; z-index: 40; max-width: 420px; padding: 12px 16px; border-radius: 11px; background: #e7f7f0; border: 1px solid rgba(17,150,106,.2); box-shadow: var(--shadow); color: #156a4d; font-size: 12px; }
.toast.error { background: #fff0f1; border-color: rgba(216,78,88,.22); color: #a43841; }

@media (max-width: 1180px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .data-clock { display: none; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .debt-panel { grid-column: 1 / -1; }
  .debt-list { grid-template-columns: repeat(3, 1fr); }
  .admin-overview { grid-template-columns: 1fr; }
  .debt-admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-shell, .admin-shell { width: min(100% - 20px, 1880px); padding-top: 12px; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters > label, .multi-filter { flex: 1; }
  .multi-filter-trigger, .direction-filter .multi-filter-trigger { width: 100%; }
  .direction-filter { min-width: 100%; }
  .filter-menu { left: 0; right: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .debt-panel { grid-column: auto; }
  .debt-list { grid-template-columns: 1fr; }
  .metric-card { min-height: 205px; }
  .table-legend { display: none; }
  .table-heading-actions { gap: 8px; }
  .table-footer { flex-direction: column; align-items: flex-start; }
  .source-details { grid-template-columns: 1fr; }
}

@media (min-width: 1181px) {
  html, body.dashboard-page { height: 100%; overflow: hidden; }
  .dashboard-shell { height: 100vh; min-height: 0; display: flex; flex-direction: column; }
  .topbar, .alert-bar, .hero-grid { flex: 0 0 auto; }
  .table-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .table-heading, .table-footer { flex: 0 0 auto; }
  .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .table-wrap table { height: 100%; }
}

@media (min-width: 1500px) and (min-height: 850px) {
  .dashboard-shell { padding-top: 18px; padding-bottom: 16px; }
  .topbar { min-height: 64px; margin-bottom: 13px; }
  .hero-grid { gap: 14px; margin-bottom: 14px; }
  .metric-card { min-height: 205px; padding: 18px 22px 16px; }
  .metric-main { margin-top: 17px; }
  .progress-track { margin-top: 16px; }
  .debt-panel { padding-top: 15px; padding-bottom: 15px; }
  .debt-list { margin-top: 9px; gap: 6px; }
  .table-heading { padding-top: 10px; padding-bottom: 8px; }
  .table-heading h2 { font-size: 17px; }
  th, td { padding-top: 6px; padding-bottom: 6px; line-height: 1.15; }
  .group-row th { padding-top: 6px; padding-bottom: 5px; }
  .table-footer { min-height: 29px; padding-top: 6px; padding-bottom: 6px; }
}
