:root {
  --navy: #153044;
  --navy-deep: #0c2030;
  --navy-soft: #27495f;
  --teal: #1f665f;
  --blue: #3c6c86;
  --orange: #b06a3c;
  --purple: #72618a;
  --green: #2f7a5c;
  --red: #b14a4a;
  --amber: #ad7627;
  --brass: #c9a66b;
  --ink: #1e2b35;
  --muted: #66737c;
  --soft-muted: #859098;
  --line: #e6e0d6;
  --line-warm: #ece2d2;
  --bg: #f4f0e8;
  --card: #fffdfa;
  --cream: #faf4e8;
  --shadow: 0 16px 40px rgba(21, 48, 68, 0.07);
  --shadow-soft: 0 6px 18px rgba(21, 48, 68, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -10%, rgba(31, 102, 95, 0.075), transparent 32rem),
    radial-gradient(circle at 10% 110%, rgba(201, 166, 107, 0.08), transparent 30rem),
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
[hidden] { display: none !important; }
svg { display: block; width: 18px; height: 18px; fill: currentColor; }

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #3b4750;
  background:
    radial-gradient(circle at 12% 7%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(201, 214, 222, 0.34), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.93) 0%, rgba(245, 247, 248, 0.84) 56%, rgba(228, 233, 236, 0.76) 100%);
  overflow: hidden;
  isolation: isolate;
  -webkit-backdrop-filter: blur(32px) saturate(130%) brightness(1.03);
  backdrop-filter: blur(32px) saturate(130%) brightness(1.03);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.15) 22%, transparent 46%, transparent 72%, rgba(255, 255, 255, 0.22) 100%),
    radial-gradient(circle at 24% 6%, rgba(255, 255, 255, 0.7), transparent 30%);
}
.sidebar::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -140px;
  bottom: 70px;
  z-index: 0;
  border: 1px solid rgba(115, 136, 148, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(178, 192, 201, 0.08), 0 0 0 58px rgba(178, 192, 201, 0.05);
  pointer-events: none;
}
.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 30px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #4c6f6a 0%, #2a4e49 100%);
  font-size: 19px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 5px 12px rgba(34, 71, 65, 0.16);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong { font-size: 15px; letter-spacing: 0.02em; }
