/* ============================================================
   CODE INSTITUTE · IK DASHBOARD
   Brand-aligned: warm paper, deep bordeaux, olive sage,
   serif display (Cormorant Garamond), elegant editorial.
   ============================================================ */

:root {
  /* surfaces · warm paper */
  --paper:     #F2EBDB;
  --paper-2:   #E8DFC8;
  --surface:   #FAF5E8;
  --surface-2: #F0E8D2;

  /* ink · deep brown-black */
  --ink:       #2A2520;
  --ink-2:     #4A4138;
  --ink-3:     #6B5F50;
  --muted:     #8B7E6E;
  --muted-2:   #B5A98F;

  /* hairlines · warm tan */
  --line:      #D8CBA8;
  --line-2:    #E5DABA;

  /* sidebar · bordeaux */
  --side-bg:    #6B1F22;
  --side-bg-2:  #5C1A1D;
  --side-bg-3:  #7A282B;
  --side-ink:   #F2EBDB;
  --side-mute:  #B5957B;
  --side-line:  #4A1416;
  --side-gold:  #C4A878;

  /* accent · bordeaux */
  --accent:      #6B1F22;
  --accent-2:    #8B2D31;
  --accent-3:    #4A1416;
  --accent-tint: #EFDDD8;

  /* secondary tones */
  --olive:      #5C6244;
  --olive-2:    #757A5C;
  --olive-tint: #D8DBC4;
  --sand:       #C4A878;
  --sand-2:     #B5894A;
  --sand-tint:  #E8DCC0;

  /* status */
  --ok:         #5C6244;
  --ok-tint:    #D8DBC4;
  --warn:       #B58547;
  --warn-tint:  #F2E2C1;
  --bad:        #8E2A1F;
  --bad-tint:   #E8CFC8;

  /* radii */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;

  /* fonts */
  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-ui:      'Montserrat', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.t-display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.t-mono { font-family: var(--f-mono); font-feature-settings: "tnum"; }
.t-num {
  font-family: var(--f-display);
  font-feature-settings: "tnum","lnum";
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.t-eyebrow {
  font-family: var(--f-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.t-eyebrow.sm {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--muted);
}

/* decorative ornament (4-point rosette) */
.orn {
  display: inline-block;
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
  opacity: 0.7;
}
.orn::before { content: "✦"; }

/* ============================================================
   ROSETTE SVG (apple-seed brand symbol)
   ============================================================ */
.rosette {
  display: inline-block;
  vertical-align: middle;
}
.rosette svg { display: block; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
  min-width: 1280px;
}

/* ============================================================
   SIDEBAR · bordeaux
   ============================================================ */
.sidebar {
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--side-bg-3); border-radius: 999px; }

.brand-ik {
  padding: 28px 22px 22px;
  border-bottom: 1px solid var(--side-line);
  text-align: center;
}
.brand-ik .logo-line {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: 0.18em;
  color: var(--side-ink);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.brand-ik .logo-line .ch { display: inline-block; }
.brand-ik .logo-line .rosette { color: var(--side-gold); margin: 0 4px; }
.brand-ik .sub {
  font-family: var(--f-ui);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--side-mute);
  margin-top: 8px;
  text-transform: uppercase;
}
.brand-ik .bar {
  width: 18px;
  height: 1px;
  background: var(--side-gold);
  margin: 14px auto 14px;
}
.brand-ik .tagline {
  font-family: var(--f-display);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--side-ink);
  text-transform: uppercase;
  line-height: 1.6;
}
.brand-ik .tagline .mute {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--side-mute);
  text-transform: lowercase;
  display: block;
  margin-top: 2px;
}

.nav-group { padding: 22px 14px 4px; }
.nav-group .group-lbl {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--side-ink);
  padding: 0 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-group .group-lbl .num {
  font-family: var(--f-mono);
  color: var(--side-gold);
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.nav-group .group-lbl .num::after {
  content: "";
  display: inline-block;
  width: 12px; height: 1px;
  background: var(--side-gold);
  opacity: 0.5;
  margin-left: 6px;
  margin-bottom: 3px;
  vertical-align: middle;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--side-ink);
  cursor: pointer;
  border-radius: var(--r-1);
  font-family: var(--f-ui);
  font-size: 12.5px;
  text-align: left;
  font-weight: 400;
  margin-bottom: 1px;
  letter-spacing: 0.04em;
  position: relative;
  transition: background 140ms, color 140ms;
}
.nav-item:hover { background: var(--side-bg-3); }
.nav-item.active {
  background: var(--side-bg-2);
  color: var(--side-ink);
  font-weight: 500;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: var(--side-gold);
}
.nav-item .icon {
  width: 15px; height: 15px;
  opacity: 0.6;
  flex-shrink: 0;
  color: var(--side-mute);
}
.nav-item.active .icon { opacity: 1; color: var(--side-gold); }
.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--f-mono);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--side-gold);
  color: var(--accent-3);
  letter-spacing: 0.04em;
}
.nav-item .badge.calm  { background: var(--side-bg-3); color: var(--side-mute); border: 1px solid var(--side-line); }
.nav-item .badge.warn  { background: var(--warn); color: var(--paper); }
.nav-item .badge.alert { background: var(--paper); color: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--side-line);
  display: flex; align-items: center; gap: 10px;
  font-size: 10.5px;
  color: var(--side-mute);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}
