/* ─── Cinex theme — signature components ──────────────────────────────────────
   Tokens (palette, radii, shell) live in app.css `:root`. This file carries what tokens cannot:
   the reference's component *shapes* — tinted metric tiles, solid status pills, borderless soft
   cards, filled inputs, striped chart areas. Every rule is scoped to `[data-theme="cinex"]`
   (theme-boot.js always stamps it) and the file loads last in <head>, so it wins ties with page
   stylesheets without `!important`. */

[data-theme="cinex"] {
  --cx-tint-cream: var(--sun-cream);
  --cx-tint-lilac: var(--lilac-soft);
  --cx-tint-cobalt: #e8efff;
  --cx-pill-sun-ink: #3b2500;
  --cx-pill-lilac: #8b46e8;
  --cx-input-fill: #f7f6f2;
}

/* ─── Type ─────────────────────────────────────────────────────────────────── */
[data-theme="cinex"] .card-header h2,
[data-theme="cinex"] .dashboard-section-head h2,
[data-theme="cinex"] .page-intro h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
[data-theme="cinex"] .topbar-title .breadcrumb { color: color-mix(in oklab, var(--sun-ink) 55%, var(--muted)); }

/* ─── Cards: borderless white on the stone canvas, airy headers ──────────── */
[data-theme="cinex"] .card,
[data-theme="cinex"] .metric { border-color: transparent; }
[data-theme="cinex"] .card-header { border-bottom-color: transparent; padding-bottom: var(--space-2); }
[data-theme="cinex"] .card-footer { background: transparent; border-top-color: var(--border-soft); }
[data-theme="cinex"] .modal-panel,
[data-theme="cinex"] .drawer { border-radius: 24px; }

/* ─── Metric strip → separate tinted tiles (cream / lilac / cobalt / white) ─ */
[data-theme="cinex"] .fin-kpi,
[data-theme="cinex"] .kpi-row {
  gap: 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
[data-theme="cinex"] .fin-kpi-cell,
[data-theme="cinex"] .kpi-row .kpi-cell {
  border: 0 !important; /* the strip's responsive divider rules use !important on mobile */
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 18px 20px;
  box-shadow: var(--elev-raised);
}
[data-theme="cinex"] .fin-kpi-cell:nth-child(4n+1),
[data-theme="cinex"] .kpi-row .kpi-cell:nth-child(4n+1) { background: var(--cx-tint-cream); }
[data-theme="cinex"] .fin-kpi-cell:nth-child(4n+2),
[data-theme="cinex"] .kpi-row .kpi-cell:nth-child(4n+2) { background: var(--cx-tint-lilac); }
[data-theme="cinex"] .fin-kpi-cell:nth-child(4n+3),
[data-theme="cinex"] .kpi-row .kpi-cell:nth-child(4n+3) { background: var(--cx-tint-cobalt); }
[data-theme="cinex"] .fin-kpi-label,
[data-theme="cinex"] .kpi-row .kpi-label { font-family: var(--font-body); color: var(--fg-2); }
[data-theme="cinex"] .fin-kpi-value,
[data-theme="cinex"] .kpi-row .kpi-num { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; }
[data-theme="cinex"] a.kpi-cell:hover { filter: brightness(0.98); background-color: inherit; }
[data-theme="cinex"] .kpi-row .kpi-cell.is-active { box-shadow: inset 0 0 0 2px var(--accent); }

/* ─── Status pills: solid sunflower / lilac like the reference, soft for the rest, no dot ── */
[data-theme="cinex"] .pill {
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  border-color: transparent;
}
[data-theme="cinex"] .pill::before { display: none; }
[data-theme="cinex"] .pill-warn { background: var(--sun); color: var(--cx-pill-sun-ink); }
[data-theme="cinex"] .pill-accent { background: var(--cx-pill-lilac); color: #ffffff; }
[data-theme="cinex"] .pill-info { background: var(--cx-tint-cobalt); color: var(--accent-ink); }
[data-theme="cinex"] .pill-plain { border-color: var(--border); }
[data-theme="cinex"] .tag:not(.is-active):not(.is-ok):not(.is-warn):not(.is-danger):not(.is-muted) { border-color: transparent; background: var(--surface-warm); }

/* ─── Inputs: soft filled fields, white on focus ─────────────────────────── */
[data-theme="cinex"] .input,
[data-theme="cinex"] .select,
[data-theme="cinex"] .textarea {
  background-color: var(--cx-input-fill);
  border-color: transparent;
}
[data-theme="cinex"] .input:hover,
[data-theme="cinex"] .select:hover,
[data-theme="cinex"] .textarea:hover { border-color: var(--border); }
[data-theme="cinex"] .input:focus,
[data-theme="cinex"] .select:focus,
[data-theme="cinex"] .textarea:focus { background-color: var(--surface); border-color: var(--accent); }

/* ─── Tables: no header band, faint rules, cream row hover ───────────────── */
[data-theme="cinex"] .ds-table th {
  background: var(--surface); /* sticky header still needs an opaque fill */
  color: var(--muted);
  border-bottom-color: var(--border-soft);
}
[data-theme="cinex"] .ds-table thead th { box-shadow: inset 0 -1px 0 var(--border-soft); }
[data-theme="cinex"] .ds-table td { border-bottom-color: color-mix(in oklab, var(--border-soft) 70%, transparent); }
[data-theme="cinex"] .ds-table tbody tr:hover { background: color-mix(in oklab, var(--sun-cream) 45%, transparent); }

/* ─── Tabs: white pill on a sunk track (period pickers, view switches) ───── */
[data-theme="cinex"] .tab-btn.is-active { color: var(--accent-ink); }

/* ─── Dashboard task cards: tinted by severity instead of a hard top stripe ─ */
[data-theme="cinex"] .task-card { border-top-color: transparent; border-radius: var(--radius-lg); }
[data-theme="cinex"] .task-card--danger { background: color-mix(in oklab, var(--danger) 6%, var(--surface)); }
[data-theme="cinex"] .task-card--warn,
[data-theme="cinex"] .task-card--reminder { background: color-mix(in oklab, var(--sun-cream) 70%, var(--surface)); }
[data-theme="cinex"] .task-card--ok { background: color-mix(in oklab, var(--success) 6%, var(--surface)); }
[data-theme="cinex"] .task-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); }