.brand-text span { font-size: 10px; color: #7d8a92; letter-spacing: 0.08em; }

.client-switch {
  position: relative;
  z-index: 1;
  padding: 13px;
  margin: 0 2px 28px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 6px 16px rgba(93, 112, 124, 0.06);
}
.client-switch label {
  display: block;
  margin-bottom: 7px;
  color: #7c8a93;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #6d7b84;
  border-bottom: 1.5px solid #6d7b84;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.client-switch select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 10px;
  color: #334049;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  outline: none;
  appearance: none;
  font-weight: 700;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.client-switch select option { color: var(--ink); background: #fff; }

.nav { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: #5d6b74;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-item:hover { color: #34414a; background: rgba(255, 255, 255, 0.38); }
.nav-item.is-active {
  color: #2e3c45;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 3px 0 0 #4b7b74, 0 4px 14px rgba(79, 98, 110, 0.07);
}
.nav-icon { color: #84929b; }
.nav-item.is-active .nav-icon { color: #3d6d67; }
.nav-item span:nth-child(2) { flex: 1; font-size: 13px; font-weight: 700; }
.nav-item em {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 99px;
  color: #6d7a83;
  background: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-style: normal;
  text-align: center;
}
.sidebar-current {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: 16px;
  padding: 18px 17px 16px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.14), transparent 11rem),
    linear-gradient(145deg, rgba(62, 79, 88, 0.95) 0%, rgba(35, 48, 56, 0.91) 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(37, 51, 60, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.sidebar-current::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -55px;
  bottom: -62px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.035);
  pointer-events: none;
}
.current-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: #b9c8ce;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.current-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #91d6b2;
  box-shadow: 0 0 0 3px rgba(145, 214, 178, 0.14);
  flex: none;
}
.current-main { display: flex; align-items: center; gap: 12px; }
.current-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 23px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 5px 12px rgba(21, 35, 43, 0.18);
}
.current-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.current-info strong {
  overflow: hidden;
  color: #fff;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-info span { color: #b8c7cd; font-size: 10px; }
.current-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #b8c7cd;
  font-size: 10px;
}
.current-stats span { display: inline-flex; align-items: baseline; gap: 5px; }
.current-stats b { color: #fff; font-size: 14px; font-weight: 800; }
.sidebar-foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 0;
  padding: 14px 7px 0;
  border-top: 1px solid rgba(115, 136, 148, 0.16);
  color: #7f8c94;
  font-size: 10px;
}
.sidebar-foot strong { display: block; color: #59666f; font-size: 10px; margin-bottom: 2px; }
.sidebar-foot span { display: block; }
.dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #3f9a78; box-shadow: 0 0 0 3px rgba(63,154,120,0.12); flex: none; }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 40px 26px;
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(21, 48, 68, 0.08);
}
.page-heading { min-width: 0; }
.eyebrow {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
h1 { margin: 0; color: var(--navy); font-size: 30px; line-height: 1.2; letter-spacing: -0.03em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.client-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 99px;
  color: var(--teal);
  background: rgba(15,92,107,0.09);
  border: 1px solid rgba(15,92,107,0.12);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.top-actions { display: flex; gap: 9px; flex: none; padding-top: 10px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 7px 0 6px;
  border-radius: 99px;
  color: var(--navy);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 16px rgba(15, 41, 59, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  color: #f2d5a2;
  background: var(--navy);
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.user-name {
  max-width: 82px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-logout {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(21, 48, 68, 0.08);
  border-radius: 50%;
  transition: color .16s ease, background .16s ease;
}
.user-logout:hover { color: var(--navy); background: rgba(255, 255, 255, 0.8); }
.user-logout svg { width: 14px; height: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  font-size: 12px;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: var(--navy); box-shadow: 0 7px 16px rgba(23,50,77,0.16); }
.btn-primary:hover { background: var(--navy-soft); }
.btn-ghost { color: var(--navy); background: rgba(255, 253, 250, 0.72); border-color: rgba(21, 48, 68, 0.13); }
.btn-ghost:hover { background: var(--card); box-shadow: var(--shadow-soft); }
.btn-soft { color: var(--teal); background: rgba(15,92,107,0.07); border-color: rgba(15,92,107,0.12); }
.btn-soft:hover { background: rgba(15,92,107,0.11); }
.btn-danger { color: var(--red); background: #fff; border-color: rgba(185,28,28,0.25); }
.btn-danger:hover { background: #fff7f7; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.view-container { padding: 36px 40px 80px; }
.view { max-width: 1480px; margin: 0 auto; }

.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 0;
  padding: 15px 20px;
  background: rgba(255, 253, 250, 0.68);
  border: 1px solid rgba(21, 48, 68, 0.08);
  border-radius: 14px;
}
.period-bar-left, .period-bar-right { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.period-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.period-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #e9e4da; }
.period-tab {
  min-width: 58px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #6b7280;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.period-tab.is-active { color: var(--navy); background: var(--card); box-shadow: 0 2px 7px rgba(21,48,68,0.1); }
.range-text { color: var(--soft-muted); font-size: 11px; }
.period-note { color: var(--soft-muted); font-size: 10px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.kpi {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 20px;
  row-gap: 8px;
  min-height: 120px;
  padding: 20px 22px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(21, 48, 68, 0.065);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent, var(--teal)); }
.kpi-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.kpi-value {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  color: var(--navy);
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: right;
  white-space: nowrap;
}
.kpi-value.accent { color: var(--accent, var(--teal)); }
.kpi-note { grid-column: 1; grid-row: 2; align-self: end; margin-top: 0; color: var(--soft-muted); font-size: 10px; }
.kpi-icon {
  position: absolute;
  top: 14px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: var(--accent, var(--teal));
  background: color-mix(in srgb, var(--accent, var(--teal)) 10%, white);
}
.kpi-icon svg { width: 15px; height: 15px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 44px 1px 18px;
}
.section-header:first-of-type { margin-top: 36px; }
.section-header h2 { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--navy); font-size: 17px; letter-spacing: 0.01em; }
.section-header h2::before { content: ""; width: 4px; height: 19px; border-radius: 4px; background: var(--section-color, var(--teal)); }
.section-header p { margin: 0; color: var(--soft-muted); font-size: 10px; }
.panel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel-grid.two { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid rgba(21, 48, 68, 0.065);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 17px 20px 12px;
  border-bottom: 1px solid #f1ece3;
}
.panel-head h3 { margin: 0; color: var(--navy); font-size: 13px; }
.panel-head span { color: var(--soft-muted); font-size: 10px; }
.panel-body { padding: 16px 20px 20px; }
.panel-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #f0e9dc; color: var(--soft-muted); font-size: 9px; line-height: 1.5; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 56px; align-items: center; gap: 10px; }
.bar-label { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #f2efe9; }
.bar-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--bar-color, var(--teal)); }
.bar-value { color: var(--navy); font-size: 10px; font-weight: 800; text-align: right; white-space: nowrap; }
.bar-value small { margin-left: 3px; color: var(--soft-muted); font-size: 8px; font-weight: 600; }
.bar-row.is-muted .bar-label, .bar-row.is-muted .bar-value { color: #a7b0ba; }
.panel-empty { padding: 18px 0 10px; color: var(--soft-muted); font-size: 11px; text-align: center; }

.status-list { display: flex; flex-direction: column; }
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  border-bottom: 1px dashed #f0e9dc;
}
.status-line:last-child { border-bottom: 0; }
.status-name { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.status-name i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--dot, var(--teal)); }
.status-nums { display: flex; align-items: baseline; gap: 10px; }
.status-nums strong { color: var(--navy); font-size: 13px; }
.status-nums span { min-width: 40px; color: var(--soft-muted); font-size: 9px; text-align: right; }
.total-line { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1ece3; display: flex; justify-content: space-between; color: var(--navy); font-size: 10px; font-weight: 800; }

.insight-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  padding: 16px 20px;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line-warm);
  border-radius: 12px;
  font-size: 11px;
  flex-wrap: wrap;
}
.insight-strip strong { color: var(--navy); font-size: 12px; }
.insight-label { color: var(--soft-muted); font-size: 10px; }
.insight-sep { width: 1px; height: 16px; background: #e2d9c9; }

.trend-panel .panel-body { padding-top: 13px; }
.trend-legend { display: flex; gap: 15px; color: var(--soft-muted); font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 7px; height: 7px; border-radius: 2px; }
.trend-chart { display: flex; align-items: flex-end; gap: 13px; height: 142px; padding: 8px 3px 0; border-bottom: 1px solid #f1eee8; }
.trend-month { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 105px; }
.trend-bar { width: 11px; min-height: 2px; border-radius: 3px 3px 1px 1px; transition: height .3s ease; }
.trend-bar.int { background: var(--blue); }
.trend-bar.as { background: var(--orange); }
.trend-month.is-current .trend-month-label { color: var(--navy); font-weight: 800; }
.trend-month-label { color: var(--soft-muted); font-size: 9px; white-space: nowrap; }
.trend-counts { color: var(--muted); font-size: 9px; white-space: nowrap; }

.handler-table { width: 100%; border-collapse: collapse; }
.handler-table th { padding: 0 4px 8px; color: var(--soft-muted); font-size: 9px; font-weight: 700; text-align: right; }
.handler-table th:first-child { text-align: left; }
.handler-table td { padding: 7px 4px; border-top: 1px solid #f4f1eb; color: var(--muted); font-size: 10px; text-align: right; }
.handler-table td:first-child { color: var(--ink); font-weight: 700; text-align: left; }
.handler-table .mini-bar { display: inline-block; width: 54px; height: 4px; margin-left: auto; border-radius: 99px; background: #f2efe9; overflow: hidden; }
.handler-table .mini-bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }

.empty-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: 22px 26px;
  background: linear-gradient(100deg, #fff8ea, #fdfcf9);
  border: 1px solid #eee1cb;
  border-radius: 14px;
}
.empty-banner strong { display: block; margin-bottom: 4px; color: var(--navy); font-size: 14px; }
.empty-banner p { margin: 0; color: var(--muted); font-size: 11px; }
.empty-banner .btn { flex: none; }

/* tables */
.records-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.records-head h2 { margin: 0; color: var(--navy); font-size: 24px; letter-spacing: -0.025em; }
.records-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid rgba(21, 48, 68, 0.08);
  border-radius: 12px;
}
.search-box { position: relative; flex: 1 1 240px; max-width: 320px; }
.search-box svg { position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; color: var(--soft-muted); transform: translateY(-50%); }
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}
.search-box input:focus { border-color: rgba(31,102,95,.45); box-shadow: 0 0 0 3px rgba(31,102,95,.07); }
.toolbar select {
  height: 38px;
  padding: 0 29px 0 12px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8b98a5 50%), linear-gradient(135deg, #8b98a5 50%, transparent 50%);
  background-position: calc(100% - 14px) 16px, calc(100% - 10px) 16px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.toolbar-meta { margin-left: auto; color: var(--soft-muted); font-size: 10px; white-space: nowrap; }
.data-panel { overflow: hidden; background: var(--card); border: 1px solid rgba(21, 48, 68, 0.07); border-radius: 14px; box-shadow: var(--shadow-soft); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 880px; border-collapse: separate; border-spacing: 0; }
.data-table th {
  position: relative;
  height: 44px;
  padding: 0 14px;
  color: #7d878e;
  background: #fbf8f2;
  border-bottom: 1px solid #ece6da;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: left;
  white-space: nowrap;
}
.data-table th:first-child { padding-left: 20px; }
.data-table td { height: 56px; padding: 8px 14px; border-bottom: 1px solid #f4efe5; color: var(--muted); font-size: 10px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fdfaf4; }
.data-table td:first-child { padding-left: 20px; }
.data-table .cell-strong { display: block; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.data-table .cell-sub { display: block; overflow: hidden; margin-top: 2px; color: var(--soft-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.data-table .cell-money { color: var(--navy); font-weight: 800; white-space: nowrap; }
.cell-ellipsis { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-nowrap { white-space: nowrap; }
.row-index { color: #a4adb7; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
}
.icon-button svg { width: 14px; height: 14px; }
.icon-button:hover { color: var(--teal); background: #f2f8f8; border-color: #dbe9e8; }
.icon-button.danger:hover { color: var(--red); background: #fff6f6; border-color: #f2dddd; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 1px 7px; border-radius: 99px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-green { color: #2f6b50; background: #e7f2eb; }
.badge-amber { color: #8b5e1e; background: #f8edd6; }
.badge-blue { color: #315f78; background: #e8f1f6; }
.badge-purple { color: #69577f; background: #f0ebf5; }
.badge-sky { color: #2e637d; background: #e7f1f7; }
.badge-gray { color: #5b6770; background: #eff1f2; }
.badge-red { color: #9d3d3d; background: #f8e6e6; }
.badge-neutral { color: #6f7a83; background: #f2f1ed; }
.badge-soft { color: var(--teal); background: #e8f4f3; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #fcf9f3; border-top: 1px solid #f0e9dc; }
.pager-info { color: var(--soft-muted); font-size: 10px; }
.pager-buttons { display: flex; gap: 5px; }
.pager-buttons button { min-width: 30px; height: 29px; padding: 0 9px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
.pager-buttons button:hover:not(:disabled) { color: var(--teal); border-color: #bed6d2; }
.pager-buttons button.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }
.pager-buttons button:disabled { opacity: .4; cursor: not-allowed; }
.table-empty { padding: 54px 20px; text-align: center; }
.table-empty .empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 10px; color: #a9b6c0; background: #f7f5f0; border-radius: 14px; }
.table-empty strong { display: block; color: var(--navy); font-size: 12px; }
.table-empty p { margin: 5px 0 13px; color: var(--soft-muted); font-size: 10px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(17, 38, 58, 0.48); backdrop-filter: blur(4px); animation: fade .15s ease; }
.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(8, 26, 40, 0.3);
  animation: rise .2s ease;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 15px; border-bottom: 1px solid #f0ece5; }
.modal-head h2 { margin: 0; color: var(--navy); font-size: 18px; letter-spacing: -.02em; }
.modal-head p { margin: 4px 0 0; color: var(--soft-muted); font-size: 10px; }
.modal-close { width: 30px; height: 30px; padding: 0; color: #8d99a5; background: #f7f5f0; border: 0; border-radius: 8px; font-size: 18px; line-height: 1; }
.modal-close:hover { color: var(--navy); background: #efebe3; }
.modal-form { overflow-y: auto; padding: 18px 22px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; }
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #566575; font-size: 10px; font-weight: 700; }
.form-field label .required { color: var(--red); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  color: var(--ink);
  background: #fdfcfa;
  border: 1px solid #e3e0d9;
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.form-field input, .form-field select { height: 37px; padding: 0 10px; }
.form-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b98a5 50%), linear-gradient(135deg, #8b98a5 50%, transparent 50%); background-position: calc(100% - 14px) 16px, calc(100% - 10px) 16px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 27px; }
.form-field textarea { min-height: 70px; padding: 9px 10px; resize: vertical; line-height: 1.55; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { background: #fff; border-color: rgba(15,92,107,.5); box-shadow: 0 0 0 3px rgba(15,92,107,.07); }
.form-field input[type=date] { color: var(--navy); font-weight: 700; }
.form-hint { margin: 11px 0 0; color: var(--soft-muted); font-size: 10px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 18px; border-top: 1px solid #f0ece5; }
.modal-foot-right { display: flex; gap: 8px; margin-left: auto; }

/* toast */
.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 11px 15px;
  color: #f8fbfd;
  background: var(--navy);
  border-radius: 9px;
  box-shadow: 0 14px 30px rgba(10,28,43,.22);
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.toast.is-error { background: #8c2222; }
.toast.is-warn { background: #8a5a16; }

.loading-screen { display: grid; place-items: center; min-height: 70vh; color: var(--muted); font-size: 12px; }
.loading-screen .spinner { width: 24px; height: 24px; margin-bottom: 12px; border: 2px solid #e5e0d7; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid .panel:last-child { grid-column: 1 / -1; }
  .panel-grid.two { grid-template-columns: 1fr; }
  .panel-grid.two .panel:last-child { grid-column: auto; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; display: block; padding: 16px 16px 13px; }
  .sidebar::after { display: none; }
  .brand { margin-bottom: 13px; }
  .client-switch { margin: 0 0 12px; padding: 9px 10px; }
  .sidebar-current { display: none; }
  .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; padding-bottom: 1px; }
  .nav-item { min-width: 0; min-height: 38px; padding: 0 5px; justify-content: center; }
  .nav-item span:nth-child(2) { font-size: 11px; }
  .nav-icon { width: 16px; height: 16px; }
  .nav-item em { display: none; }
  .nav-item.is-active { box-shadow: inset 0 -2px 0 #f2d5a2; }
  .sidebar-foot { display: none; }
  .topbar { position: static; flex-wrap: wrap; padding: 20px 18px 17px; }
  .top-actions { flex: 1 1 100%; justify-content: stretch; padding-top: 0; }
  .top-actions .btn { flex: 1; }
  .user-chip { height: 34px; padding: 0 5px; gap: 5px; }
  .user-avatar { width: 24px; height: 24px; font-size: 10px; }
  .user-name { display: none; }
  .user-logout { width: 24px; height: 24px; }
  .view-container { padding: 20px 18px 36px; }
  .btn { min-height: 34px; padding: 0 10px; font-size: 11px; }
  .btn svg { width: 14px; height: 14px; }
  .period-bar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .period-bar-left { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-height: 98px; padding: 13px; }
  .kpi-value { font-size: 23px; }
  .panel-grid { grid-template-columns: 1fr; }
  .panel-grid .panel:last-child { grid-column: auto; }
  .records-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .records-head .btn { width: 100%; }
  .toolbar #addRecordBtn { width: 100%; }
  .toolbar-meta { width: 100%; margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 11px; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .modal-head { padding: 17px 17px 13px; }
  .modal-form { padding: 15px 17px 6px; }
  .modal-foot { padding: 12px 17px 16px; }
  .modal-foot .btn-danger { padding: 0 11px; }
  .toast { left: 18px; right: 18px; bottom: 18px; max-width: none; }
  h1 { font-size: 22px; }
}
@media (max-width: 600px) {
  .period-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .period-tab { min-width: 0; padding: 0 4px; }
  .range-text { width: 100%; }
  .period-note { width: 100%; }
  .kpi { display: block; min-height: 112px; padding: 18px; }
  .kpi-value { margin-top: 12px; text-align: left; font-size: 30px; }
  .kpi-note { margin-top: 6px; }
}
@media (max-width: 460px) {
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; }
  .topbar { flex-direction: column; gap: 10px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: 10px; }
  .kpi-value { font-size: 21px; }
  .client-pill { font-size: 9px; }
}

@media print {
  .sidebar, .top-actions, .period-bar, .toolbar, .pager, .row-actions { display: none !important; }
  .app-shell { display: block; }
  .topbar { position: static; padding: 0 0 16px; background: #fff; }
  .view-container { padding: 0; }
  .panel, .kpi, .data-panel { box-shadow: none; break-inside: avoid; }
}

/* -------------------------------------------------------------------------
   Liquid Glass
   ------------------------------------------------------------------------- */
@media screen {
  :root {
    --glass-blur: 22px;
    --glass-border: rgba(255, 255, 255, 0.72);
    --glass-border-soft: rgba(255, 255, 255, 0.48);
    --glass-shadow: 0 26px 60px rgba(15, 41, 59, 0.11), 0 2px 8px rgba(15, 41, 59, 0.04);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.22);
    --glass-fill: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62));
    --glass-fill-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.54));
  }

  body {
    position: relative;
    isolation: isolate;
    background:
      radial-gradient(ellipse 46% 42% at 72% 2%, rgba(235, 174, 92, 0.4), transparent 67%),
      radial-gradient(ellipse 50% 45% at 14% 40%, rgba(76, 148, 137, 0.3), transparent 68%),
      radial-gradient(ellipse 48% 42% at 88% 84%, rgba(91, 125, 160, 0.26), transparent 70%),
      linear-gradient(135deg, #e9f0eb 0%, #f7ead7 46%, #e8edf2 100%);
    background-attachment: fixed;
  }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.34), transparent 26%),
      radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.22), transparent 22%),
      radial-gradient(circle at 60% 86%, rgba(255, 255, 255, 0.16), transparent 30%);
    filter: blur(2px);
  }

  .topbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.22));
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(15, 41, 59, 0.03);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
    backdrop-filter: blur(26px) saturate(150%);
  }

  .kpi,
  .panel,
  .data-panel,
  .period-bar,
  .toolbar,
  .empty-banner,
  .insight-strip {
    border: 1px solid var(--glass-border);
    background: var(--glass-fill-soft);
    box-shadow: var(--glass-shadow), var(--glass-inset);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(155%);
    backdrop-filter: blur(var(--glass-blur)) saturate(155%);
  }

  .kpi {
    background: var(--glass-fill);
    overflow: hidden;
  }
  .data-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  }
  .kpi::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 18% -12%, rgba(255, 255, 255, 0.8), transparent 42%),
      linear-gradient(110deg, rgba(255, 255, 255, 0.24), transparent 38%);
  }
  .kpi > * { position: relative; z-index: 1; }

  .panel,
  .kpi {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  }
  .panel:hover,
  .kpi:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.86);
    box-shadow: 0 32px 68px rgba(15, 41, 59, 0.13), var(--glass-inset);
  }

  .period-bar,
  .toolbar {
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.3));
  }

  .empty-banner {
    background:
      linear-gradient(120deg, rgba(255, 249, 235, 0.7), rgba(255, 255, 255, 0.3)),
      radial-gradient(circle at 4% 0%, rgba(239, 196, 126, 0.24), transparent 40%);
  }

  .panel-head { border-bottom-color: rgba(21, 48, 68, 0.08); }
  .panel-foot,
  .total-line { border-top-color: rgba(21, 48, 68, 0.08); }
  .status-line { border-bottom-color: rgba(21, 48, 68, 0.075); }
  .handler-table td { border-top-color: rgba(21, 48, 68, 0.075); }

  .period-tabs {
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 2px rgba(15, 41, 59, 0.04);
  }
  .period-tab.is-active {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 2px 8px rgba(15, 41, 59, 0.09), inset 0 1px 0 #fff;
  }

  .search-box input,
  .toolbar select,
  .form-field input,
  .form-field select,
  .form-field textarea {
    background-color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .search-box input:focus,
  .form-field input:focus,
  .form-field select:focus,
  .form-field textarea:focus {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(31, 102, 95, 0.42);
    box-shadow: 0 0 0 3px rgba(31, 102, 95, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }

  .btn-primary {
    background: linear-gradient(145deg, #1a4059 0%, #0d293d 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 22px rgba(10, 36, 53, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  .btn-primary:hover {
    background: linear-gradient(145deg, #214b65 0%, #103148 100%);
    box-shadow: 0 14px 28px rgba(10, 36, 53, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  .btn-ghost,
  .btn-soft {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.35));
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 16px rgba(15, 41, 59, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .btn-ghost:hover,
  .btn-soft:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5));
  }

  .data-table th {
    background: rgba(255, 255, 255, 0.58);
    border-bottom-color: rgba(21, 48, 68, 0.08);
  }
  .data-table td { border-bottom-color: rgba(21, 48, 68, 0.07); }
  .data-table tbody tr:hover { background: rgba(255, 255, 255, 0.5); }
  .pager {
    background: rgba(255, 255, 255, 0.42);
    border-top-color: rgba(21, 48, 68, 0.08);
  }
  .pager-buttons button { background: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.68); }
  .pager-buttons button.is-active { background: var(--navy); border-color: var(--navy); }

  .badge { border: 1px solid rgba(255, 255, 255, 0.5); }

  .modal-backdrop {
    background: rgba(13, 34, 50, 0.3);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    backdrop-filter: blur(12px) saturate(130%);
  }
  .modal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.74));
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 34px 90px rgba(7, 25, 39, 0.28), inset 0 1px 0 #fff;
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    backdrop-filter: blur(28px) saturate(150%);
  }
  .modal-head,
  .modal-foot { border-color: rgba(21, 48, 68, 0.08); }

  .toast {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(14, 39, 56, 0.9);
    box-shadow: 0 18px 42px rgba(7, 25, 39, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }

  .sidebar-current {
    border-color: rgba(255, 255, 255, 0.36);
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.14), transparent 11rem),
      linear-gradient(145deg, rgba(62, 79, 88, 0.95), rgba(35, 48, 56, 0.91));
    box-shadow: 0 18px 38px rgba(37, 51, 60, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
  }

  @media (min-width: 861px) {
    .app-shell { grid-template-columns: 276px minmax(0, 1fr); }
    .view-container { padding-left: 16px; padding-right: 16px; }
    .section-header {
      margin-left: 0;
      margin-right: 0;
      padding-left: 24px;
      padding-right: 24px;
    }
    .topbar {
      top: 16px;
      width: calc(100% - 32px);
      max-width: 1480px;
      margin: 16px auto 0;
      padding: 26px 24px;
      border: 1px solid rgba(255, 255, 255, 0.52);
      border-radius: 22px;
      box-shadow: 0 16px 42px rgba(15, 41, 59, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    }
    .sidebar {
      top: 16px;
      height: calc(100vh - 32px);
      margin: 16px 0 16px 16px;
      border: 1px solid rgba(255, 255, 255, 0.8);
      border-radius: 24px;
      background:
        radial-gradient(circle at 10% 6%, rgba(255, 255, 255, 0.94), transparent 36%),
        radial-gradient(circle at 100% 0%, rgba(198, 213, 221, 0.34), transparent 34%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 247, 248, 0.82) 58%, rgba(227, 233, 236, 0.74) 100%);
      box-shadow:
        0 36px 90px rgba(81, 100, 112, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        inset 0 0 70px rgba(255, 255, 255, 0.08);
      -webkit-backdrop-filter: blur(36px) saturate(130%) brightness(1.02);
      backdrop-filter: blur(36px) saturate(130%) brightness(1.02);
    }
    .brand-mark {
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 5px 14px rgba(3, 18, 32, 0.2);
    }
    .client-switch {
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.36));
      border-color: rgba(255, 255, 255, 0.86);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 6px 16px rgba(94, 113, 124, 0.05);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
    }
    .nav-item.is-active {
      background: linear-gradient(100deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
      border: 1px solid rgba(255, 255, 255, 0.84);
      box-shadow: inset 3px 0 0 #4b7b74, 0 8px 20px rgba(79, 98, 110, 0.08);
    }

    .brand-text strong { font-size: 16px; }
    .brand-text span { font-size: 11px; }
    .client-switch label { font-size: 11px; }
    .client-switch select { height: 40px; font-size: 14px; }
    .nav-item { min-height: 48px; }
    .nav-item span:nth-child(2) { font-size: 14px; }
    .nav-item em { font-size: 11px; }
    .nav-icon { width: 19px; height: 19px; }
    .current-info strong { font-size: 24px; }
    .current-kicker { font-size: 11px; }
    .current-info span { font-size: 11px; }
    .current-stats { font-size: 11px; }
    .current-stats b { font-size: 15px; }
    .sidebar-foot { font-size: 10.5px; }

    h1 { font-size: 32px; }
    .page-heading p { font-size: 13px; }
    .eyebrow { font-size: 11px; }
    .client-pill { font-size: 11px; min-height: 26px; padding: 3px 10px; }
    .btn { min-height: 42px; padding: 0 17px; font-size: 13px; }
    .period-label { font-size: 12px; }
    .period-tab { min-width: 62px; height: 32px; font-size: 12px; }
    .range-text { font-size: 12px; }
    .period-note { font-size: 11px; }
    .section-header h2 { font-size: 18px; }
    .section-header p { font-size: 11px; }
    .kpi-label { font-size: 12px; }
    .kpi-value { font-size: 36px; }
    .kpi-note { font-size: 11px; }
    .panel-head h3 { font-size: 14px; }
    .panel-head span { font-size: 11px; }
    .bar-label { font-size: 11px; }
    .bar-value { font-size: 11px; }
    .bar-value small { font-size: 9px; }
    .status-name { font-size: 11px; }
    .status-nums strong { font-size: 14px; }
    .status-nums span { font-size: 10px; }
    .total-line { font-size: 11px; }
    .insight-strip { font-size: 12px; }
    .insight-label { font-size: 11px; }
    .handler-table td { font-size: 11px; }
    .handler-table th { font-size: 10px; }
    .data-table th { font-size: 10px; }
    .data-table td { height: 60px; font-size: 11px; }
    .cell-sub { font-size: 10px; }
    .badge { font-size: 10px; }
    .search-box input,
    .toolbar select { height: 40px; font-size: 12px; }
    .toolbar-meta { font-size: 11px; }
    .pager-info { font-size: 11px; }
    .pager-buttons button { height: 31px; font-size: 11px; }
    .form-field label { font-size: 11px; }
    .form-field input,
    .form-field select { height: 39px; font-size: 12px; }
    .form-field textarea { font-size: 12px; }
    .modal-head h2 { font-size: 20px; }
    .modal-head p { font-size: 11px; }
    .toast { font-size: 12px; }
  }
}

/* Larger, higher-contrast content for the dashboard */
@media screen and (min-width: 861px) {
  :root {
    --muted: #58666f;
    --soft-muted: #748089;
  }

  .topbar .page-heading p { font-size: 14px; }
  .period-bar { padding: 18px 24px; }
  .period-label { font-size: 14px; }
  .period-tab { min-width: 68px; height: 36px; font-size: 14px; }
  .range-text { font-size: 14px; }
  .period-note { font-size: 12.5px; }

  .empty-banner { padding: 26px 30px; }
  .empty-banner strong { font-size: 18px; }
  .empty-banner p { font-size: 14px; line-height: 1.6; }

  .kpi { min-height: 144px; padding: 24px 26px; }
  .kpi-label { font-size: 15px; }
  .kpi-value { font-size: 42px; }
  .kpi-note { font-size: 13px; }

  .section-header h2 { font-size: 24px; }
  .section-header p { font-size: 13px; }
  .panel-head { min-height: 64px; padding: 20px 24px 15px; }
  .panel-head h3 { font-size: 18px; }
  .panel-head span { font-size: 13px; }
  .panel-body { padding: 19px 24px 24px; }
  .panel-foot { font-size: 12px; }

  .bar-list { gap: 13px; }
  .bar-row { grid-template-columns: 108px minmax(0, 1fr) 72px; gap: 12px; }
  .bar-label { font-size: 14.5px; }
  .bar-track { height: 10px; }
  .bar-value { font-size: 14px; }
  .bar-value small { font-size: 11px; }

  .status-line { min-height: 46px; gap: 16px; }
  .status-name { font-size: 14px; gap: 9px; }
  .status-nums { gap: 12px; }
  .status-nums strong { font-size: 16px; }
  .status-nums span { min-width: 50px; font-size: 12px; }
  .total-line { margin-top: 17px; padding-top: 15px; font-size: 13px; }

  .insight-strip { gap: 28px; padding: 19px 24px; font-size: 14px; }
  .insight-label { font-size: 13px; }
  .insight-strip strong { font-size: 15px; }

  .trend-chart { height: 180px; }
  .trend-bars { height: 136px; }
  .trend-bar { width: 14px; }
  .trend-month-label { font-size: 12px; }
  .trend-counts { font-size: 11px; }
  .trend-legend { font-size: 12px; }

  .handler-table th { font-size: 12px; }
  .handler-table td { padding: 9px 4px; font-size: 13px; }
  .handler-table .mini-bar { width: 70px; }

  .insight-label,
  .bar-label,
  .status-name,
  .handler-table td,
  .trend-month-label { letter-spacing: 0.005em; }

  .data-table th { font-size: 11px; }
  .data-table td { font-size: 12.5px; }
  .cell-sub { font-size: 10.5px; }
  .badge { font-size: 11px; min-height: 22px; }
  .search-box input,
  .toolbar select { font-size: 13px; }
  .toolbar-meta { font-size: 12px; }
  .pager-info { font-size: 12px; }
  .pager-buttons button { font-size: 12px; }
  .form-field label { font-size: 12px; }
  .form-field input,
  .form-field select,
  .form-field textarea { font-size: 13px; }
  .modal-head p { font-size: 12px; }
  .form-hint { font-size: 11px; }

  .toolbar { gap: 14px; padding: 17px 20px; margin-bottom: 24px; }
  .search-box { flex-basis: 280px; max-width: 360px; }
  .search-box input,
  .toolbar select { height: 44px; font-size: 14px; padding-left: 13px; }
  .search-box input { padding-left: 36px; }
  .search-box svg { left: 13px; width: 16px; height: 16px; }
  .toolbar-meta { font-size: 13px; }
  #addRecordBtn { min-height: 44px; font-size: 14px; padding: 0 18px; }

  .data-table { min-width: 1080px; }
  .data-table th { height: 50px; padding: 0 16px; font-size: 13px; }
  .data-table th:first-child { padding-left: 24px; }
  .data-table td { height: 68px; padding: 10px 16px; font-size: 14px; }
  .data-table td:first-child { padding-left: 24px; }
  .data-table .cell-strong { font-size: 14px; }
  .data-table .cell-sub { font-size: 12px; margin-top: 3px; }
  .data-table .cell-money { font-size: 14px; }
  .cell-ellipsis { max-width: 220px; }
  .badge { min-height: 24px; padding: 2px 9px; font-size: 12px; }
  .row-actions { gap: 8px; }
  .icon-button { width: 32px; height: 32px; }
  .icon-button svg { width: 16px; height: 16px; }

  .pager { padding: 18px 24px; }
  .pager-info { font-size: 13px; }
  .pager-buttons button { min-width: 34px; height: 34px; font-size: 13px; }
  .table-empty { padding: 74px 24px; }
  .table-empty .empty-icon { width: 56px; height: 56px; margin-bottom: 14px; }
  .table-empty .empty-icon svg { width: 22px; height: 22px; }
  .table-empty strong { font-size: 17px; }
  .table-empty p { margin: 8px 0 18px; font-size: 13px; }

  .modal { width: min(780px, 100%); }
  .modal-head { padding: 24px 26px 18px; }
  .modal-head h2 { font-size: 22px; }
  .modal-head p { font-size: 13px; }
  .modal-form { padding: 22px 26px 10px; }
  .form-grid { gap: 17px 18px; }
  .form-field { gap: 7px; }
  .form-field label { font-size: 13px; }
  .form-field input,
  .form-field select { height: 44px; font-size: 14px; }
  .form-field textarea { min-height: 82px; font-size: 14px; }
  .form-hint { margin-top: 14px; font-size: 12px; }
  .modal-foot { padding: 17px 26px 22px; }
}

/* -------------------------------------------------------------------------
   Login
   ------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-shell {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 18px;
}
.auth-brand-card,
.auth-panel {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(15, 41, 59, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  backdrop-filter: blur(30px) saturate(155%);
}
.auth-brand-card {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  padding: 38px;
  color: #35434c;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(198, 210, 218, 0.38), transparent 34%),
    linear-gradient(160deg, rgba(248, 250, 250, 0.93) 0%, rgba(235, 239, 241, 0.86) 58%, rgba(219, 225, 229, 0.8) 100%);
}
.auth-brand-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.24)),
    radial-gradient(circle at 25% 4%, rgba(255, 255, 255, 0.65), transparent 30%);
}
.auth-brand-card::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -180px;
  bottom: -110px;
  border: 1px solid rgba(114, 134, 146, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(174, 188, 197, 0.09), 0 0 0 74px rgba(174, 188, 197, 0.05);
  pointer-events: none;
}
.auth-brand-card > * { position: relative; z-index: 1; }
.auth-brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.auth-brand-card .brand { margin: 0; padding: 0; }
.auth-brand-card .brand-text strong { color: #2b3941; }
.auth-brand-card .brand-text span { color: #7d8a92; }
.auth-brand-card .brand-mark {
  color: #fff;
  background: linear-gradient(145deg, #3e4e57 0%, #25333b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px rgba(28, 44, 53, 0.16);
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  border-radius: 99px;
  color: #5d6b74;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.75);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.auth-copy { margin-top: auto; padding: 56px 0 0; max-width: 430px; }
.auth-kicker {
  display: block;
  margin-bottom: 17px;
  color: #7d8a92;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.auth-copy h1 {
  margin: 0;
  color: #1f2c34;
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.025em;
}
.auth-copy p {
  max-width: 380px;
  margin: 20px 0 0;
  color: #617079;
  font-size: 14px;
  line-height: 1.85;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.auth-points span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 99px;
  color: #52616a;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 11px;
}
.auth-brand-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  color: #7f8c94;
  font-size: 10px;
}
.auth-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a6ae;
  box-shadow: 0 0 0 3px rgba(152, 166, 174, 0.14);
  flex: none;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  min-height: 640px;
  padding: 42px 38px 30px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
}
.auth-panel-head { margin-bottom: 28px; }
.auth-mini {
  display: block;
  margin-bottom: 11px;
  color: #8a969d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.auth-panel-head h2 {
  margin: 0;
  color: #1b2b35;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.auth-panel-head p {
  margin: 9px 0 0;
  color: #6b7a83;
  font-size: 13px;
  line-height: 1.65;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field > span {
  color: #5d6b74;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: #1b2b35;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 11px;
  outline: none;
  font: inherit;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 8px rgba(25, 50, 65, 0.035);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-field input::placeholder { color: #a3adb3; }
.auth-field input:focus {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(47, 107, 99, 0.4);
  box-shadow: 0 0 0 3px rgba(47, 107, 99, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.auth-submit {
  height: 48px;
  margin-top: 4px;
  color: #f7f4ed;
  background: linear-gradient(145deg, #1a4059 0%, #0d293d 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  box-shadow: 0 12px 26px rgba(10, 36, 53, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(10, 36, 53, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.auth-submit:disabled { opacity: 0.58; cursor: wait; transform: none; }
.auth-error {
  margin-top: 16px;
  padding: 11px 13px;
  color: #8f3f4f;
  background: rgba(255, 235, 238, 0.72);
  border: 1px solid rgba(181, 91, 111, 0.2);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.6;
}
.auth-panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  color: #96a1a7;
  font-size: 10px;
}

@media (max-width: 780px) {
  .auth-page { padding: 14px; }
  .auth-shell { grid-template-columns: 1fr; gap: 12px; }
  .auth-brand-card { min-height: auto; padding: 24px; border-radius: 22px; }
  .auth-copy { padding: 34px 0 0; }
  .auth-copy h1 { font-size: 30px; }
  .auth-copy p { margin-top: 14px; font-size: 13px; }
  .auth-points { margin-top: 20px; }
  .auth-brand-foot { margin-top: 24px; }
  .auth-panel { min-height: auto; padding: 28px 24px 24px; border-radius: 22px; }
  .auth-panel-head { margin-bottom: 22px; }
  .auth-panel-head h2 { font-size: 28px; }
  .auth-panel-foot { padding-top: 22px; }
}