.sidebar-foot .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--side-gold);
  box-shadow: 0 0 0 0 rgba(196,168,120,0.5);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(196,168,120,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(196,168,120,0); }
  100% { box-shadow: 0 0 0 0 rgba(196,168,120,0); }
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
}

.topbar {
  padding: 22px 36px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .crumb {
  font-family: var(--f-ui);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.topbar .crumb .acc { color: var(--accent); }
.topbar h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
  text-transform: uppercase;
}
.topbar h1 .orn {
  font-size: 14px;
  color: var(--accent);
  opacity: 0.7;
  margin: 0 6px;
  vertical-align: middle;
}
.topbar .desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  max-width: 580px;
  font-weight: 400;
  line-height: 1.6;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.seg button {
  border: none;
  background: transparent;
  font-family: var(--f-ui);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.seg button:hover { color: var(--ink-2); }
.seg button.active {
  background: var(--accent);
  color: var(--paper);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.user-chip .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  display: grid; place-items: center;
  font-weight: 400;
  font-size: 13px;
  font-family: var(--f-display);
}
.user-chip .who { font-size: 11px; line-height: 1.2; }
.user-chip .who .name { font-weight: 500; letter-spacing: 0.04em; }
.user-chip .who .role { color: var(--muted); font-size: 9.5px; font-family: var(--f-mono); letter-spacing: 0.06em; }

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  padding: 28px 36px 64px;
  flex: 1;
  min-width: 0;
}
.tab { display: none; }
.tab.active { display: block; }

/* ============================================================
   SECTION BAR
   ============================================================ */
.section-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 20px;
}
.section-bar .info { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.section-bar .info b { color: var(--accent); font-weight: 500; letter-spacing: 0.02em; }
.section-bar .chips { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.section-bar .chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: #FFFFFF;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px -4px rgba(42,21,16,0.08);
}
.section-bar .chip b {
  font-family: var(--f-display);
  color: var(--ink);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1;
}
.section-bar .chip i { width: 15px; height: 15px; opacity: 1; color: var(--accent); }
.section-bar .chip.bad  { background: #FFFFFF; border-color: var(--bad); color: var(--bad); }
.section-bar .chip.bad b  { color: var(--bad); }
.section-bar .chip.bad i  { color: var(--bad); }
.section-bar .chip.warn { background: #FFFFFF; border-color: var(--warn); color: var(--warn); }
.section-bar .chip.warn b { color: var(--warn); }
.section-bar .chip.warn i { color: var(--warn); }
.section-bar .chip.ok   { background: #FFFFFF; border-color: var(--ok); color: var(--ok); }
.section-bar .chip.ok b   { color: var(--ok); }
.section-bar .chip.ok i   { color: var(--ok); }

/* === Legacy notice === */
.legacy-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--warn-tint);
  border: 1px solid var(--sand);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-2);
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.legacy-notice .ic {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--paper);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.legacy-notice b { color: var(--warn); font-weight: 600; }

/* ============================================================
   GRID
   ============================================================ */
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.c-2  { grid-template-columns: repeat(2, 1fr); }
.c-3  { grid-template-columns: repeat(3, 1fr); }
.c-4  { grid-template-columns: repeat(4, 1fr); }
.c-12 { grid-template-columns: repeat(12, 1fr); }
.sp-3 { grid-column: span 3; }
.sp-4 { grid-column: span 4; }
.sp-5 { grid-column: span 5; }
.sp-6 { grid-column: span 6; }
.sp-7 { grid-column: span 7; }
.sp-8 { grid-column: span 8; }
.sp-12{ grid-column: span 12; }

/* ============================================================
   KPI
   ============================================================ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 20px 22px 18px;
  position: relative;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.kpi .top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.kpi .lbl {
  font-family: var(--f-ui);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.kpi .ic {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--accent);
  display: grid; place-items: center;
}
.kpi .v {
  font-family: var(--f-display);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-top: 12px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .v .u {
  font-size: 18px;
  color: var(--muted);
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0;
}
.kpi .foot {
  margin-top: auto;
  padding-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kpi .delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.kpi .delta.up   { color: var(--ok);   background: var(--ok-tint); }
.kpi .delta.down { color: var(--bad);  background: var(--bad-tint); }
.kpi .delta.flat { color: var(--muted); background: var(--paper-2); }

/* hero KPI · bordeaux */
.kpi.feature {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.kpi.feature .lbl  { color: rgba(242,235,219,0.75); }
.kpi.feature .ic   { background: var(--accent-3); color: var(--side-gold); }
.kpi.feature .v    { color: var(--paper); }
.kpi.feature .v .u { color: rgba(242,235,219,0.6); }
.kpi.feature .foot { color: rgba(242,235,219,0.7); }
.kpi.feature .delta.up,
.kpi.feature .delta.down,
.kpi.feature .delta.flat { color: var(--paper); background: rgba(255,255,255,0.12); }

/* accent variants */
.kpi.wine { border-color: var(--accent); border-left-width: 3px; }
.kpi.wine .v { color: var(--accent); }
.kpi.wine .ic { background: var(--accent-tint); color: var(--accent); }
.kpi.warn { border-color: var(--warn); border-left-width: 3px; }
.kpi.warn .v { color: var(--warn); }
.kpi.warn .ic { background: var(--warn-tint); color: var(--warn); }
.kpi.bad  { border-color: var(--bad);  border-left-width: 3px; }
.kpi.bad  .v { color: var(--bad); }
.kpi.bad  .ic { background: var(--bad-tint); color: var(--bad); }
.kpi.ok   { border-color: var(--ok); border-left-width: 3px; }
.kpi.ok   .v { color: var(--ok); }
.kpi.ok   .ic { background: var(--ok-tint); color: var(--ok); }

.kpi.compact { min-height: auto; padding: 16px 18px 14px; }
.kpi.compact .v { font-size: 30px; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 22px 24px;
  position: relative;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.card-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--ink);
  margin-top: 4px;
}
.card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
  max-width: 480px;
}
.card-aside { display: flex; gap: 12px; align-items: center; font-size: 11.5px; color: var(--muted); }

/* card hero · bordeaux block (like brand "ценности" card) */
.card.feature-block {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.card.feature-block .card-title { color: var(--paper); }
.card.feature-block .card-sub   { color: rgba(242,235,219,0.65); }
.card.feature-block .t-eyebrow { color: var(--side-gold); }

.legend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-3);
  font-family: var(--f-ui);
  letter-spacing: 0.04em;
}
.legend::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--ink);
}
.legend.wine::before  { background: var(--accent); }
.legend.olive::before { background: var(--olive); }
.legend.sand::before  { background: var(--sand-2); }
.legend.muted::before { background: var(--muted-2); }
.legend.ok::before    { background: var(--ok); }
.legend.bad::before   { background: var(--bad); }