/* ─── Charts: cobalt line over a striped range (reference "blood sugar" chart) ── */
[data-theme="cinex"] #dashboard-revenue-area { fill: url(#rev-stripes); }
[data-theme="cinex"] #overview-revenue-area { fill: url(#ov-rev-stripes); }
[data-theme="cinex"] #finance-revenue-area { fill: url(#fin-rev-stripes); }

/* ─── Shell details ──────────────────────────────────────────────────────── */
[data-theme="cinex"] .sidebar-footer .avatar { background: var(--sun); color: var(--cx-pill-sun-ink); box-shadow: none; }
[data-theme="cinex"] .sidebar-label { color: var(--muted); }

/* ─── Dashboard "Needs attention" cards: tinted tiles, round icon, no hard stripe ── */
[data-theme="cinex"] .attention-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--sun-cream) 60%, var(--surface));
  box-shadow: var(--elev-raised);
}
[data-theme="cinex"] .attention-card.is-danger { background: color-mix(in oklab, var(--danger) 7%, var(--surface)); }
[data-theme="cinex"] .attention-card:hover { filter: brightness(0.985); }
[data-theme="cinex"] .attention-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); }
[data-theme="cinex"] .attention-count { font-weight: 500; letter-spacing: -0.03em; }
[data-theme="cinex"] .attention-foot { border-top-color: color-mix(in oklab, var(--fg) 8%, transparent); }

/* Tone tags follow the pill recipe: sunflower solid for "needs action", soft for the rest. */
[data-theme="cinex"] .tag.is-warn { background: var(--sun); color: var(--cx-pill-sun-ink); border-color: transparent; }
[data-theme="cinex"] .tag.is-danger { background: color-mix(in oklab, var(--danger) 12%, var(--surface)); border-color: transparent; }
[data-theme="cinex"] .tag.is-ok { border-color: transparent; }

/* ─── System-health strip sits on the stone canvas ───────────────────────── */
[data-theme="cinex"] .dashboard-health-strip { background: transparent; border-bottom-color: var(--border); }
