/* ==========================================================================
   Kedai R3 — Warm Editorial Commerce Design System
   Zero slop. Deliberate spacing, tabular typography, semantic color restraint.
   ========================================================================== */

:root {
  --canvas: #F6F5F0;
  --surface: #FFFFFF;
  --surface-subtle: #FAF9F6;
  --surface-hover: #F2F0E9;

  --ink: #161816;
  --ink-secondary: #4B4F4B;
  --ink-muted: #787C76;
  --ink-faint: #A3A6A0;

  --line: #E6E3DA;
  --line-strong: #D5D1C5;

  --sidebar-bg: #131513;
  --sidebar-surface: #1D201D;
  --sidebar-line: #262A26;
  --sidebar-text: #C9CCC6;
  --sidebar-muted: #7C817A;

  /* Intentional semantic accents */
  --brand: #146C43;
  --brand-hover: #0F5635;
  --brand-soft: #E9F5EE;
  --brand-border: #BCE2CC;

  --amber: #B45309;
  --amber-soft: #FEF6E7;
  --amber-border: #F5D79F;

  --terracotta: #C2410C;
  --terracotta-soft: #FFF1EA;
  --terracotta-border: #F9C6AE;

  --crimson: #B91C1C;
  --crimson-soft: #FEF1F1;
  --crimson-border: #F7C0C0;

  --slate-accent: #334155;
  --slate-soft: #F1F5F9;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(22, 24, 22, 0.04);
  --shadow-sm: 0 1px 3px rgba(22, 24, 22, 0.05), 0 4px 14px rgba(22, 24, 22, 0.03);
  --shadow-lg: 0 24px 64px rgba(15, 18, 15, 0.18), 0 4px 16px rgba(15, 18, 15, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.num, .mono, td.text-right, .kpi-value, .metric-big {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

svg.ico {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  display: block;
}

/* ==========================================================================
   SPLIT-SCREEN EDITORIAL LOGIN
   ========================================================================== */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.login-panel-left {
  position: relative;
  background: var(--sidebar-bg);
  color: #F4F3EE;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.login-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 20% 20%, #000 30%, transparent 85%);
  pointer-events: none;
}

.login-left-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-width: 520px;
}

.brand-mark-lg {
  display: flex;
  align-items: center;
  gap: 14px;
}

.monogram-lg, .monogram, .monogram-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  background: var(--brand);
  flex-shrink: 0;
}

.monogram-lg {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.monogram {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 14px;
}

.monogram-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 11.5px;
}

.brand-lg-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-lg-domain {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8EA396;
}

.eyebrow-light {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #5EC28E;
  margin-bottom: 14px;
}

.login-hero {
  margin: 48px 0 40px;
}

.login-hero h2 {
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.login-hero p {
  margin: 0;
  color: #A6ACA4;
  font-size: 15px;
  line-height: 1.65;
}

.login-pillars {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid var(--sidebar-line);
  padding-top: 28px;
}

.pillar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pillar-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #5EC28E;
  padding-top: 2px;
}

.pillar strong {
  display: block;
  font-size: 13.5px;
  color: #F4F3EE;
  font-weight: 600;
}

.pillar span {
  font-size: 12.5px;
  color: #8E948C;
}

.login-panel-right {
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.login-box {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
  box-shadow: var(--shadow-sm);
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 13.5px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-heading {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.login-sub {
  margin: 0 0 26px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.login-footnote {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}

.form-error {
  background: var(--crimson-soft);
  border: 1px solid var(--crimson-border);
  color: var(--crimson);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 14px;
}

/* ==========================================================================
   SHELL & SIDEBAR
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 21, 19, 0.45);
  z-index: 35;
}

.sidebar {
  width: 256px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  border-right: 1px solid var(--sidebar-line);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.sidebar-brand-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sidebar-muted);
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sidebar-muted);
  padding: 10px 10px 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  padding: 9px 11px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: var(--sidebar-surface);
  color: #FFFFFF;
}

.nav-item.active {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
}

.nav-item.active .nav-ico {
  color: var(--brand);
}

.nav-ico {
  display: inline-flex;
  color: #8A8F88;
}

.nav-item:hover .nav-ico {
  color: #D9DCD6;
}

.nav-pill-alert {
  margin-left: auto;
  background: var(--crimson);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-line);
  padding: 9px 10px;
  border-radius: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2C332D;
  color: #D7E5DC;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-info {
  min-width: 0;
  flex: 1;
}

.user-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #F4F3EE;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8EA396;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
  box-shadow: 0 0 0 2.5px rgba(34, 197, 94, 0.2);
}

.icon-btn-dark {
  border: none;
  background: transparent;
  color: #9CA39A;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

/* ==========================================================================
   TOPBAR & CANVAS
   ========================================================================== */

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(246, 245, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 25;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.sync-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 2px 9px;
  border-radius: 999px;
}

.page-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.segmented {
  display: inline-flex;
  background: #EBE8DF;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 24, 22, 0.08);
}

.canvas {
  padding: 26px 32px 56px;
  max-width: 1420px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.08s;
  white-space: nowrap;
}

.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }

.btn-dark {
  background: var(--ink);
  color: #FFFFFF;
}
.btn-dark:hover:not(:disabled) { background: #2C2F2C; }

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger-soft {
  background: var(--crimson-soft);
  color: var(--crimson);
  border-color: var(--crimson-border);
}
.btn-danger-soft:hover:not(:disabled) {
  background: var(--crimson);
  color: #FFFFFF;
  border-color: var(--crimson);
}

.btn-amber-soft {
  background: var(--terracotta-soft);
  color: var(--terracotta);
  border-color: var(--terracotta-border);
}
.btn-amber-soft:hover:not(:disabled) {
  background: var(--terracotta);
  color: #FFFFFF;
  border-color: var(--terracotta);
}

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }

.mobile-only { display: none; }

/* ==========================================================================
   ALERT STRIP & BENTO CARDS
   ========================================================================== */

.alert-strip {
  background: var(--surface);
  border: 1px solid var(--crimson-border);
  border-left: 4px solid var(--crimson);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}

.alert-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-strip-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--crimson-soft);
  color: var(--crimson);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-strip-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.alert-strip-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.bento-kpi {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.grid-main-side {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

.card-flush .card-header {
  padding: 20px 24px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { border-color: var(--line-strong); }

.kpi-card.hero {
  background: var(--sidebar-bg);
  border-color: var(--sidebar-line);
  color: #FFFFFF;
}

.kpi-card.hero .kpi-label { color: #9BA29A; }
.kpi-card.hero .kpi-meta { color: #A6ACA4; }
.kpi-card.hero .kpi-value { color: #FFFFFF; }

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-ico {
  color: var(--ink-faint);
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.kpi-value.md {
  font-size: 20px;
  line-height: 1.25;
}

.kpi-meta {
  font-size: 12.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.delta-pill.up { background: rgba(34, 197, 94, 0.16); color: #4ADE80; }
.delta-pill.green { background: var(--brand-soft); color: var(--brand); }
.delta-pill.warn { background: var(--terracotta-soft); color: var(--terracotta); }
.delta-pill.red { background: var(--crimson-soft); color: var(--crimson); }

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-no-dot::before { display: none; }

.badge-expired { background: var(--crimson-soft); color: var(--crimson); border-color: var(--crimson-border); }
.badge-critical { background: var(--terracotta-soft); color: var(--terracotta); border-color: var(--terracotta-border); }
.badge-warning { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.badge-safe { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-border); }
.badge-neutral { background: var(--surface-subtle); color: var(--ink-secondary); border-color: var(--line); }

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-subtle); }

.text-right { text-align: right; }
.text-muted { color: var(--ink-muted); }

.rank-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rank-num.top {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

/* ==========================================================================
   CHARTS, BARS & HEATMAP
   ========================================================================== */

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  position: relative;
}

.chart-tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--sidebar-bg);
  color: #FFFFFF;
  border: 1px solid #2E322E;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
}

.chart-tooltip-title {
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #B9BEB7;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-row strong {
  color: #FFFFFF;
}

.meter-row {
  margin-bottom: 14px;
}
.meter-row:last-child { margin-bottom: 0; }

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.meter-track {
  height: 7px;
  background: #ECEAE2;
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Insights */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.insight-card {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insight-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.insight-text {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* Heatmap */
.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  gap: 4px;
  min-width: 620px;
}

.hm-head {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  padding-bottom: 4px;
}

.hm-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
}

.hm-cell {
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  cursor: default;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hm-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--ink);
  z-index: 2;
}

.hm-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.hm-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pill-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.pill-btn.active { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* ==========================================================================
   POS TESTER & INVENTORY
   ========================================================================== */

.pos-grid-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.pos-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 490px;
  overflow-y: auto;
  padding-right: 4px;
}

.pos-sku-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.14s, transform 0.08s, box-shadow 0.14s;
}

.pos-sku-card:hover {
  border-color: var(--brand);
  box-shadow: 0 3px 12px rgba(20, 108, 67, 0.1);
}

.pos-sku-card.disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pos-sku-cat {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pos-sku-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.pos-sku-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.qty-stepper button {
  border: none;
  background: var(--surface-subtle);
  width: 28px;
  height: 28px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.qty-stepper button:hover { background: var(--surface-hover); }
.qty-stepper span {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   FORMS, MODALS, RECEIPT, CODE
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.14s, box-shadow 0.14s;
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 108, 67, 0.12);
}

.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-wrap .search-ico {
  position: absolute;
  left: 11px;
  color: var(--ink-faint);
  pointer-events: none;
}

.search-wrap .input {
  padding-left: 34px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 21, 19, 0.52);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.modal-subtitle {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.modal-body {
  padding: 20px 24px 24px;
}

.receipt-paper {
  font-family: var(--font-mono);
  background: #FAF8F2;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 18px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink);
}

.code-block {
  background: var(--sidebar-bg);
  color: #D7DDD6;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sidebar-bg);
  color: #FFFFFF;
  border: 1px solid #2A2E2A;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.18s ease-out;
}

.toast.success { border-left: 3px solid #22C55E; }
.toast.error { border-left: 3px solid #EF4444; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton */
.skeleton-wrap { display: flex; flex-direction: column; gap: 18px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skeleton-card, .skeleton-bar {
  background: linear-gradient(90deg, #EAE7DE 25%, #F2F0E8 50%, #EAE7DE 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
.skeleton-card { height: 112px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1140px) {
  .bento-kpi, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-grid { grid-template-columns: 1fr; }
  .grid-main-side, .grid-2, .pos-grid-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-panel-left { display: none; }
  .login-mobile-brand { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.open { display: block; }
  .mobile-only { display: inline-flex; }

  .topbar { padding: 14px 16px; }
  .canvas { padding: 18px 16px 40px; }
  .hide-sm { display: none; }
  .grid-3, .bento-kpi, .grid-4, .form-grid { grid-template-columns: 1fr; }
}