/* ============================================================
   TABLE
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  text-align: left;
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--paper); }
.tbl .right { text-align: right; }
.tbl .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.tbl .num.big { font-family: var(--f-display); font-size: 17px; font-weight: 400; letter-spacing: -0.01em; }
.tbl .strong { font-weight: 500; color: var(--ink); }
.tbl .muted  { color: var(--muted); }

/* ============================================================
   PILL & TAG
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--f-ui);
  font-size: 10.5px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill.ok      { background: var(--ok-tint);      color: var(--ok); }
.pill.warn    { background: var(--warn-tint);    color: var(--warn); }
.pill.bad     { background: var(--bad-tint);     color: var(--bad); }
.pill.neutral { background: var(--paper-2);      color: var(--muted); }
.pill.wine    { background: var(--accent-tint);  color: var(--accent); }
.pill.solid   { background: var(--accent); color: var(--paper); }
.pill.solid::before { background: var(--side-gold); }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--f-ui);
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag.wine   { background: var(--accent-tint); border-color: var(--accent);  color: var(--accent); font-weight: 600; }
.tag.sand   { background: var(--sand-tint);   border-color: var(--sand-2);  color: #735028; font-weight: 600; }
.tag.olive  { background: var(--olive-tint);  border-color: var(--olive);   color: var(--olive); }
.tag.bad    { background: var(--bad-tint);    border-color: var(--bad);     color: var(--bad); }
.tag.ok     { background: var(--ok-tint);     border-color: var(--ok);      color: var(--ok); }

/* ============================================================
   AVATAR
   ============================================================ */
.av-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 400;
  color: var(--paper);
  background: var(--accent);
  flex-shrink: 0;
  letter-spacing: 0;
}
.av-sm.a2 { background: var(--olive); }
.av-sm.a3 { background: var(--sand-2); }
.av-sm.a4 { background: var(--ink); }
.av-sm.a5 { background: var(--accent-3); }
.av-sm.a6 { background: var(--bad); }

/* ============================================================
   CHART WRAPPER
   ============================================================ */
.chart { position: relative; height: 240px; }
.chart.sm { height: 180px; }
.chart.lg { height: 320px; }

/* ============================================================
   FEED
   ============================================================ */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.feed-item:last-child { border-bottom: 0; }
.feed-item .who  { font-weight: 500; font-size: 12.5px; letter-spacing: 0.02em; }
.feed-item .meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.feed-item .am   {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.feed-item .kind { font-family: var(--f-ui); font-size: 9.5px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; text-align: right; margin-top: 3px; font-weight: 600; }
.feed-item .kind.new   { color: var(--accent); }
.feed-item .kind.renew { color: var(--olive); }

/* ============================================================
   TARIFF
   ============================================================ */
.tariff-row {
  display: grid;
  grid-template-columns: 180px 1fr 130px 70px 60px;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.tariff-row:last-child { border-bottom: 0; }
.tariff-row .nm     { font-weight: 500; color: var(--ink); font-size: 12.5px; letter-spacing: 0.02em; }
.tariff-row .nm .sub{ display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); font-family: var(--f-mono); margin-top: 3px; letter-spacing: 0; }
.tariff-row .bar    { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.tariff-row .bar i  { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.tariff-row .bar.wine  i { background: var(--accent); }
.tariff-row .bar.olive i { background: var(--olive); }
.tariff-row .bar.sand  i { background: var(--sand-2); }
.tariff-row .bar.ink   i { background: var(--ink); }
.tariff-row .am {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tariff-row .cnt { font-family: var(--f-mono); font-size: 12px; text-align: right; color: var(--ink-2); }
.tariff-row .pct { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); text-align: right; }

/* ============================================================
   COHORT GRID
   ============================================================ */
.cohort {
  display: grid;
  grid-template-columns: 100px repeat(6, 1fr);
  gap: 4px;
}
.cohort .head, .cohort .row-lbl {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 4px;
}
.cohort .row-lbl {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  padding: 12px 6px;
  font-weight: 500;
}
.cohort .cl {
  padding: 12px 6px;
  text-align: center;
  border-radius: 3px;
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.cohort .cl.s95 { background: var(--accent);   color: var(--paper); }
.cohort .cl.s85 { background: var(--accent-2); color: var(--paper); }
.cohort .cl.s75 { background: var(--olive);    color: var(--paper); }
.cohort .cl.s60 { background: var(--olive-2);  color: var(--paper); }
.cohort .cl.s40 { background: var(--sand-tint); color: var(--ink-2); }
.cohort .cl.s20 { background: var(--warn-tint); color: var(--warn); }
.cohort .cl.s5  { background: var(--bad-tint); color: var(--bad); }
.cohort .cl.empty { background: var(--paper-2); color: var(--muted-2); font-family: var(--f-mono); font-size: 11px; font-weight: 400; }

/* ============================================================
   RISK ROW
   ============================================================ */
.risk-row {
  display: grid;
  grid-template-columns: 38px 1fr 100px 80px 110px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 6px;
}
.risk-row.high { border-left: 3px solid var(--bad); }
.risk-row.med  { border-left: 3px solid var(--warn); }
.risk-row .av {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--paper); background: var(--ink-3);
  font-weight: 400; font-size: 13px;
  font-family: var(--f-display);
}
.risk-row.high .av { background: var(--bad); }
.risk-row.med  .av { background: var(--warn); color: var(--ink); }
.risk-row .info .nm  { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.risk-row .info .why { font-size: 11px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.risk-row .silent { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); text-align: right; }
.risk-row.high .silent { color: var(--bad); font-weight: 600; }
.risk-row .score {
  font-family: var(--f-display);
  font-size: 28px;
  text-align: right;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.risk-row.high .score { color: var(--bad); }
.risk-row.med  .score { color: var(--warn); }
.risk-row .actions { display: flex; gap: 4px; justify-content: flex-end; }
.risk-row .actions button {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.risk-row .actions button:hover { background: var(--paper-2); color: var(--accent); }

/* ============================================================
   DONUT
   ============================================================ */
.donut {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 24px;
}
.donut svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut svg circle.bg { fill: none; stroke: var(--paper-2); stroke-width: 14; }
.donut svg circle.fg { fill: none; stroke-linecap: round; stroke-width: 14; }
.donut .legend-list { display: flex; flex-direction: column; gap: 10px; }
.donut .lr { display: flex; align-items: baseline; gap: 10px; }
.donut .sw { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; align-self: center; }
.donut .nm { font-size: 12px; color: var(--ink-2); flex: 1; letter-spacing: 0.02em; }
.donut .pct { font-family: var(--f-display); font-size: 18px; letter-spacing: -0.01em; font-weight: 400; }

/* ============================================================
   FUNNEL
   ============================================================ */
.funnel-step {
  display: grid;
  grid-template-columns: 260px 1fr 110px;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
}
.funnel-step .info .nm   { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.funnel-step .info .meta { font-size: 11px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.funnel-step .bar-wrap {
  height: 44px;
  background: var(--paper-2);
  border-radius: var(--r-2);
  position: relative;
  overflow: hidden;
}
.funnel-step .bar-wrap i {
  display: flex;
  align-items: center;
  height: 100%;
  border-radius: var(--r-2);
  background: var(--ink);
  color: var(--paper);
  padding-left: 16px;
  font-family: var(--f-display);
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 400;
}
.funnel-step.s2 .bar-wrap i { background: var(--accent-3); }
.funnel-step.s3 .bar-wrap i { background: var(--accent); }
.funnel-step.s4 .bar-wrap i { background: var(--accent-2); }
.funnel-step.s5 .bar-wrap i { background: var(--sand-2); }
.funnel-step .conv { text-align: right; }
.funnel-step .conv .v {
  font-family: var(--f-display);
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.funnel-step .conv .v.bad { color: var(--bad); }
.funnel-step .conv .s {
  font-family: var(--f-ui);
  font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 2px;
}

/* ============================================================
   INBOX
   ============================================================ */
.inbox-row {
  display: grid;
  grid-template-columns: 38px 1fr 130px 130px;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 8px;
}
.inbox-row.urgent { border-left: 3px solid var(--bad); }
.inbox-row.review { border-left: 3px solid var(--warn); }
.inbox-row.ok     { border-left: 3px solid var(--ok); }
.inbox-row .ico {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok-tint); color: var(--ok);
  flex-shrink: 0;
}
.inbox-row.urgent .ico { background: var(--bad-tint); color: var(--bad); }
.inbox-row.review .ico { background: var(--warn-tint); color: var(--warn); }
.inbox-row .body { min-width: 0; }
.inbox-row .head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.inbox-row .head .who { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.inbox-row .head .ago { color: var(--muted); font-family: var(--f-mono); font-size: 11px; }
.inbox-row .q { color: var(--ink-2); margin-bottom: 12px; line-height: 1.55; font-size: 12.5px; }
.inbox-row .draft {
  padding: 12px 16px;
  background: var(--paper);
  border-left: 2px solid var(--sand-2);
  font-family: var(--f-display);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  font-style: italic;
  border-radius: 0 4px 4px 0;
}
.inbox-row .meta-col { display: flex; flex-direction: column; gap: 8px; font-size: 11px; }
.inbox-row .meta-col .lbl { font-family: var(--f-ui); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.inbox-row .meta-col .val { font-family: var(--f-mono); color: var(--ink-2); font-size: 11.5px; }
.inbox-row .actions-col { display: flex; flex-direction: column; gap: 6px; }
.inbox-row .actions-col button {
  font-family: var(--f-ui);
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.inbox-row .actions-col .approve { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.inbox-row .actions-col .approve:hover { background: var(--accent-3); border-color: var(--accent-3); }
.inbox-row .actions-col .reject:hover  { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }
.inbox-row .actions-col .edit:hover    { background: var(--paper-2); color: var(--ink); }

/* ============================================================
   SHIP CARD
   ============================================================ */
.ship-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.ship-card.late { border-color: var(--bad); border-left-width: 3px; }
.ship-card.due  { border-color: var(--warn); border-left-width: 3px; }
.ship-card.done { opacity: 0.5; }
.ship-card .head { display: flex; justify-content: space-between; align-items: center; }
.ship-card .num  { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.ship-card .num b{ color: var(--ink); font-weight: 500; }
.ship-card .dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.ship-card.late .dot { background: var(--bad); animation: pulse 1.8s infinite; }
.ship-card.due  .dot { background: var(--warn); }
.ship-card.done .dot { background: var(--muted-2); }
.ship-card .who  { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.ship-card .addr { font-size: 11px; color: var(--muted); line-height: 1.5; }
.ship-card .row  { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.ship-card .row .lbl { font-family: var(--f-ui); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ship-card .row .v   { font-family: var(--f-display); font-size: 15px; letter-spacing: -0.01em; font-weight: 400; }
.ship-card .due-line { font-size: 11px; font-family: var(--f-mono); color: var(--muted); margin-top: 4px; }
.ship-card.late .due-line { color: var(--bad); font-weight: 600; }
.ship-card.due  .due-line { color: var(--warn); font-weight: 600; }

/* ============================================================
   UTM ROW
   ============================================================ */
.utm-row {
  display: grid;
  grid-template-columns: 42px 1fr 80px 80px 90px 110px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 6px;
}
.utm-row.top { border-left: 3px solid var(--ok); }
.utm-row.bad { border-left: 3px solid var(--bad); }
.utm-row .rank {
  font-family: var(--f-display);
  font-size: 28px;
  color: var(--muted-2);
  letter-spacing: -0.02em;
  font-weight: 400;
}
.utm-row.top .rank { color: var(--ok); }
.utm-row.bad .rank { color: var(--bad); }
.utm-row .src .nm   { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.utm-row .src .meta { font-size: 11px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.utm-row .num { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.utm-row .num b { font-family: var(--f-display); font-size: 17px; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }
.utm-row .roi {
  text-align: right;
  font-family: var(--f-display);
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.utm-row.top .roi { color: var(--ok); }
.utm-row.bad .roi { color: var(--bad); }

/* ============================================================
   MATRIX
   ============================================================ */
.matrix { font-size: 13px; width: 100%; border-collapse: separate; border-spacing: 4px; }
.matrix th, .matrix td { padding: 12px 12px; text-align: center; }
.matrix th { font-family: var(--f-ui); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.matrix th.row-h { text-align: left; }
.matrix td.row-h { text-align: left; font-weight: 500; color: var(--ink); background: var(--paper-2); border-radius: 3px; letter-spacing: 0.02em; }
.matrix td.cell {
  background: var(--surface);
  border-radius: 3px;
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.matrix td.cell.diag   { background: var(--accent);     color: var(--paper); }
.matrix td.cell.lost   { background: var(--bad-tint);   color: var(--bad); }
.matrix td.cell.weak   { background: var(--paper-2); }
.matrix td.cell.strong { background: var(--accent-tint); color: var(--accent); }
.matrix td.cell.empty  { color: var(--muted-2); font-family: var(--f-mono); font-size: 12px; font-weight: 400; }

/* ============================================================
   FORECAST CALLOUT + ROWS
   ============================================================ */
.fc-callout {
  background: var(--accent);
  color: var(--paper);
  border-radius: var(--r-3);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}
.fc-callout::before {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,168,120,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.fc-callout::after {
  content: "";
  position: absolute;
  left: -40px; bottom: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92,98,68,0.22) 0%, transparent 60%);
  pointer-events: none;
}
.fc-callout > * { position: relative; }
.fc-callout .lbl  { font-family: var(--f-ui); font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--side-gold); }
.fc-callout .v    { font-family: var(--f-display); font-size: 44px; line-height: 1; letter-spacing: -0.01em; margin-top: 10px; font-weight: 600; white-space: nowrap; }
.fc-callout .v .u { color: rgba(242,235,219,0.55); font-size: 28px; margin-left: 2px; }
.fc-callout .meta { font-size: 12px; color: rgba(242,235,219,0.7); margin-top: 10px; letter-spacing: 0.02em; }
.fc-callout .v.gold  { color: var(--side-gold); }
.fc-callout .v.olive { color: #9CB084; }

.fc-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 110px 120px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 6px;
  font-size: 12.5px;
}
.fc-row .nm b   { font-family: var(--f-display); font-size: 18px; font-weight: 400; letter-spacing: 0; }
.fc-row .nm .sub{ display: block; font-size: 10.5px; color: var(--muted); font-family: var(--f-mono); margin-top: 3px; }
.fc-row .v      { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.fc-row .tg     { font-family: var(--f-display); font-size: 18px; text-align: right; letter-spacing: -0.01em; font-weight: 400; }
.fc-row .dt     { text-align: right; font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; }
.fc-row .dt.up  { color: var(--ok); }
.fc-row .dt.down{ color: var(--bad); }
.fc-row .pr     { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.fc-row .pr i   { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.fc-row .pr.over i { background: var(--ok); }
.fc-row .pr.low  i { background: var(--bad); }

/* ============================================================
   STAT-SPARK
   ============================================================ */
.stat-spark {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
}
.stat-spark + .stat-spark { margin-top: 6px; }
.stat-spark .left .lbl  { font-family: var(--f-ui); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-spark .left .v    { font-family: var(--f-display); font-size: 26px; letter-spacing: -0.01em; line-height: 1.1; margin-top: 6px; font-weight: 400; }
.stat-spark .left .meta { font-size: 10.5px; color: var(--muted); font-family: var(--f-mono); margin-top: 4px; }
.stat-spark .right { display: flex; align-items: center; }
.stat-spark .right svg { width: 120px; height: 36px; }

/* ============================================================
   WHEEL PRIZE
   ============================================================ */
.wheel-prize {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.wheel-prize::before {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--accent-tint);
}
.wheel-prize.win::before  { background: var(--ok-tint); }
.wheel-prize.fail::before { background: var(--bad-tint); }
.wheel-prize > * { position: relative; }
.wheel-prize .lbl  { font-family: var(--f-ui); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wheel-prize .v    { font-family: var(--f-display); font-size: 38px; line-height: 1; letter-spacing: -0.01em; margin-top: 8px; font-weight: 400; }
.wheel-prize .v .u { font-size: 16px; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.wheel-prize .meta { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ============================================================
   SUPPORT ROW
   ============================================================ */
.support-row {
  display: grid;
  grid-template-columns: 38px 1fr 70px 70px 70px 120px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 6px;
}
.support-row .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--paper); background: var(--accent); font-weight: 400; font-size: 13px; font-family: var(--f-display); }
.support-row .av.a2 { background: var(--olive); }
.support-row .av.a3 { background: var(--sand-2); }
.support-row .who .nm   { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.support-row .who .role { font-size: 11px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.support-row .num { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.support-row .nps {
  text-align: right;
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.support-row .nps.up { color: var(--ok); }
.support-row .resp { font-family: var(--f-mono); font-size: 11.5px; text-align: right; color: var(--ink-2); }
.support-row .load { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.support-row .load i { display: block; height: 100%; background: var(--olive); border-radius: 999px; }
.support-row .load.warn i { background: var(--warn); }
.support-row .load.bad  i { background: var(--bad); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  background: var(--accent); color: var(--paper);
  border: none; cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--f-ui); font-weight: 600; font-size: 11px;
  display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.btn:hover { background: var(--accent-3); }
.btn.gh {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.gh:hover { background: var(--paper-2); }
.btn.txt {
  background: transparent;
  color: var(--accent);
  padding: 6px 0;
}
.btn.txt:hover { color: var(--accent-3); }

/* ============================================================
   GRAD RING
   ============================================================ */
.grad-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.grad-card .lbl { font-family: var(--f-ui); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.grad-card .v   { font-family: var(--f-display); font-size: 26px; letter-spacing: -0.01em; line-height: 1; margin-top: 6px; font-weight: 400; }
.grad-card .pct { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.grad-card .ring{ width: 58px; height: 58px; }

/* ============================================================
   SUB-NAV (in-tab navigation)
   ============================================================ */
.subnav {
  display: flex;
  gap: 3px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.subnav::-webkit-scrollbar { height: 4px; }
.subnav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.subnav button {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-family: var(--f-ui);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, color 120ms;
}
.subnav button:hover { color: var(--ink-2); }
.subnav button.active { background: var(--accent); color: var(--paper); }
.subpane { display: none; }
.subpane.active { display: block; }

/* a section divider header within a tab */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 28px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.section-head .orn { color: var(--accent); margin: 0 4px; opacity: 0.7; font-size: 11px; }
.section-head .sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  font-family: var(--f-ui);
  letter-spacing: 0.04em;
}

/* simple stub placeholder for a sub-pane that lists what the section contains */
.stub-card {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-2);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 20px;
  align-items: center;
}
.stub-card .ic {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid; place-items: center;
}
.stub-card .body .nm {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 400;
}
.stub-card .body .desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 540px;
}
.stub-card .filters {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
}
.stub-card .filters b { color: var(--ink-2); font-weight: 500; }

/* filter strip — inputs row */
.filter-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-bottom: 14px;
  font-family: var(--f-ui);
}
.filter-strip label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.filter-strip input[type="text"],
.filter-strip input[type="number"],
.filter-strip input[type="date"],
.filter-strip select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 6px 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.filter-strip input:focus,
.filter-strip select:focus { border-color: var(--accent); }

/* ============================================================
   TWEAKS
   ============================================================ */
#tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 24px 48px -16px rgba(42,21,16,0.22);
  padding: 20px;
  z-index: 100;
  display: none;
}
#tweaks.open { display: block; }
#tweaks h3 { font-family: var(--f-display); font-size: 22px; margin: 0 0 14px; font-weight: 400; letter-spacing: 0; }
#tweaks .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
#tweaks .row:first-of-type { border-top: 0; }
#tweaks .row label { font-family: var(--f-ui); font-size: 11px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
#tweaks .sw-list { display: flex; gap: 6px; }
#tweaks .sw {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
#tweaks .sw.active { box-shadow: 0 0 0 2px var(--accent); }
#tweaks .tseg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; }
#tweaks .tseg button {
  border: none; background: transparent; padding: 5px 12px; font-family: var(--f-ui); font-size: 10.5px;
  border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
#tweaks .tseg button.active { background: var(--accent); color: var(--paper); }
#tweaks .hint { font-size: 10.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

.tweak-toggle {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--accent); color: var(--paper);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 12px 28px -8px rgba(42,21,16,0.35);
  z-index: 99;
}

/* ============================================================
   THEMES
   ============================================================ */
body.accent-olive {
  --accent:      #5C6244;
  --accent-2:    #757A5C;
  --accent-3:    #424830;
  --accent-tint: #D8DBC4;
  --side-bg:     #424830;
  --side-bg-2:   #363C26;
  --side-bg-3:   #525940;
  --side-line:   #2F341F;
  --side-gold:   #C4A878;
}
body.accent-sand {
  --accent:      #8A6628;
  --accent-2:    #B5894A;
  --accent-3:    #6B4E1A;
  --accent-tint: #F2E2C1;
  --side-bg:     #6B4E1A;
  --side-bg-2:   #5A4115;
  --side-bg-3:   #7C5C25;
  --side-line:   #4A3610;
  --side-gold:   #E8DCC0;
}
body.accent-ink {
  --accent:      #2A2520;
  --accent-2:    #4A4138;
  --accent-3:    #1A1612;
  --accent-tint: #E5DABA;
  --side-bg:     #1A1612;
  --side-bg-2:   #14110E;
  --side-bg-3:   #28221C;
  --side-line:   #0F0D0A;
  --side-gold:   #C4A878;
}

body.theme-dark {
  --paper:     #1F1A15;
  --paper-2:   #2A241D;
  --surface:   #2A241D;
  --surface-2: #342D26;
  --ink:       #F2EBDB;
  --ink-2:     #D8CBA8;
  --ink-3:     #A89B82;
  --muted:     #8B7E6E;
  --muted-2:   #5C5246;
  --line:      #3D352B;
  --line-2:    #2F2922;
}
body.theme-dark .topbar { background: var(--paper); }
body.theme-dark .kpi.feature { background: var(--accent); }

/* density */
body.density-compact .kpi { padding: 16px 16px 14px; min-height: auto; }
body.density-compact .kpi .v { font-size: 32px; }
body.density-compact .card { padding: 18px; }
body.density-compact .content { padding: 22px 24px 48px; }
body.density-compact .tbl tbody td { padding: 9px 12px; }
body.density-compact .topbar { padding: 16px 24px 14px; }

/* responsive */
@media (max-width: 1480px) {
  .app { grid-template-columns: 232px 1fr; min-width: 1200px; }
  .content { padding: 24px 26px 56px; }
  .topbar { padding: 18px 26px 16px; }
}


/* ============================================================
   READABILITY · enforce 600 weight on all numeric display
   (Cormorant Garamond at 500/400 looks thin on digits)
   ============================================================ */
.kpi .v,
.tariff-row .am,
.feed-item .am,
.tbl .num.big,
.risk-row .score,
.fc-callout .v,
.fc-row .tg,
.fc-row .nm b,
.donut .pct,
.funnel-step .conv .v,
.funnel-step .bar-wrap i,
.utm-row .rank,
.utm-row .roi,
.matrix td.cell,
.wheel-prize .v,
.stat-spark .left .v,
.grad-card .v,
.support-row .nps,
.cohort .cl,
.section-bar .chip b,
.section-bar .info b,
.t-num,
.t-display {
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum","lnum","ss01";
}

/* Page title — keep slightly lighter for editorial feel */
.topbar h1, .card-title { font-weight: 500; }


/* ============================================================
   DATE RANGE POPOVER (topbar period selector)
   ============================================================ */
.period-wrap { position: relative; }
.seg button.custom {
  border-left: 1px dashed var(--line);
  margin-left: 4px;
  padding-left: 12px;
  color: var(--ink-2);
}
.seg button.custom.active { border-left: 1px solid var(--accent); background: var(--accent); color: var(--paper); }
.seg button.custom i { vertical-align: middle; }

.daterange-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 24px 48px -16px rgba(42,21,16,0.22),
              0 0 0 1px rgba(255,255,255,0.6) inset;
  padding: 18px;
  z-index: 50;
  display: none;
}
.daterange-pop.open { display: block; }
.daterange-pop::before {
  content: "";
  position: absolute;
  right: 36px;
  top: -7px;
  width: 12px; height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.daterange-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.daterange-head .t-eyebrow { letter-spacing: 0.18em; font-family: var(--f-display); font-size: 12px; font-weight: 500; }
.dr-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
}
.dr-close:hover { background: var(--paper-2); color: var(--ink); }

.dr-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.dr-presets button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 5px;
  padding: 7px 4px;
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dr-presets button:hover { background: var(--paper-2); border-color: var(--muted); }
.dr-presets button.active {
  background: var(--accent); color: var(--paper); border-color: var(--accent);
}

.dr-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 10px 14px;
}
.dr-inputs label {
  display: flex; flex-direction: column; gap: 4px;
}
.dr-inputs label .t-eyebrow {
  font-size: 9.5px; letter-spacing: 0.16em;
  font-family: var(--f-ui);
  font-weight: 600;
}
.dr-inputs input[type="date"] {
  border: none;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  padding: 2px 0;
  outline: none;
  width: 100%;
}
.dr-inputs input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.4);
  cursor: pointer;
}
.dr-arrow {
  display: grid; place-items: center;
  color: var(--muted);
  padding-bottom: 4px;
}

.dr-summary {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--f-mono);
  padding: 12px 4px 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
  text-align: center;
}
.dr-summary b { color: var(--ink); font-family: var(--f-display); font-size: 14px; font-weight: 600; }
.dr-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   A11y (Phase 2): видимый фокус + reduced-motion + skip-link
   ============================================================ */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* на тёмном бордовом сайдбаре — светлый ринг, иначе не виден */
.sidebar :where(button, a, [tabindex]):focus-visible {
  outline-color: var(--side-gold);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10001;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font: 600 13px/1 var(--f-ui, system-ui, sans-serif);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* уважение к prefers-reduced-motion: глушим анимации/переходы (вестибулярные расстройства) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
