/* AgriOps — premium SaaS visual system. Pure CSS, no frameworks. */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Surfaces */
  --bg: #f6f7f9;
  --bg-grad: radial-gradient(1200px 600px at 90% -10%, rgba(16,185,129,0.06), transparent 60%),
             radial-gradient(900px 500px at -10% 100%, rgba(99,102,241,0.05), transparent 60%),
             #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --panel-3: #f3f4f6;
  --hover: #f5f7fa;

  /* Borders */
  --border: #e6e8ee;
  --border-soft: #eef0f4;
  --border-hard: #d8dce3;

  /* Text */
  --text: #0a0e1a;
  --text-2: #1f2535;
  --text-soft: #4a5366;
  --text-mute: #8a93a6;
  --text-faint: #b3bac6;

  /* Accents */
  --accent: #10b981;
  --accent-2: #059669;
  --accent-3: #047857;
  --accent-soft: rgba(16,185,129,0.10);
  --accent-tint: #d1fae5;
  --accent-glow: 0 8px 24px -8px rgba(16,185,129,0.45);

  --indigo: #6366f1;
  --indigo-soft: rgba(99,102,241,0.10);

  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,0.10);
  --danger-tint: #fee2e2;
  --warn: #f59e0b;
  --warn-soft: rgba(245,158,11,0.10);
  --warn-tint: #fef3c7;
  --info: #0ea5e9;
  --info-soft: rgba(14,165,233,0.10);
  --info-tint: #e0f2fe;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 2px 4px rgba(15,23,42,0.04), 0 1px 2px rgba(15,23,42,0.03);
  --shadow-md: 0 4px 14px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 14px 40px rgba(15,23,42,0.08), 0 6px 12px rgba(15,23,42,0.05);
  --shadow-xl: 0 24px 64px rgba(15,23,42,0.14), 0 10px 24px rgba(15,23,42,0.08);
  --ring: 0 0 0 4px rgba(16,185,129,0.12);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 68px;

  /* Motion */
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-out: cubic-bezier(.22,1,.36,1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 380ms;
}
[data-theme="dark"] {
  --bg: #0a0d12;
  --bg-grad: radial-gradient(1200px 600px at 90% -10%, rgba(16,185,129,0.07), transparent 60%),
             radial-gradient(900px 500px at -10% 100%, rgba(99,102,241,0.06), transparent 60%),
             #0a0d12;
  --panel: #11151c;
  --panel-2: #161b24;
  --panel-3: #1c222c;
  --hover: #1a1f29;

  --border: #232a36;
  --border-soft: #1c222c;
  --border-hard: #2a3240;

  --text: #f1f3f7;
  --text-2: #d6dae3;
  --text-soft: #a3aab8;
  --text-mute: #6b7383;
  --text-faint: #4a5160;

  --accent: #34d399;
  --accent-2: #10b981;
  --accent-3: #059669;
  --accent-soft: rgba(52,211,153,0.14);
  --accent-tint: rgba(52,211,153,0.18);
  --accent-glow: 0 8px 28px -8px rgba(52,211,153,0.45);

  --indigo: #818cf8;
  --indigo-soft: rgba(129,140,248,0.14);

  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.14);
  --danger-tint: rgba(248,113,113,0.18);
  --warn: #fbbf24;
  --warn-soft: rgba(251,191,36,0.14);
  --warn-tint: rgba(251,191,36,0.18);
  --info: #38bdf8;
  --info-soft: rgba(56,189,248,0.14);
  --info-tint: rgba(56,189,248,0.18);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.6), 0 6px 12px rgba(0,0,0,0.35);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.7);
  --ring: 0 0 0 4px rgba(52,211,153,0.18);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { color-scheme: light; }
[data-theme="dark"] html, [data-theme="dark"] { color-scheme: dark; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  letter-spacing: -0.005em;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; cursor: pointer; }
.hidden { display: none !important; }
.app-hidden { opacity: 0; pointer-events: none; }
img { max-width: 100%; }

/* Tabular numbers for KPIs and tables */
.num, table.tbl td.num, .kpi-value, .nav-count, kbd { font-variant-numeric: tabular-nums; }
kbd, code, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ============================================================
   SPLASH
   ============================================================ */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-grad);
  display: grid; place-items: center; align-content: center;
  gap: 14px; transition: opacity .5s ease;
}
#splash.fade-out { opacity: 0; pointer-events: none; }
.splash-mark {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(160deg, #34d399, #047857);
  box-shadow: 0 14px 40px -10px rgba(16,185,129,0.55), inset 0 1px 0 rgba(255,255,255,0.4);
  display: grid; place-items: center;
  animation: splashPulse 1.6s var(--ease-out) infinite;
}
.splash-glyph {
  width: 24px; height: 24px;
  background: white; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 22c4-1 6-5 6-10 0 5 2 9 6 10' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 22c4-1 6-5 6-10 0 5 2 9 6 10' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/contain no-repeat;
}
.splash-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.splash-sub { font-size: 12px; color: var(--text-mute); letter-spacing: 0.04em; text-transform: uppercase; }
@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 14px 40px -10px rgba(16,185,129,0.55), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 18px 50px -10px rgba(16,185,129,0.7), inset 0 1px 0 rgba(255,255,255,0.4); }
}

/* ============================================================
   LAYOUT
   ============================================================ */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: opacity .4s ease;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}
[data-theme="dark"] .sidebar { background: rgba(17,21,28,0.6); backdrop-filter: blur(20px); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 22px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(160deg, #34d399, #047857);
  box-shadow: 0 6px 18px -4px rgba(16,185,129,0.55), inset 0 1px 0 rgba(255,255,255,0.4);
  display: grid; place-items: center;
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 11px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 55%);
  pointer-events: none;
}
.brand-mark-glyph {
  width: 16px; height: 16px;
  background: white;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 22c4-1 6-5 6-10 0 5 2 9 6 10' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 22c4-1 6-5 6-10 0 5 2 9 6 10' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/contain no-repeat;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-tag { font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }

#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section {
  padding: 14px 12px 6px;
  font-size: 10.5px; color: var(--text-mute);
  font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--t-fast) var(--ease);
  position: relative;
}
.nav-item .lbl { flex: 1; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  color: var(--accent-2);
  font-weight: 600;
}
[data-theme="dark"] .nav-item.active { color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px;
  width: 3px; background: var(--accent); border-radius: 999px;
  box-shadow: 0 0 12px var(--accent);
}
.nav-count {
  background: var(--panel-3);
  color: var(--text-soft);
  font-size: 11px; padding: 2px 8px;
  border-radius: 999px; font-weight: 600;
}
.nav-pill {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 10px; padding: 2px 7px;
  border-radius: 999px; font-weight: 600; letter-spacing: 0.02em;
}
[data-theme="dark"] .nav-pill { color: var(--accent); }

.sidebar-foot { padding-top: 12px; }
.foot-card {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.foot-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--text);
}
.foot-meta { font-size: 10.5px; color: var(--text-mute); margin-top: 4px; letter-spacing: 0.02em; }
.pulse {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  position: relative;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============================================================
   TOPBAR
   ============================================================ */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,0.7);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
[data-theme="dark"] .topbar { background: rgba(10,13,18,0.65); }

.search {
  flex: 1; max-width: 540px;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  padding: 9px 14px 9px 16px;
  color: var(--text-mute);
  transition: all var(--t-fast) var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--panel); }
.search input {
  border: none; outline: none; background: transparent;
  flex: 1; min-width: 0; color: var(--text);
}
.search input::placeholder { color: var(--text-mute); }
.kbd {
  font-size: 11px; padding: 2px 6px; border-radius: 5px;
  background: var(--panel-3); color: var(--text-mute);
  border: 1px solid var(--border-soft);
  letter-spacing: 0.02em;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.ghost-btn {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  position: relative;
  transition: all var(--t-fast) var(--ease);
}
.ghost-btn:hover { background: var(--hover); color: var(--text); border-color: var(--border-soft); }
.ghost-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--panel);
}
[data-theme="dark"] .topbar .ghost-btn .dot { box-shadow: 0 0 0 2px #11151c; }

.btn {
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text);
  color: var(--bg);
  transition: all var(--t-fast) var(--ease);
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-pill { border-radius: var(--r-pill); padding: 8px 16px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(16,185,129,0.55), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--panel-2); border-color: var(--border-hard); }
.btn-danger {
  background: linear-gradient(180deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 8px 22px -8px rgba(239,68,68,0.55);
}
.btn-pill.btn-pill-soft {
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid transparent;
}
[data-theme="dark"] .btn-pill.btn-pill-soft { color: var(--accent); }
.btn-pill.btn-pill-soft:hover { background: var(--accent-tint); }

/* Use the soft pill style for Ask AI */
#askAiBtn {
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid transparent;
  box-shadow: none;
}
[data-theme="dark"] #askAiBtn { color: var(--accent); }
#askAiBtn:hover { background: var(--accent-tint); transform: translateY(-1px); }

.avatar {
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}
.avatar::after {
  content: ""; position: absolute; bottom: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--accent); border: 2px solid var(--panel);
}
[data-theme="dark"] .avatar::after { border-color: #11151c; }

/* ============================================================
   PAGE FRAME
   ============================================================ */
.page-frame { padding: 28px; flex: 1; min-width: 0; max-width: 1480px; width: 100%; margin: 0 auto; }
.page { animation: pageIn .42s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.page-head-left { display: flex; align-items: center; gap: 14px; }
.back-btn {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text-soft); box-shadow: var(--shadow-xs);
  transition: all var(--t-fast) var(--ease);
}
.back-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-hard); transform: translateX(-2px); }
.back-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-title-block { display: flex; flex-direction: column; gap: 4px; }
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-mute); font-weight: 500;
}
.crumbs .crumb-sep { opacity: 0.5; }
.crumbs .crumb-current { color: var(--text-soft); }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.page-sub { color: var(--text-soft); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.card-pad { padding: 20px 22px; }
.card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.card-title { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.card-sub { color: var(--text-mute); font-size: 12px; margin-top: 3px; }

/* ============================================================
   KPI GRID
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.kpi:hover::after { opacity: 0.7; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { color: var(--text-soft); font-size: 12.5px; font-weight: 500; letter-spacing: 0.005em; }
.kpi-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-2);
  display: grid; place-items: center;
}
[data-theme="dark"] .kpi-icon { color: var(--accent); }
.kpi-icon.indigo { background: var(--indigo-soft); color: var(--indigo); }
.kpi-icon.warn { background: var(--warn-soft); color: var(--warn); }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin-top: 10px; line-height: 1.1; }
.kpi-value.warn { color: var(--danger); }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.trend.up { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .trend.up { color: var(--accent); }
.trend.down { background: var(--danger-soft); color: var(--danger); }
.trend.flat { background: var(--panel-3); color: var(--text-mute); }
.kpi-meta { color: var(--text-mute); font-size: 11.5px; }
.kpi-spark { margin-top: 12px; height: 36px; }
.kpi-spark canvas { width: 100% !important; height: 100% !important; }

/* ============================================================
   CHART CARDS
   ============================================================ */
.charts-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .charts-row { grid-template-columns: 1fr; } }
.chart-wrap { padding: 18px 22px 22px; }
.chart-wrap canvas { width: 100% !important; height: 260px !important; }
.legend-pills { display: flex; gap: 10px; }
.lp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.lp::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.lp.purple::before { background: var(--indigo); }
.lp.teal::before { background: #5eead4; }

/* ============================================================
   INFO ROW (alerts / suggestions)
   ============================================================ */
.info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .info-row { grid-template-columns: 1fr; } }
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--border-soft);
  transition: background var(--t-fast) var(--ease);
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--hover); }
.alert-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; flex: none;
  background: var(--warn-soft); color: var(--warn);
}
.alert-icon.danger { background: var(--danger-soft); color: var(--danger); }
.alert-icon.info { background: var(--info-soft); color: var(--info); }
.alert-icon.ok { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .alert-icon.ok { color: var(--accent); }
.alert-text { font-size: 13px; color: var(--text); }
.alert-meta { color: var(--text-mute); font-size: 11.5px; margin-top: 2px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
table.tbl th {
  font-weight: 600;
  color: var(--text-mute);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel-2);
  position: sticky; top: 0;
}
table.tbl tr { transition: background var(--t-fast) var(--ease); }
table.tbl tbody tr:hover td { background: var(--hover); }
table.tbl td.num { text-align: right; }
.cell-prim { font-weight: 600; color: var(--text); }
.cell-tag { color: var(--text-mute); font-size: 11.5px; margin-top: 1px; }
.cell-stack { display: flex; flex-direction: column; }
.row-avatar {
  display: inline-flex; align-items: center; gap: 10px;
}
.row-avatar .av {
  width: 28px; height: 28px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: white;
  background: linear-gradient(135deg, #34d399, #047857);
  flex: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.005em;
}
.badge.ok { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .badge.ok { color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: #b45309; }
[data-theme="dark"] .badge.warn { color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: #b91c1c; }
[data-theme="dark"] .badge.danger { color: var(--danger); }
.badge.info { background: var(--info-soft); color: #075985; }
[data-theme="dark"] .badge.info { color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--border); color: var(--text-soft); }
.badge .bdot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ============================================================
   FORMS / INPUTS
   ============================================================ */
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  outline: none;
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input:hover { border-color: var(--border-hard); }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--panel); }
textarea.input { resize: vertical; min-height: 70px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pager {
  display: flex; gap: 8px; align-items: center;
  padding: 14px 22px; justify-content: flex-end;
  color: var(--text-soft); font-size: 12.5px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
}
.pager .pager-info { margin-right: auto; color: var(--text-mute); }
.pager button {
  padding: 6px 12px; border-radius: var(--r-xs);
  background: var(--panel); border: 1px solid var(--border);
  font-weight: 500; transition: all var(--t-fast) var(--ease);
}
.pager button:hover:not(:disabled) { border-color: var(--border-hard); background: var(--hover); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   AI CHAT
   ============================================================ */
.ai-shell { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 56px - 84px); min-height: 520px; max-height: 800px; }
.ai-msgs { flex: 1; padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ai-bubble { display: flex; gap: 10px; max-width: 80%; align-items: flex-start; animation: pageIn .3s var(--ease) both; }
.ai-bubble .msg { padding: 12px 16px; border-radius: 14px; line-height: 1.6; white-space: pre-wrap; font-size: 13.5px; }
.ai-bubble.bot .msg { background: var(--panel-2); border: 1px solid var(--border-soft); }
.ai-bubble.user { align-self: flex-end; }
.ai-bubble.user .msg {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: var(--accent-glow);
}
.ai-avatar {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  color: var(--accent-2);
  border: 1px solid var(--border-soft);
  flex: none;
}
[data-theme="dark"] .ai-avatar { color: var(--accent); }
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 999px; background: var(--text-mute);
  animation: typing 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,80%,100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ai-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 24px 12px; }
.ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.ai-chip:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.ai-input-row { padding: 14px 22px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; align-items: center; }
.ai-input {
  flex: 1; padding: 11px 18px; border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  outline: none; color: var(--text);
  transition: all var(--t-fast) var(--ease);
}
.ai-input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--panel); }
.send-btn {
  width: 42px; height: 42px; border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: white; display: grid; place-items: center;
  box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all var(--t-fast) var(--ease);
}
.send-btn:hover { transform: translateY(-1px) scale(1.04); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(8,12,20,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
  z-index: 100; padding: 20px;
  animation: fade .2s var(--ease);
}
.modal {
  background: var(--panel);
  border-radius: var(--r-lg);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  animation: pop .3s var(--ease);
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 600; font-size: 16px; letter-spacing: -0.015em; }
.modal-close {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  color: var(--text-mute);
  transition: all var(--t-fast) var(--ease);
}
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--panel-2);
}

/* ============================================================
   TOASTS
   ============================================================ */
#toastRoot {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 200;
}
.toast {
  background: var(--panel);
  color: var(--text);
  padding: 12px 16px 12px 14px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 500;
  animation: slideIn .3s var(--ease);
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 360px;
}
.toast .toast-i {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  flex: none;
  background: var(--info-soft); color: var(--info);
}
.toast.success .toast-i { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .toast.success .toast-i { color: var(--accent); }
.toast.error .toast-i { background: var(--danger-soft); color: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   PIPELINE / SUPPLY
   ============================================================ */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px 22px; }
.pipe-step {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-soft);
  padding: 16px 18px;
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
}
.pipe-step::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  border-radius: 999px;
}
.pipe-step.warn::before { background: var(--warn); }
.pipe-step.info::before { background: var(--info); }
.pipe-step.indigo::before { background: var(--indigo); }
.pipe-step .lab { font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.pipe-step .num { font-weight: 700; font-size: 26px; letter-spacing: -0.02em; margin-top: 6px; color: var(--text); }
.pipe-step .delta { font-size: 11.5px; color: var(--text-mute); margin-top: 4px; }

/* ============================================================
   STOCK OPS CARDS
   ============================================================ */
.ops-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .ops-grid { grid-template-columns: 1fr; } }
.op-card {
  padding: 24px; cursor: pointer;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-fast) var(--ease);
  position: relative; overflow: hidden;
}
.op-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.op-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.op-card:hover::before { opacity: 1; }
.op-card > * { position: relative; }
.op-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  color: var(--accent-2);
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
}
[data-theme="dark"] .op-icon { color: var(--accent); }
.op-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.op-desc { color: var(--text-soft); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.op-arrow { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-size: 12px; color: var(--accent-2); font-weight: 600; }
[data-theme="dark"] .op-arrow { color: var(--accent); }

/* ============================================================
   SETTINGS GRID
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-card { display: flex; flex-direction: column; gap: 14px; }
.settings-card h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.settings-card p { margin: 0; color: var(--text-soft); font-size: 13px; }
.theme-options { display: flex; gap: 8px; }
.theme-pill {
  flex: 1; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--panel-2);
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 13px;
  cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.theme-pill .preview { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border-hard); }
.theme-pill .preview.light { background: linear-gradient(135deg, #ffffff 50%, #f4f5f7 50%); }
.theme-pill .preview.dark { background: linear-gradient(135deg, #11151c 50%, #0a0d12 50%); }
.theme-pill.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .theme-pill.active { color: var(--accent); }

/* ============================================================
   ICONS
   ============================================================ */
.i { width: 16px; height: 16px; display: inline-grid; place-items: center; flex: none; }
.i svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi-icon .i { width: 16px; height: 16px; }
.op-icon .i { width: 22px; height: 22px; }
.ai-avatar .i { width: 16px; height: 16px; }
.alert-icon .i { width: 16px; height: 16px; }
.toast .toast-i .i { width: 14px; height: 14px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-hard); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.empty {
  padding: 36px 22px; text-align: center; color: var(--text-mute); font-size: 13px;
}
.glow-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Skeleton (for initial paints) */
.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Selection */
::selection { background: var(--accent-soft); color: var(--accent-3); }
[data-theme="dark"] ::selection { color: var(--accent); }

/* ============================================================
   PHYSICAL ENTRY
   ============================================================ */
.entry-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-form-card { padding: 4px 0 0; }
.entry-form {
  padding: 22px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.entry-form .field-full { grid-column: 1 / -1; }
.entry-foot {
  padding: 16px 24px; border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel-2);
}
.kbd-hint { color: var(--text-mute); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.kbd-hint kbd { padding: 1px 6px; }
.glass-btn {
  padding: 10px 18px; border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4));
  border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: all var(--t-fast) var(--ease);
}
[data-theme="dark"] .glass-btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.06);
}
.glass-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft);
  border-color: var(--accent);
}
.success-pulse {
  position: fixed; inset: 0; pointer-events: none;
  display: grid; place-items: center; z-index: 250;
  animation: pulseFade .9s var(--ease) forwards;
}
.success-pulse .ring {
  width: 110px; height: 110px; border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: white;
  box-shadow: 0 30px 80px -20px rgba(16,185,129,0.7);
  transform: scale(.6); animation: ringPop .9s var(--ease) forwards;
}
.success-pulse .ring .i { width: 56px; height: 56px; stroke-width: 2.4; }
@keyframes pulseFade { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ringPop { 0% { transform: scale(.5); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ============================================================
   BARCODES
   ============================================================ */
.barcode-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.barcode-toolbar .left { display: flex; gap: 10px; align-items: center; flex: 1; flex-wrap: wrap; }
.barcode-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.barcode-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; flex-direction: column;
  gap: 10px;
  transition: all var(--t-med) var(--ease);
  position: relative; overflow: hidden;
}
.barcode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.barcode-card .bc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.barcode-card .bc-name { font-weight: 600; font-size: 13.5px; line-height: 1.35; letter-spacing: -0.005em; }
.barcode-card .bc-cat { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.barcode-card .bc-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-hard);
  display: grid; place-items: center; cursor: pointer;
  transition: all var(--t-fast) var(--ease); flex: none;
}
.barcode-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.barcode-card.selected .bc-check { background: var(--accent); border-color: var(--accent); color: white; }
.barcode-card .bc-img-wrap {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid; place-items: center;
  min-height: 70px;
}
.barcode-card svg { display: block; max-width: 100%; height: 56px; }
.barcode-card .bc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.barcode-card .bc-meta { display: flex; flex-direction: column; }
.barcode-card .bc-sku { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; }
.barcode-card .bc-qty { font-size: 11px; color: var(--text-mute); }
.barcode-card .bc-act {
  padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--t-fast) var(--ease);
}
.barcode-card .bc-act:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* Glow effect on hover */
.glow-hover {
  position: relative;
}
.glow-hover::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--indigo));
  opacity: 0; z-index: -1; transition: opacity var(--t-med) var(--ease);
  filter: blur(12px);
}
.glow-hover:hover::after { opacity: 0.35; }

/* ============================================================
   LIVE TICKER (top scrolling status bar)
   ============================================================ */
.ticker-bar {
  position: relative;
  height: 36px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
  display: flex; align-items: center;
  z-index: 5;
}
.ticker-bar::before, .ticker-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 80px; pointer-events: none; z-index: 2;
}
.ticker-bar::before { left: 0; background: linear-gradient(90deg, var(--panel), transparent); }
.ticker-bar::after { right: 0; background: linear-gradient(-90deg, var(--panel), transparent); }
.ticker-label {
  flex: none; padding: 0 14px; height: 100%; display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: white; background: linear-gradient(180deg, var(--accent), var(--accent-3));
  z-index: 3; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  padding-right: 22px;
}
.ticker-label .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: white;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7); animation: tickPulse 1.6s infinite;
}
@keyframes tickPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); } 70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.ticker-track {
  display: flex; gap: 38px; align-items: center; padding-left: 28px;
  white-space: nowrap; animation: tickerScroll 60s linear infinite;
  font-size: 12.5px; color: var(--text-soft);
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; }
.ticker-item .i { width: 14px; height: 14px; }
.ticker-item.up { color: var(--accent-3); }
.ticker-item.warn { color: var(--orange); }
.ticker-item.danger { color: var(--red); }
.ticker-item strong { color: var(--text); font-weight: 600; }
.ticker-item .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-hard); }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ============================================================
   WAREHOUSE HEATMAP
   ============================================================ */
.heatmap-card { margin-bottom: 16px; }
.heatmap-grid { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.heatmap-row { display: flex; align-items: center; gap: 14px; }
.heatmap-row .wh-name {
  flex: none; width: 140px; font-size: 12.5px; font-weight: 600;
  display: flex; flex-direction: column; gap: 2px;
}
.heatmap-row .wh-name .meta { font-size: 11px; color: var(--text-mute); font-weight: 400; }
.heatmap-row .racks {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; flex: 1; min-width: 0;
}
.rack-cell {
  height: 28px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
  position: relative; cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
[data-theme="dark"] .rack-cell { border-color: rgba(255,255,255,0.06); }
.rack-cell:hover { transform: scale(1.18); z-index: 5; box-shadow: var(--shadow-md); border-color: var(--accent); }
.rack-cell.lvl-0 { background: linear-gradient(180deg, #d1fae5, #a7f3d0); }
.rack-cell.lvl-1 { background: linear-gradient(180deg, #6ee7b7, #34d399); }
.rack-cell.lvl-2 { background: linear-gradient(180deg, #fde68a, #fbbf24); }
.rack-cell.lvl-3 { background: linear-gradient(180deg, #fdba74, #fb923c); }
.rack-cell.lvl-4 { background: linear-gradient(180deg, #fca5a5, #ef4444); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08); }
[data-theme="dark"] .rack-cell.lvl-0 { background: linear-gradient(180deg, #064e3b, #065f46); }
.rack-cell-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--panel);
  padding: 5px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--t-fast);
  box-shadow: var(--shadow-md);
}
.rack-cell:hover .rack-cell-tip { opacity: 1; }
.heatmap-legend {
  display: flex; gap: 18px; align-items: center; padding: 10px 0 0; margin-top: 8px;
  border-top: 1px dashed var(--border-soft); font-size: 12px; color: var(--text-soft);
}
.heatmap-legend .swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ============================================================
   RISK BADGE
   ============================================================ */
.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.risk-badge .ring {
  width: 6px; height: 6px; border-radius: 50%;
  box-shadow: 0 0 0 2px currentColor;
}
.risk-low { background: rgba(16,185,129,0.10); color: #047857; border-color: rgba(16,185,129,0.25); }
.risk-med { background: rgba(245,158,11,0.10); color: #b45309; border-color: rgba(245,158,11,0.25); }
.risk-high { background: rgba(239,68,68,0.10); color: #b91c1c; border-color: rgba(239,68,68,0.25); animation: riskPulse 2s ease-in-out infinite; }
[data-theme="dark"] .risk-low { color: #6ee7b7; }
[data-theme="dark"] .risk-med { color: #fcd34d; }
[data-theme="dark"] .risk-high { color: #fca5a5; }
@keyframes riskPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); } 50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.18); } }

/* ============================================================
   PROFIT ANALYTICS
   ============================================================ */
.profit-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px;
}
@media (max-width: 1100px) { .profit-grid { grid-template-columns: 1fr; } }
.profit-list { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.profit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  transition: all var(--t-fast) var(--ease);
}
.profit-row:hover { transform: translateX(4px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.profit-rank {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(180deg, var(--accent), var(--accent-3)); color: white;
}
.profit-rank.r2 { background: linear-gradient(180deg, var(--indigo), #4f46e5); }
.profit-rank.r3 { background: linear-gradient(180deg, var(--info), #0284c7); }
.profit-rank.r4, .profit-rank.r5 { background: var(--panel-3); color: var(--text-soft); }
.profit-row .body { flex: 1; min-width: 0; }
.profit-row .name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profit-row .meta { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.profit-row .amt { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; color: var(--accent-3); }
.profit-row .bar {
  width: 100px; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden;
}
.profit-row .bar > i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--indigo));
  transition: width 1.2s var(--ease);
}
.loss-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.loss-row {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(239,68,68,0.05); border-left: 3px solid var(--red);
  transition: all var(--t-fast) var(--ease);
}
.loss-row:hover { background: rgba(239,68,68,0.10); transform: translateX(2px); }
.loss-row .ico { color: var(--red); flex: none; }
.loss-row .txt { font-size: 12.5px; line-height: 1.5; }
.loss-row .pct { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--red); font-weight: 700; }

/* ============================================================
   GST & TAX PANEL
   ============================================================ */
.gst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 0; }
@media (max-width: 900px) { .gst-grid { grid-template-columns: 1fr; } }
.gst-card {
  padding: 18px 20px; border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border-soft);
  position: relative; overflow: hidden;
  transition: all var(--t-med) var(--ease);
}
.gst-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.gst-card::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 100px; height: 100px; border-radius: 50%; opacity: 0.12;
  filter: blur(20px);
}
.gst-card.payable::before { background: var(--orange); }
.gst-card.recv::before { background: var(--accent-2); }
.gst-card.net::before { background: var(--indigo); }
.gst-card .label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }
.gst-card .val { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.gst-card.payable .val { color: var(--orange); }
.gst-card.recv .val { color: var(--accent-3); }
.gst-card .sub { font-size: 11.5px; color: var(--text-mute); margin-top: 6px; }
.gst-card .ico {
  position: absolute; bottom: 14px; right: 14px; width: 28px; height: 28px;
  display: grid; place-items: center; opacity: 0.18;
}
.gst-card .ico .i { width: 28px; height: 28px; }

/* ============================================================
   AI DECISION ENGINE
   ============================================================ */
.decision-hero {
  position: relative; padding: 22px 26px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #134e4a 100%);
  color: white; margin-bottom: 16px; overflow: hidden;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  box-shadow: 0 20px 60px -25px rgba(16,185,129,0.6);
}
.decision-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(16,185,129,0.25) 0%, transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(99,102,241,0.20) 0%, transparent 35%);
  pointer-events: none;
}
.decision-hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><path d='M0 .5h40M.5 0v40' stroke='rgba(255,255,255,0.04)' fill='none'/></svg>");
  opacity: 0.4; pointer-events: none;
}
.decision-hero .glyph {
  position: relative; z-index: 2;
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(160deg, #34d399, #10b981);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 10px 30px -8px rgba(16,185,129,0.7);
  animation: heroFloat 4s ease-in-out infinite;
}
.decision-hero .glyph .i { width: 28px; height: 28px; color: white; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-3deg); } }
.decision-hero .body { position: relative; z-index: 2; flex: 1; min-width: 220px; }
.decision-hero .body h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.decision-hero .body p { margin: 4px 0 0; font-size: 13px; color: rgba(255,255,255,0.7); }
.decision-btn {
  position: relative; z-index: 2;
  padding: 12px 22px; border-radius: var(--r-pill);
  background: linear-gradient(180deg, #34d399, #059669);
  color: white; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 0 0 rgba(52,211,153,0.5), 0 10px 30px -8px rgba(16,185,129,0.6);
  cursor: pointer; transition: all var(--t-med) var(--ease);
  animation: decisionGlow 2.4s ease-in-out infinite;
}
.decision-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 6px rgba(52,211,153,0.25), 0 16px 40px -10px rgba(16,185,129,0.8);
}
@keyframes decisionGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4), 0 10px 30px -8px rgba(16,185,129,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(52,211,153,0), 0 10px 30px -8px rgba(16,185,129,0.6); }
}
.decision-modal-list { display: flex; flex-direction: column; gap: 10px; }
.decision-item {
  display: flex; gap: 12px; padding: 14px;
  border-radius: var(--r-md);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  transition: all var(--t-fast) var(--ease);
  animation: decisionPop 0.4s var(--ease) backwards;
}
.decision-item:hover { transform: translateX(4px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
@keyframes decisionPop { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
.decision-item .pri {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: white;
}
.decision-item.p-high .pri { background: linear-gradient(160deg, #ef4444, #b91c1c); }
.decision-item.p-med .pri { background: linear-gradient(160deg, #f59e0b, #d97706); }
.decision-item.p-low .pri { background: linear-gradient(160deg, #10b981, #047857); }
.decision-item .body .title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.decision-item .body .desc { font-size: 12px; color: var(--text-mute); margin-top: 3px; line-height: 1.5; }
.decision-item .impact {
  margin-left: auto; font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: var(--r-pill);
  background: var(--panel-3); color: var(--text-soft); flex: none;
}

/* Glow hover utility for KPIs */
.kpi.glow-pulse:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent), 0 0 24px -4px var(--accent-soft);
  transform: translateY(-3px);
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
@media print {
  body { background: white !important; }
  .sidebar, .topbar, .page-head, .barcode-toolbar, #splash, #toastRoot { display: none !important; }
  .page-frame { padding: 0 !important; max-width: none !important; }
  .barcode-card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ============================================================
   ENTERPRISE: TABS / SUB-NAV
   ============================================================ */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-pill); margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.tab {
  padding: 8px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--text-mute); cursor: pointer; border: 0; background: transparent;
  border-radius: 999px; transition: all .18s ease; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab .i { width: 14px; height: 14px; }
.tab:hover { color: var(--text); background: var(--hover); }
.tab.active {
  background: var(--panel); color: var(--text);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
}
[data-theme="dark"] .tab.active {
  background: linear-gradient(180deg, #1c2230, #161b25);
  color: white;
}

/* ============================================================
   ENTERPRISE: VOUCHER / LEDGER ROWS
   ============================================================ */
.voucher-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.voucher-tile {
  position: relative;
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 14px 14px 12px;
  cursor: pointer; transition: all .18s ease;
  box-shadow: var(--shadow-xs);
}
.voucher-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent), 0 0 22px -6px var(--accent-soft);
}
.voucher-tile .v-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: white; margin-bottom: 10px;
}
.voucher-tile.sales .v-ico   { background: linear-gradient(160deg, #10b981, #047857); }
.voucher-tile.purchase .v-ico{ background: linear-gradient(160deg, #6366f1, #4338ca); }
.voucher-tile.payment .v-ico { background: linear-gradient(160deg, #f59e0b, #b45309); }
.voucher-tile.receipt .v-ico { background: linear-gradient(160deg, #0ea5e9, #0369a1); }
.voucher-tile .v-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.voucher-tile .v-sub  { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.voucher-tile .v-cnt  { position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-3); color: var(--text-soft); }

table.tbl.ledger td.dr { color: #ef4444; font-weight: 600; }
table.tbl.ledger td.cr { color: #10b981; font-weight: 600; }

/* ============================================================
   ENTERPRISE: AI INSIGHT CARDS
   ============================================================ */
.insight-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.insight-card {
  position: relative; padding: 18px 18px 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-soft);
  background: var(--panel); box-shadow: var(--shadow-xs);
  transition: all .18s ease; overflow: hidden;
}
.insight-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.insight-card.crit::before { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.insight-card.warn::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.insight-card.ok::before   { background: linear-gradient(180deg, #10b981, #047857); }
.insight-card.info::before { background: linear-gradient(180deg, #6366f1, #4338ca); }
.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 22px -8px var(--accent-soft);
}
.insight-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.insight-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: white;
}
.insight-card.crit .insight-icon { background: linear-gradient(160deg, #ef4444, #b91c1c); }
.insight-card.warn .insight-icon { background: linear-gradient(160deg, #f59e0b, #d97706); }
.insight-card.ok   .insight-icon { background: linear-gradient(160deg, #10b981, #047857); }
.insight-card.info .insight-icon { background: linear-gradient(160deg, #6366f1, #4338ca); }
.insight-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.insight-time  { font-size: 11px; color: var(--text-mute); margin-top: 2px; letter-spacing: 0.02em; text-transform: uppercase; }
.insight-body  { font-size: 13px; color: var(--text-soft); line-height: 1.55; margin-bottom: 12px; }
.insight-foot  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   ENTERPRISE: INVOICE LINE EDITOR
   ============================================================ */
.inv-lines { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.inv-line {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.9fr 0.6fr auto;
  gap: 8px; align-items: center;
}
.inv-line .input { padding: 9px 11px; font-size: 12.5px; }
.inv-line .rm-line {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: var(--panel-2);
  color: var(--text-mute); cursor: pointer; display: grid; place-items: center;
  transition: all .15s ease;
}
.inv-line .rm-line:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
[data-theme="dark"] .inv-line .rm-line:hover { background: rgba(239,68,68,0.15); }
.add-line-btn {
  margin-top: 4px; padding: 8px 14px; font-size: 12px; font-weight: 600;
  border: 1px dashed var(--border); background: transparent; color: var(--text-soft);
  border-radius: var(--r-sm); cursor: pointer; transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.add-line-btn:hover { border-color: var(--accent); color: var(--accent-3); background: var(--accent-soft); }
.inv-totals {
  margin-top: 14px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}
.inv-totals .row {
  display: flex; justify-content: space-between; padding: 4px 0;
  font-size: 13px; color: var(--text-soft);
}
.inv-totals .row.grand {
  margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border-soft);
  font-size: 15px; font-weight: 700; color: var(--text);
}
.inv-totals .row .v { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================================================
   PRINTABLE INVOICE
   ============================================================ */
.print-wrap {
  background: white; color: #111; font-family: 'Inter', sans-serif;
  padding: 32px 40px; max-width: 800px; margin: 0 auto;
  border: 1px solid #e5e7eb; border-radius: 8px;
}
.print-wrap .pi-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 18px;
}
.print-wrap .pi-brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.print-wrap .pi-brand-sub { font-size: 11px; color: #6b7280; margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.print-wrap .pi-meta { font-size: 11px; color: #6b7280; }
.print-wrap .pi-doc { font-size: 18px; font-weight: 700; text-align: right; }
.print-wrap .pi-num { font-size: 12px; color: #6b7280; margin-top: 2px; }
.print-wrap .pi-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0 22px; }
.print-wrap .pi-party-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; margin-bottom: 4px; font-weight: 700; }
.print-wrap .pi-party-name { font-size: 13.5px; font-weight: 700; }
.print-wrap .pi-party-line { font-size: 11.5px; color: #4b5563; margin-top: 1px; }
.print-wrap table.pi-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-wrap table.pi-tbl thead th { background: #f3f4f6; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; text-align: left; border-bottom: 1px solid #d1d5db; }
.print-wrap table.pi-tbl thead th.num { text-align: right; }
.print-wrap table.pi-tbl tbody td { padding: 10px; border-bottom: 1px solid #f3f4f6; }
.print-wrap table.pi-tbl tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.print-wrap .pi-totals { margin-top: 16px; display: flex; justify-content: flex-end; }
.print-wrap .pi-totals-tbl { min-width: 280px; font-size: 12.5px; }
.print-wrap .pi-totals-tbl .r { display: flex; justify-content: space-between; padding: 4px 0; }
.print-wrap .pi-totals-tbl .r.grand { font-weight: 800; font-size: 14.5px; padding-top: 8px; margin-top: 4px; border-top: 2px solid #111; }
.print-wrap .pi-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid #e5e7eb; font-size: 10.5px; color: #6b7280; line-height: 1.6; }
.print-wrap .pi-amount-words { margin-top: 12px; font-size: 11.5px; font-style: italic; color: #4b5563; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  margin-bottom: 14px;
}
.filter-bar .filter-label {
  font-size: 11px; font-weight: 700; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.filter-bar select.input, .filter-bar input.input {
  padding: 7px 10px; font-size: 12.5px; min-width: 140px;
}

/* ============================================================
   STATUS DOTS (paid/pending/overdue)
   ============================================================ */
.s-paid    { background: rgba(16,185,129,0.12); color: #047857; border: 1px solid rgba(16,185,129,0.25); }
.s-pending { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.25); }
.s-overdue { background: rgba(239,68,68,0.12); color: #b91c1c; border: 1px solid rgba(239,68,68,0.25); }
[data-theme="dark"] .s-paid    { color: #34d399; background: rgba(16,185,129,0.18); }
[data-theme="dark"] .s-pending { color: #fbbf24; background: rgba(245,158,11,0.18); }
[data-theme="dark"] .s-overdue { color: #f87171; background: rgba(239,68,68,0.18); }
.s-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
}
.s-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

@media (max-width: 900px) {
  .voucher-grid { grid-template-columns: 1fr 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .inv-line { grid-template-columns: 1fr 0.6fr 0.7fr 0.6fr auto; }
}

/* =============================================================
   LOGIN OVERLAY (Enterprise Demo Mode)
   ============================================================= */
#loginRoot { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
#loginRoot.show { pointer-events: auto; }
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 12% 10%, rgba(16,185,129,0.18), transparent 60%),
    radial-gradient(900px 500px at 88% 90%, rgba(99,102,241,0.16), transparent 60%),
    linear-gradient(135deg, #0c1116 0%, #11161d 50%, #1a2029 100%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .35s ease;
}
#loginRoot.show .login-bg { opacity: 1; }
.login-bg::before {
  content: ''; position: absolute; inset: 0; opacity: 0.04;
  background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 32px 32px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  width: 420px; max-width: calc(100vw - 32px);
  background: #ffffff; color: #0c1116;
  border-radius: 22px; padding: 40px 38px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.08) inset;
  transform: translateY(12px) scale(0.985); opacity: 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}
#loginRoot.show .login-card { transform: translateY(0) scale(1); opacity: 1; }
.login-brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(5,150,105,0.4);
}
.login-brand-mark svg { width: 22px; height: 22px; color: #fff; }
.login-brand-text .login-brand-name {
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: #0c1116;
}
.login-brand-text .login-brand-sub {
  font-size: 11.5px; font-weight: 600; color: #6b7280; letter-spacing: 0.06em; text-transform: uppercase;
}
.login-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: #0c1116; margin-bottom: 6px;
}
.login-tagline { font-size: 13.5px; color: #6b7280; margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-field label {
  display: block; font-size: 11.5px; font-weight: 600; color: #4b5563;
  margin-bottom: 7px; letter-spacing: 0.04em; text-transform: uppercase;
}
.login-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; background: #fafbfc;
  font-size: 14px; color: #0c1116; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-input:focus {
  border-color: #10b981; background: #ffffff;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
}
.login-input.shake { animation: shakeX .35s ease; border-color: #ef4444; }
@keyframes shakeX {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(3px); }
  30%,50%,70% { transform: translateX(-5px); }
  40%,60% { transform: translateX(5px); }
}
.login-submit {
  width: 100%; padding: 13px 18px; border-radius: 11px; border: none;
  background: linear-gradient(135deg, #0c1116 0%, #1f2937 100%);
  color: #ffffff; font-size: 14px; font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer; margin-top: 6px;
  transition: transform .12s ease, box-shadow .2s ease, opacity .15s ease;
  box-shadow: 0 8px 22px rgba(12,17,22,0.28);
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(12,17,22,0.36); }
.login-submit:active { transform: translateY(0); }
.login-tip {
  margin-top: 18px; padding: 10px 14px; border-radius: 9px;
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(99,102,241,0.06));
  border: 1px solid rgba(16,185,129,0.18);
  font-size: 12px; line-height: 1.45; color: #1f2937;
  display: flex; align-items: flex-start; gap: 10px;
}
.login-tip .tip-dot {
  flex: 0 0 6px;
  width: 6px; height: 6px; border-radius: 50%; background: #10b981; margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}
.login-foot {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid #f1f3f5;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: #9ca3af;
}
.login-foot .login-status { display: flex; align-items: center; gap: 6px; }
.login-foot .login-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}

/* Role chooser inside login card */
.role-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  max-height: 320px; overflow-y: auto; margin-bottom: 16px;
  padding: 4px; margin-left: -4px; margin-right: -4px;
}
.role-tile {
  padding: 12px 14px; border-radius: 10px; border: 1.5px solid #e5e7eb;
  background: #fafbfc; cursor: pointer; text-align: left;
  transition: all .15s ease; font-family: inherit;
}
.role-tile:hover { border-color: #10b981; background: #ffffff; transform: translateY(-1px); }
.role-tile.selected {
  border-color: #10b981; background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(99,102,241,0.06));
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.role-tile-name { font-size: 13px; font-weight: 700; color: #0c1116; margin-bottom: 2px; }
.role-tile-sub { font-size: 10.5px; color: #6b7280; letter-spacing: 0.03em; }
.login-back-btn {
  background: none; border: none; color: #6b7280; font-size: 12px;
  cursor: pointer; padding: 4px 0; margin-bottom: 10px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.login-back-btn:hover { color: #0c1116; }

/* =============================================================
   ROLE BADGE (top-right)
   ============================================================= */
.role-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(99,102,241,0.08));
  border: 1px solid var(--accent);
  font-size: 12px; font-weight: 600; color: var(--accent-3);
  cursor: pointer; transition: all .15s ease;
}
.role-badge:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,185,129,0.18); }
.role-badge .rb-label { opacity: 0.7; font-weight: 500; }
.role-badge .rb-name { font-weight: 700; }
.role-badge .rb-chev {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.6);
  display: inline-flex; align-items: center; justify-content: center;
}
.role-badge .rb-chev svg { width: 12px; height: 12px; }

.role-menu {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 220px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  z-index: 500; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: all .18s ease;
}
.role-menu.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.role-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  cursor: pointer; font-size: 13px; color: var(--text-1); font-family: inherit;
  text-align: left; font-weight: 500;
}
.role-menu-item:hover { background: var(--bg-soft); }
.role-menu-item.danger { color: #ef4444; }
.role-menu-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.role-menu-head {
  padding: 10px 12px 8px; font-size: 11px; font-weight: 700;
  color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase;
}
.role-badge-wrap { position: relative; z-index: 600; }

/* Hide nav items not allowed for current role */
.nav-item.role-hidden { display: none !important; }
.nav-section.role-hidden { display: none !important; }

/* =============================================================
   ENTERPRISE EXTENSION — Payment Gateway, Retailer, Customer,
   Notifications, Communication popups, Order timeline
   ============================================================= */

/* sidebar pill variants */
.nav-pill-amber { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .nav-pill-amber { background: #422006; color: #fbbf24; }

/* ----- Payment Gateway ----- */
.paygw-hero {
  display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-bottom: 22px;
}
.paygw-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff; border-radius: 18px; padding: 22px 24px; position: relative; overflow: hidden;
  box-shadow: 0 12px 32px rgba(15,23,42,0.18);
}
.paygw-hero-card::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(52,211,153,0.35) 0%, transparent 60%);
}
.paygw-hero-card .ph-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #94a3b8; }
.paygw-hero-card .ph-title { font-size: 24px; font-weight: 800; margin-top: 4px; }
.paygw-hero-card .ph-sub { color: #cbd5e1; margin-top: 4px; font-size: 13px; }
.paygw-hero-card .ph-stats { display: flex; gap: 22px; margin-top: 18px; position: relative; z-index: 2; }
.paygw-hero-card .ph-stat .v { font-size: 22px; font-weight: 800; }
.paygw-hero-card .ph-stat .k { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
/* ============================================================
   COMMERCE / PAYMENT GATEWAY — token aliases for newer modules
   These bridge the new design tokens (--surface-1, --text-1, --brand-500, etc.)
   to the existing base tokens so the new UI inherits the right colors in both themes.
   ============================================================ */
:root {
  --surface-1: var(--panel);
  --surface-2: var(--panel-2);
  --surface-3: var(--panel-3);
  --border-1: var(--border);
  --text-1: var(--text);
  --text-2: var(--text-2);
  --text-3: var(--text-mute);
  --brand-50: var(--accent-soft);
  --brand-100: var(--accent-tint);
  --brand-500: var(--accent);
  --brand-600: var(--accent-2);
  --brand-700: var(--accent-3);
}

.paygw-suggest {
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 18px; padding: 18px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.paygw-suggest .ps-head { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.paygw-suggest .ps-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.paygw-suggest .ps-row .i { width: 18px; height: 18px; color: var(--brand-600); }
.paygw-suggest .ps-row .ps-tip { font-size: 13px; color: var(--text-1); }

.pay-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.pay-card {
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 16px;
  padding: 16px; cursor: pointer; transition: all 0.2s ease;
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
  text-align: left;
}
.pay-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); border-color: var(--brand-500); }
.pay-card .pay-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-1);
}
.pay-card .pay-logo .i { width: 22px; height: 22px; }
.pay-card .pay-name { font-weight: 700; font-size: 14px; color: var(--text-1); }
.pay-card .pay-desc { font-size: 11px; color: var(--text-3); }
.pay-card.pay-preferred { border-color: var(--brand-500); }
.pay-card.pay-selected { border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(16,185,129,0.18), 0 6px 18px -6px rgba(16,185,129,0.35); transform: translateY(-2px); }
.pay-card .pay-preferred-pill {
  position: absolute; top: 10px; right: 10px; background: var(--brand-50); color: var(--brand-700);
  font-size: 9px; font-weight: 700; padding: 3px 7px; border-radius: 999px; letter-spacing: 0.05em; text-transform: uppercase;
}
[data-theme="dark"] .pay-card .pay-preferred-pill { background: rgba(52,211,153,0.15); color: #34d399; }
.pay-card[data-brand="upi"] .pay-logo { background: linear-gradient(135deg,#6c63ff,#3b82f6); color: white; }
.pay-card[data-brand="phonepe"] .pay-logo { background: #5f259f; color: white; }
.pay-card[data-brand="gpay"] .pay-logo { background: linear-gradient(135deg,#4285F4,#34A853); color: white; }
.pay-card[data-brand="paytm"] .pay-logo { background: #00BAF2; color: white; }
.pay-card[data-brand="visa"] .pay-logo { background: #1A1F71; color: #F7B600; font-weight: 800; font-size: 14px; }
.pay-card[data-brand="mastercard"] .pay-logo { background: linear-gradient(90deg,#EB001B 0%, #EB001B 50%, #F79E1B 50%, #F79E1B 100%); color: white; }
.pay-card[data-brand="rupay"] .pay-logo { background: linear-gradient(135deg,#097969,#0D8B5A); color: white; }
.pay-card[data-brand="netbanking"] .pay-logo { background: #1f2937; color: white; }
.pay-card[data-brand="bank"] .pay-logo { background: #0d9488; color: white; }
.pay-card[data-brand="cheque"] .pay-logo { background: #6b7280; color: white; }
.pay-card[data-brand="aeps"] .pay-logo { background: linear-gradient(135deg,#dc2626,#f59e0b); color: white; }
.pay-card[data-brand="wallet"] .pay-logo { background: linear-gradient(135deg,#7c3aed,#ec4899); color: white; }

.recent-tx-card {
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 16px; padding: 16px; margin-top: 18px;
}
.recent-tx-card h3 { font-size: 14px; margin: 0 0 10px; }
.tx-row {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--border-1);
}
.tx-row:last-child { border-bottom: none; }
.tx-row .tx-method-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.tx-row .tx-method-ic .i { width: 16px; height: 16px; }
.tx-row .tx-text .tx-meta { font-size: 11px; color: var(--text-3); }
.tx-row .tx-text .tx-method { font-weight: 600; font-size: 13px; color: var(--text-1); }
.tx-row .tx-amount { font-weight: 700; color: var(--text-1); }
.tx-row .tx-status { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.tx-status.ok { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .tx-status.ok { background: rgba(52,211,153,0.15); color: #34d399; }
.tx-status.fail { background: #fee2e2; color: #b91c1c; }

/* ----- Payment Modal ----- */
.pay-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  z-index: 9000; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.pay-modal-overlay.show { opacity: 1; pointer-events: auto; }
.pay-modal {
  width: min(440px, 92vw); background: var(--surface-1); border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.35); transform: translateY(8px) scale(0.98); transition: all 0.3s ease;
  border: 1px solid var(--border-1);
}
.pay-modal-overlay.show .pay-modal { transform: translateY(0) scale(1); }
.pay-modal-head {
  padding: 22px 24px 12px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border-1);
}
.pay-modal-head .pay-logo { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.pay-modal-head .pmh-text .pm-method { font-weight: 800; font-size: 17px; color: var(--text-1); }
.pay-modal-head .pmh-text .pm-merchant { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pay-modal-body { padding: 22px 24px; }
.pm-amount-row { text-align: center; margin: 4px 0 18px; }
.pm-amount-row .pm-amt-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; }
.pm-amount-row .pm-amt-value { font-size: 36px; font-weight: 800; color: var(--text-1); margin-top: 4px; }
.pm-detail-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; color: var(--text-2); border-bottom: 1px dashed var(--border-1); }
.pm-detail-row:last-child { border-bottom: none; }
.pm-detail-row b { color: var(--text-1); font-weight: 700; }
.pm-qr {
  width: 160px; height: 160px; margin: 12px auto; background: white; padding: 12px; border-radius: 14px;
  border: 1px solid var(--border-1); display: grid; place-items: center;
}
.pm-qr svg { width: 100%; height: 100%; }
.pm-actions { display: flex; gap: 10px; padding: 0 24px 22px; }
.pm-actions .btn { flex: 1; }
.pm-state {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 20px 20px;
}
.pm-spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid var(--surface-2); border-top-color: var(--brand-500);
  animation: pm-spin 0.9s linear infinite;
}
@keyframes pm-spin { to { transform: rotate(360deg); } }
.pm-state .pm-state-text { font-weight: 600; color: var(--text-1); }
.pm-state .pm-state-sub { font-size: 12px; color: var(--text-3); }

.pm-success-tick {
  width: 80px; height: 80px; border-radius: 50%; background: var(--brand-500);
  display: grid; place-items: center; color: white;
  animation: pm-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.pm-success-tick svg { width: 44px; height: 44px; stroke: white; stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pm-success-tick svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: pm-draw 0.5s 0.25s ease-out both; }
@keyframes pm-pop { 0% { transform: scale(0); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes pm-draw { to { stroke-dashoffset: 0; } }
.pm-success-text { font-size: 18px; font-weight: 800; color: var(--text-1); }
.pm-success-sub { color: var(--text-3); font-size: 13px; }

/* ----- Communication popups (bottom-right stack) ----- */
#commStack {
  position: fixed; right: 18px; bottom: 18px; z-index: 8500;
  display: flex; flex-direction: column-reverse; gap: 10px; max-width: 330px;
  pointer-events: none;
}
.comm-pop {
  pointer-events: auto;
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  overflow: hidden; opacity: 0; transform: translateX(40px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.comm-pop.in { opacity: 1; transform: translateX(0); }
.comm-pop.out { opacity: 0; transform: translateX(40px); }

/* Gmail-style email */
.comm-email .ce-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: linear-gradient(180deg,#fff,#fafbfc); border-bottom: 1px solid var(--border-1);
}
[data-theme="dark"] .comm-email .ce-head { background: var(--surface-2); }
.comm-email .ce-logo {
  width: 28px; height: 28px; border-radius: 50%; background: white;
  display: grid; place-items: center; box-shadow: 0 0 0 1px var(--border-1);
}
.comm-email .ce-logo svg { width: 18px; height: 18px; }
.comm-email .ce-app { font-weight: 700; font-size: 12px; color: #ea4335; letter-spacing: 0.04em; }
.comm-email .ce-time { margin-left: auto; font-size: 10px; color: var(--text-3); }
.comm-email .ce-body { padding: 12px; }
.comm-email .ce-from { display: flex; align-items: center; gap: 10px; }
.comm-email .ce-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-500); color: white;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.comm-email .ce-sender { font-weight: 700; font-size: 13px; color: var(--text-1); }
.comm-email .ce-addr { font-size: 11px; color: var(--text-3); }
.comm-email .ce-subject { font-weight: 600; font-size: 13px; color: var(--text-1); margin-top: 8px; }
.comm-email .ce-snippet { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.comm-email .ce-badge {
  display: inline-block; margin-top: 8px; background: #e8f0fe; color: #1a73e8;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em;
}
[data-theme="dark"] .comm-email .ce-badge { background: rgba(26,115,232,0.18); color: #8ab4f8; }

/* WhatsApp-style */
.comm-whatsapp { background: linear-gradient(180deg,#075e54,#075e54 36px, var(--surface-1) 36px); }
.comm-whatsapp .cw-head { padding: 8px 12px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; height: 36px; box-sizing: border-box; }
.comm-whatsapp .cw-head svg { width: 14px; height: 14px; stroke: #25d366; fill: #25d366; }
.comm-whatsapp .cw-bubble {
  margin: 12px 12px 12px; padding: 10px 12px; background: #dcf8c6; color: #111;
  border-radius: 10px 10px 10px 2px; font-size: 13px; max-width: 90%;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.comm-whatsapp .cw-bubble .cw-time { font-size: 10px; color: #555; text-align: right; margin-top: 4px; }
.comm-whatsapp .cw-bubble .cw-time .ticks { color: #4fc3f7; margin-left: 4px; font-weight: 700; }

/* SMS phone style */
.comm-sms { background: linear-gradient(180deg, #1c1c1e, #1c1c1e 28px, var(--surface-1) 28px); }
.comm-sms .cs-bar { color: #fff; padding: 6px 12px; font-size: 11px; font-weight: 600; height: 28px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; }
.comm-sms .cs-bubble {
  margin: 12px 12px; padding: 10px 12px; background: #007aff; color: #fff;
  border-radius: 16px 16px 4px 16px; font-size: 13px; max-width: 90%; align-self: flex-end;
}
.comm-sms .cs-meta { font-size: 10px; color: var(--text-3); margin: 0 12px 10px; text-align: right; }

/* ----- Notification panel (bell dropdown) ----- */
.notif-panel {
  position: fixed; top: 64px; right: 22px; width: 360px; max-height: 480px;
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22); overflow: hidden;
  display: flex; flex-direction: column; z-index: 9500;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: all 0.18s ease;
}
.notif-panel.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-panel-head { padding: 14px 16px; border-bottom: 1px solid var(--border-1); display: flex; justify-content: space-between; align-items: center; }
.notif-panel-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.notif-panel-head .np-clear { font-size: 11px; color: var(--brand-600); cursor: pointer; background: none; border: none; padding: 0; }
.notif-list { overflow-y: auto; max-height: 400px; }
.notif-item { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-1); cursor: default; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--brand-50); }
[data-theme="dark"] .notif-item.unread { background: rgba(52,211,153,0.06); }
.notif-item .ni-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.notif-item .ni-ic .i { width: 16px; height: 16px; }
.notif-item.kind-email .ni-ic { background: rgba(234,67,53,0.12); color: #ea4335; }
.notif-item.kind-whatsapp .ni-ic { background: rgba(37,211,102,0.16); color: #128c7e; }
.notif-item.kind-sms .ni-ic { background: rgba(0,122,255,0.12); color: #007aff; }
.notif-item .ni-title { font-weight: 600; font-size: 13px; color: var(--text-1); }
.notif-item .ni-body { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.notif-item .ni-time { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ----- Order timeline ----- */
.order-timeline { display: flex; align-items: center; gap: 0; margin: 16px 0; }
.order-timeline .ot-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative;
}
.order-timeline .ot-step .ot-dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--text-3);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; z-index: 2;
  border: 2px solid var(--border-1); transition: all 0.3s;
}
.order-timeline .ot-step .ot-dot .i { width: 16px; height: 16px; }
.order-timeline .ot-step .ot-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.order-timeline .ot-step.done .ot-dot { background: var(--brand-500); color: white; border-color: var(--brand-500); }
.order-timeline .ot-step.done .ot-label { color: var(--text-1); }
.order-timeline .ot-step.active .ot-dot { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-500); animation: ot-pulse 1.6s ease-in-out infinite; }
@keyframes ot-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--brand-500); } 50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
.order-timeline .ot-step + .ot-step::before {
  content: ''; position: absolute; left: -50%; top: 16px; right: 50%; height: 2px; background: var(--border-1); z-index: 1;
}
.order-timeline .ot-step.done + .ot-step::before { background: var(--brand-500); }

/* ----- Pending dues warning popup ----- */
.dues-warn {
  background: linear-gradient(135deg, #fef2f2, #fff1f2); border: 1px solid #fecaca;
  border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
[data-theme="dark"] .dues-warn { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); }
.dues-warn .dw-ic { width: 36px; height: 36px; border-radius: 10px; background: #fee2e2; color: #b91c1c; display: grid; place-items: center; flex-shrink: 0; }
[data-theme="dark"] .dues-warn .dw-ic { background: rgba(239,68,68,0.2); color: #fca5a5; }
.dues-warn .dw-ic .i { width: 18px; height: 18px; }
.dues-warn .dw-title { font-weight: 700; color: #991b1b; font-size: 14px; }
[data-theme="dark"] .dues-warn .dw-title { color: #fca5a5; }
.dues-warn .dw-amount { font-size: 22px; font-weight: 800; color: #991b1b; margin-top: 2px; }
[data-theme="dark"] .dues-warn .dw-amount { color: #fca5a5; }
.dues-warn .dw-tip { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* ----- Retailer / Customer storefronts ----- */
.shop-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 16px;
}
.shop-toolbar .st-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }
.shop-toolbar select, .shop-toolbar input {
  background: var(--surface-2); border: 1px solid var(--border-1); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--text-1);
}
.shop-toolbar .st-spacer { flex: 1; }
.shop-toolbar .st-cart-pill {
  display: flex; align-items: center; gap: 8px; background: var(--brand-50); color: var(--brand-700);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
[data-theme="dark"] .shop-toolbar .st-cart-pill { background: rgba(52,211,153,0.15); color: #34d399; }

.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.shop-card {
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; position: relative; transition: all 0.18s;
}
.shop-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.shop-card .sc-thumb {
  height: 90px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: grid; place-items: center; color: var(--brand-700); font-weight: 800; font-size: 22px;
  margin-bottom: 4px;
}
[data-theme="dark"] .shop-card .sc-thumb { background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(5,150,105,0.18)); color: #34d399; }
.shop-card .sc-name { font-weight: 700; font-size: 14px; color: var(--text-1); }
.shop-card .sc-meta { font-size: 11px; color: var(--text-3); }
.shop-card .sc-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.shop-card .sc-price { font-weight: 800; font-size: 18px; color: var(--text-1); }
.shop-card .sc-price-old { font-size: 12px; color: var(--text-3); text-decoration: line-through; }
.shop-card .sc-bulk-badge {
  position: absolute; top: 10px; left: 10px; background: linear-gradient(135deg,#f59e0b,#d97706); color: white;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em;
}
.shop-card .sc-stock {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.shop-card .sc-stock .dot { width: 6px; height: 6px; border-radius: 50%; }
.shop-card .sc-stock.high { background: var(--brand-50); color: var(--brand-700); }
.shop-card .sc-stock.high .dot { background: var(--brand-600); }
.shop-card .sc-stock.med { background: #fef3c7; color: #92400e; }
.shop-card .sc-stock.med .dot { background: #f59e0b; }
.shop-card .sc-stock.low { background: #fee2e2; color: #991b1b; }
.shop-card .sc-stock.low .dot { background: #dc2626; }
[data-theme="dark"] .shop-card .sc-stock.high { background: rgba(52,211,153,0.15); color: #34d399; }
[data-theme="dark"] .shop-card .sc-stock.med { background: rgba(245,158,11,0.18); color: #fbbf24; }
[data-theme="dark"] .shop-card .sc-stock.low { background: rgba(239,68,68,0.15); color: #fca5a5; }
.shop-card .sc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.shop-card .sc-actions input[type="number"] {
  width: 60px; background: var(--surface-2); border: 1px solid var(--border-1); border-radius: 8px; padding: 6px 8px; font-size: 13px; text-align: center; color: var(--text-1);
}
.shop-card .sc-actions .btn-mini {
  flex: 1; padding: 7px 10px; font-size: 12px; border-radius: 8px; background: var(--brand-500); color: white; border: none; cursor: pointer; font-weight: 600;
}
.shop-card .sc-actions .btn-mini:hover { background: var(--brand-600); }
.shop-card .sc-actions .btn-mini.added { background: var(--surface-2); color: var(--text-1); }

/* Order summary modal step body */
.order-step-modal .order-line {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--border-1); font-size: 13px;
}
.order-step-modal .order-line:last-child { border-bottom: none; }
.order-step-modal .order-line .ol-name { font-weight: 600; color: var(--text-1); }
.order-step-modal .order-line .ol-qty { font-size: 12px; color: var(--text-3); }
.order-step-modal .order-totals { padding-top: 12px; }
.order-step-modal .order-totals .ot-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--text-2); }
.order-step-modal .order-totals .ot-row.total { font-weight: 800; font-size: 16px; color: var(--text-1); padding-top: 8px; border-top: 1px solid var(--border-1); margin-top: 4px; }
.order-step-modal .order-totals .ot-row.discount { color: #047857; }
[data-theme="dark"] .order-step-modal .order-totals .ot-row.discount { color: #34d399; }

/* button press animation */
.btn-press, .pay-card { transition: transform 0.12s, box-shadow 0.18s, border-color 0.18s; }
.btn-press:active, .pay-card:active { transform: scale(0.97); }

/* =============================================================
   SMART GROUP LOGIN — entry tiles + subtype tiles
   ============================================================= */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 8px 0 14px;
}
.entry-tile {
  position: relative;
  text-align: left;
  padding: 16px 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  background: var(--panel, rgba(255,255,255,0.04));
  color: var(--text, inherit);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.2s;
  overflow: hidden;
}
.entry-tile::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, var(--glow, #10b981) 0%, transparent 55%);
  opacity: 0.10;
  pointer-events: none;
  transition: opacity 0.2s;
}
.entry-tile:hover {
  transform: translateY(-2px);
  border-color: var(--glow, #10b981);
  box-shadow: 0 12px 30px -12px rgba(16,185,129,0.35), 0 0 0 1px var(--glow, #10b981) inset;
}
.entry-tile:hover::before { opacity: 0.20; }
.entry-tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--glow, #10b981) 18%, transparent);
  color: var(--glow, #10b981);
  margin-bottom: 10px;
}
.entry-tile-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.entry-tile-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.entry-tile-sub { font-size: 11.5px; opacity: 0.62; margin-top: 3px; line-height: 1.35; }
.entry-tile-arrow {
  position: absolute; right: 12px; top: 14px;
  font-size: 16px; opacity: 0.35; transition: transform 0.2s, opacity 0.2s;
  color: var(--glow, #10b981);
}
.entry-tile:hover .entry-tile-arrow { opacity: 1; transform: translateX(4px); }

.subtype-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.subtype-tile {
  text-align: left; padding: 14px 12px;
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  border-radius: 12px; cursor: pointer;
  color: var(--text, inherit);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.subtype-tile:hover { transform: translateY(-2px); border-color: #10b981; box-shadow: 0 8px 20px -10px rgba(16,185,129,0.35); }
.subtype-icon { display:inline-flex; width:28px; height:28px; align-items:center; justify-content:center; border-radius:8px; background:rgba(16,185,129,0.12); color:#10b981; margin-bottom:8px; }
.subtype-icon svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2.2; }
.subtype-name { font-weight: 700; font-size: 14px; }
.subtype-sub { font-size: 11px; opacity: 0.6; margin-top: 2px; }

/* =============================================================
   PUBLIC PORTAL
   ============================================================= */
.portal-hero {
  position: relative;
  height: 380px;
  border-radius: 22px;
  overflow: hidden;
  margin: 14px 0 22px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.5);
}
.portal-hero-track { position: absolute; inset: 0; }
.portal-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.9s ease, transform 6s ease;
}
.portal-slide.active { opacity: 1; transform: scale(1.08); }
.portal-slide-inner {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 36px 44px;
  color: #fff;
  max-width: 760px;
}
.portal-slide-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.16); backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 14px;
}
.portal-slide-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px #10b981; }
.portal-slide-title { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 12px; text-shadow: 0 4px 18px rgba(0,0,0,0.35); }
.portal-slide-sub { font-size: 16px; opacity: 0.92; max-width: 580px; line-height: 1.5; margin: 0 0 20px; }
.portal-slide-cta { display: flex; gap: 10px; }
.portal-hero-dots {
  position: absolute; right: 24px; bottom: 24px; display: flex; gap: 8px; z-index: 3;
}
.portal-dot {
  width: 28px; height: 4px; border: 0; border-radius: 99px;
  background: rgba(255,255,255,0.32); cursor: pointer; transition: background 0.2s, width 0.2s;
}
.portal-dot.active { background: #fff; width: 44px; }
.portal-hero-badge {
  position: absolute; top: 18px; left: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}
.portal-hero-badge svg { width: 14px; height: 14px; }

.portal-quickbar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 26px;
}
.portal-qb-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  border-radius: 14px; padding: 14px 16px;
}
.portal-qb-item .i { display:inline-flex; width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.05)); align-items:center; justify-content:center; color:#10b981; }
.portal-qb-item .i svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; }
.qb-num { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.qb-lbl { font-size: 11px; opacity: 0.6; font-weight: 500; }

.portal-section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin: 30px 0 14px;
}
.portal-section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.portal-section-sub { font-size: 13px; opacity: 0.6; margin-top: 4px; }

.portal-prod-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.portal-prod {
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  border-radius: 16px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
}
.portal-prod:hover {
  transform: translateY(-4px);
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 18px 38px -18px rgba(16,185,129,0.4);
}
.portal-prod-img {
  position: relative;
  height: 170px;
  background-size: cover; background-position: center;
  background-color: #1a2228;
}
.portal-prod-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(16,185,129,0.92); color: #03110a;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.portal-prod-meta { padding: 12px 14px 14px; }
.portal-prod-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.portal-prod-sub { font-size: 12px; opacity: 0.6; margin-top: 3px; }
.portal-prod-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.portal-prod-price { font-size: 17px; font-weight: 800; color: #10b981; }
.portal-prod-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(16,185,129,0.12); color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.portal-prod-btn:hover { background: rgba(16,185,129,0.22); transform: scale(1.04); }
.portal-prod-btn svg { width: 12px; height: 12px; }

.portal-news-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.portal-news-card {
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s;
}
.portal-news-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(0,0,0,0.45); }
.portal-news-img {
  position: relative; height: 130px;
  background-size: cover; background-position: center;
  background-color: #1a2228;
}
.portal-news-cat {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--cat) 92%, #000);
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.portal-news-cat svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.portal-news-meta { padding: 12px 14px 14px; }
.portal-news-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; min-height: 56px; }
.portal-news-foot { font-size: 11px; opacity: 0.55; margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; }
.portal-news-foot svg { width: 12px; height: 12px; }

.portal-bottom-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 30px; }
.portal-panel {
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
  border-radius: 18px; padding: 18px;
}
.portal-panel-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.portal-panel-head svg { width: 18px; height: 18px; color: #10b981; fill: none; stroke: currentColor; stroke-width: 2; }
.portal-panel-pill {
  margin-left: auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(245,158,11,0.16); color: #f59e0b;
}
.portal-panel-pill.live { background: rgba(239,68,68,0.16); color: #ef4444; position: relative; padding-left: 16px; }
.portal-panel-pill.live::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #ef4444;
  box-shadow: 0 0 8px #ef4444; animation: portalPulse 1.4s infinite;
}
@keyframes portalPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.portal-movie-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.portal-movie { cursor: pointer; transition: transform 0.2s; }
.portal-movie:hover { transform: translateY(-3px); }
.portal-movie-img {
  position: relative; height: 150px; border-radius: 12px;
  background-size: cover; background-position: center;
  background-color: #1a2228;
  margin-bottom: 8px;
  overflow: hidden;
}
.portal-movie-rating {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.65); color: #fbbf24;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.portal-movie-rating svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.portal-movie-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.18); opacity: 0; transition: opacity 0.25s;
}
.portal-movie:hover .portal-movie-play { opacity: 1; }
.portal-movie-play svg { width: 36px; height: 36px; color: #fff; fill: #fff; stroke: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }
.portal-movie-name { font-size: 13px; font-weight: 600; }
.portal-movie-genre { font-size: 11px; opacity: 0.55; margin-top: 2px; }

.portal-mkt { display: flex; flex-direction: column; gap: 4px; }
.portal-mkt-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 10px;
  transition: background 0.2s;
}
.portal-mkt-row:hover { background: rgba(16,185,129,0.06); }
.portal-mkt-sym { font-size: 13px; font-weight: 600; }
.portal-mkt-sym span { font-size: 10px; opacity: 0.5; margin-left: 4px; }
.portal-mkt-price { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.portal-mkt-change { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.portal-mkt-change svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.portal-mkt-change.up { color: #10b981; }
.portal-mkt-change.down { color: #ef4444; }

.portal-foot {
  margin-top: 32px; padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(120,140,170,0.16));
  border-radius: 18px;
}
.portal-foot-brand { display: flex; align-items: center; gap: 12px; }
.portal-foot-brand .brand-mark-glyph { width: 36px; height: 36px; }
.portal-foot-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.portal-foot-sub { font-size: 12px; opacity: 0.6; }
.portal-foot-meta { font-size: 11px; opacity: 0.5; }

@media (max-width: 1100px) {
  .portal-prod-grid, .portal-news-grid, .portal-movie-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-quickbar { grid-template-columns: repeat(2, 1fr); }
  .portal-bottom-row { grid-template-columns: 1fr; }
  .portal-slide-title { font-size: 28px; }
  .portal-hero { height: 320px; }
}

/* =============================================================
   OFFICE AUTOMATION — KPIs, segmented tabs, alert cards, CCTV
   ============================================================= */
.ofc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 18px; }
.ofc-kpi {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 16px;
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.18));
}
.ofc-kpi-icon { width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c, #10b981) 18%, transparent);
  color: var(--c, #10b981);
}
.ofc-kpi-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.ofc-kpi-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.ofc-kpi-lbl { font-size: 11px; opacity: 0.55; font-weight: 500; }

.seg-bar {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.16));
  border-radius: 14px; margin-bottom: 18px;
}
.seg-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  background: transparent; border: 0;
  color: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.18s, color 0.18s;
}
.seg-btn:hover { background: rgba(120,140,170,0.08); }
.seg-btn.active { background: linear-gradient(135deg, #10b981, #059669); color: #04110a; }
.seg-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.seg-btn .seg-pill { font-size: 9px; font-weight: 800; letter-spacing: 0.07em;
  padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,0.18); }
.seg-btn.active .seg-pill { background: rgba(0,0,0,0.25); color: #04110a; }

.ofc-alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.ofc-alert {
  position: relative;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,140,170,0.16));
  border-left: 4px solid var(--sev);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ofc-alert:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--sev) 60%, transparent); }
.ofc-alert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ofc-alert-icon { width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--sev) 16%, transparent); color: var(--sev);
  display: inline-flex; align-items: center; justify-content: center; }
.ofc-alert-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.ofc-alert-sev { font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--sev) 18%, transparent);
  color: var(--sev); }
.ofc-alert-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.ofc-alert-meta { font-size: 11.5px; opacity: 0.55; margin-top: 2px; }
.ofc-alert-body { font-size: 12.5px; opacity: 0.78; margin-top: 10px; line-height: 1.5; }
.ofc-alert-cta { display: flex; gap: 8px; margin-top: 14px; }
.ofc-alert-cta .btn { font-size: 12px; padding: 7px 12px; }

/* CCTV grid + tile simulation */
.cctv-shell {
  background: linear-gradient(180deg, #060a10 0%, #02060a 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 60px -32px rgba(0,0,0,0.6);
}
.cctv-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(20,30,40,0.95), rgba(10,16,22,0.95));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #d1d5db;
  font-size: 12px;
}
.cctv-bar-left { display: flex; align-items: center; gap: 10px; }
.cctv-rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 12px #ef4444;
  animation: cctvBlink 1.2s infinite;
}
.cctv-bar-title { font-weight: 800; letter-spacing: 0.16em; font-size: 11.5px; }
.cctv-bar-right { display: flex; gap: 8px; align-items: center; }
.cctv-bar-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
}
.cctv-bar-pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
@keyframes cctvBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.cctv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
  padding: 4px;
  background: #02060a;
}
.cctv-tile {
  position: relative;
  aspect-ratio: 16/10;
  background: #050a10;
  overflow: hidden;
  cursor: pointer;
  transition: outline 0.15s, transform 0.15s;
  outline: 1px solid rgba(255,255,255,0.04);
}
.cctv-tile:hover { outline: 2px solid #10b981; z-index: 2; transform: scale(1.005); }
/* Optional real-video layer — sits above the animated CSS feed.
   When a video is mounted+loaded, .cctv-has-vid hides the synthetic noise/scan
   so the real footage takes over. Falls back to CSS feed when no file exists. */
.cctv-vid-slot { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cctv-vid {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.cctv-has-vid .cctv-noise,
.cctv-has-vid .cctv-pan { display: none; }
.cctv-has-vid .cctv-scan { opacity: 0.4; }

/* 6 distinct camera "skins" using animated gradients */
.cctv-skin-0 { background: linear-gradient(135deg, #102818 0%, #0a1812 50%, #061008 100%); }
.cctv-skin-1 { background: linear-gradient(135deg, #1a1426 0%, #100c18 50%, #06040b 100%); }
.cctv-skin-2 { background: linear-gradient(135deg, #0f1e2a 0%, #08141d 50%, #040a10 100%); }
.cctv-skin-3 { background: linear-gradient(135deg, #2a1a10 0%, #1a100a 50%, #0d0805 100%); }
.cctv-skin-4 { background: linear-gradient(135deg, #1a2a14 0%, #0f1a0c 50%, #060d05 100%); }
.cctv-skin-5 { background: linear-gradient(135deg, #2a1422 0%, #1a0c16 50%, #0d050b 100%); }

.cctv-pan {
  position: absolute; inset: 0;
  background: radial-gradient(50% 80% at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%),
              radial-gradient(40% 60% at 70% 70%, rgba(120,180,200,0.05) 0%, transparent 70%);
  animation: cctvPan 14s linear infinite;
}
@keyframes cctvPan {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-8px, 4px); }
  50%  { transform: translate(6px, -3px); }
  75%  { transform: translate(-4px, 6px); }
  100% { transform: translate(0, 0); }
}
.cctv-noise {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.6  0 0 0 0 0.65  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 140px;
  animation: cctvNoise 0.18s steps(4) infinite;
  mix-blend-mode: screen;
}
@keyframes cctvNoise {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-6px, 4px); }
  50%  { transform: translate(4px, -3px); }
  75%  { transform: translate(-3px, 5px); }
  100% { transform: translate(2px, -2px); }
}
.cctv-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 100%;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px,
    transparent 1px, transparent 3px);
  pointer-events: none;
  mix-blend-mode: overlay;
}
.cctv-scan::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 30%;
  background: linear-gradient(180deg, transparent 0%, rgba(120,180,200,0.06) 50%, transparent 100%);
  animation: cctvSweep 5.4s linear infinite;
}
@keyframes cctvSweep {
  0% { transform: translateY(-30%); }
  100% { transform: translateY(330%); }
}
.cctv-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(110% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.cctv-overlay-tl, .cctv-overlay-tr, .cctv-overlay-bl, .cctv-overlay-br {
  position: absolute; z-index: 5;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px; color: #f1f5f9;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85);
  pointer-events: none;
}
.cctv-overlay-tl { top: 6px; left: 6px; display: flex; gap: 4px; }
.cctv-overlay-tr { top: 6px; right: 6px; }
.cctv-overlay-bl { bottom: 6px; left: 6px; right: 70px; overflow: hidden; }
.cctv-overlay-bl .cctv-cam-label {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cctv-overlay-br { bottom: 6px; right: 6px; font-variant-numeric: tabular-nums; opacity: 0.92; }

.cctv-live, .cctv-rec {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 3px;
  font-weight: 800; font-size: 9px; letter-spacing: 0.08em;
}
.cctv-live { background: rgba(16,185,129,0.85); color: #03110a; }
.cctv-live-dot { width: 5px; height: 5px; border-radius: 50%; background: #03110a; animation: cctvBlink 1s infinite; }
.cctv-rec { background: rgba(239,68,68,0.85); color: #fff; }
.cctv-rec-blink { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: cctvBlink 0.9s infinite; }
.cctv-cam-id { background: rgba(0,0,0,0.55); padding: 2px 6px; border-radius: 3px; font-weight: 800; }
.cctv-cam-label {
  background: rgba(0,0,0,0.55); padding: 3px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  display: inline-block;
}

.cctv-ticker {
  background: linear-gradient(180deg, rgba(10,16,22,0.96), rgba(4,8,12,0.96));
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 9px 0;
  overflow: hidden; position: relative;
}
.cctv-ticker-inner {
  display: inline-block; white-space: nowrap;
  color: #94a3b8; font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  animation: cctvTicker 50s linear infinite;
  padding-left: 100%;
}
@keyframes cctvTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.cctv-modal { background: #02060a; }

/* sidebar pill - red variant for REC indicator */
.nav-pill-red { background: rgba(239,68,68,0.16) !important; color: #ef4444 !important; }
.nav-pill-red::before {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #ef4444; margin-right: 4px; vertical-align: middle;
  box-shadow: 0 0 6px #ef4444;
  animation: cctvBlink 1.2s infinite;
}

@media (max-width: 1100px) {
  .ofc-kpis { grid-template-columns: repeat(2, 1fr); }
  .cctv-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   V5 — Mobile / Paperless / Predictive / Executive / Auto-Automation /
   Payment Realism / Smart Alerts / Glass polish — ALL ADDITIVE
   ========================================================================== */

/* ---- Mobile View toggle ---- */
#app.mobile-mode {
  background: radial-gradient(ellipse at top, #0f172a 0%, #020617 100%);
  min-height: 100vh; padding: 28px 0; display: block;
}
#app.mobile-mode > .sidebar { display: none; }
#app.mobile-mode > .main {
  width: 402px; max-width: calc(100vw - 24px); margin: 0 auto;
  border-radius: 44px; overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 12px #0a0e16, 0 0 0 14px #1f2937, 0 30px 80px rgba(0,0,0,.6);
  position: relative; height: calc(100vh - 56px);
  display: flex; flex-direction: column;
}
#app.mobile-mode > .main::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 130px; height: 28px; background: #0a0e16;
  border-bottom-left-radius: 18px; border-bottom-right-radius: 18px; z-index: 100;
}
#app.mobile-mode > .main::after {
  content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 4px; background: #fff; border-radius: 4px; opacity: .25; z-index: 100;
}
#app.mobile-mode .topbar { padding-top: 30px; }
#app.mobile-mode .topbar .search { display: none; }
#app.mobile-mode .topbar-actions { width: 100%; justify-content: space-between; }
#app.mobile-mode .page-frame { padding: 12px; overflow-y: auto; flex: 1; }
#app.mobile-mode .kpi-grid,
#app.mobile-mode .ofc-kpis,
#app.mobile-mode .predict-grid,
#app.mobile-mode .cxo-grid { grid-template-columns: 1fr 1fr !important; }
#app.mobile-mode .chart-row,
#app.mobile-mode .chart-row-2 { grid-template-columns: 1fr !important; }
#app.mobile-mode .cctv-grid { grid-template-columns: 1fr 1fr !important; }
.mobile-bottom-bar { display: none; }
#app.mobile-mode .mobile-bottom-bar {
  display: flex; gap: 4px; justify-content: space-around;
  padding: 8px 12px 24px; background: var(--surface);
  border-top: 1px solid var(--border);
}
.mobile-bottom-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: 10px; cursor: pointer;
  border-radius: 10px; text-decoration: none;
}
.mobile-bottom-bar a.active { color: var(--accent); background: rgba(99,102,241,.08); }
.mobile-bottom-bar a .i { width: 20px; height: 20px; }
.mobile-toggle-btn.active { background: var(--accent) !important; color: #fff !important; }

/* ---- Paperless Office tab ---- */
.paper-banner {
  margin: 16px 0; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(99,102,241,.10));
  border: 1px solid rgba(16,185,129,.25);
  display: flex; align-items: center; gap: 14px;
}
.paper-banner .pb-ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg,#10b981,#059669); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(16,185,129,.35);
}
.paper-banner .pb-ico .i { width: 22px; height: 22px; }
.paper-banner .pb-text { flex: 1; }
.paper-banner .pb-title { font-size: 14px; font-weight: 700; color: var(--text); }
.paper-banner .pb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.paper-banner .pb-stat { font-size: 22px; font-weight: 800; color: #10b981; }

.paper-pipeline {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin: 16px 0; padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  position: relative;
}
.paper-stage {
  text-align: center; padding: 12px 8px; border-radius: 12px;
  background: rgba(99,102,241,.05); border: 1px dashed var(--border);
  position: relative;
}
.paper-stage-icon {
  width: 38px; height: 38px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.paper-stage-icon .i { width: 18px; height: 18px; }
.paper-stage-name { font-size: 12px; font-weight: 700; color: var(--text); }
.paper-stage-count { font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.paper-stage-sub { font-size: 10px; color: var(--muted); }
.paper-stage::after {
  content: '\2192'; position: absolute; right: -10px; top: 28px;
  color: var(--muted); font-weight: 700; font-size: 14px;
}
.paper-stage:last-child::after { display: none; }

.paper-doc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.paper-doc {
  display: grid; grid-template-columns: 36px 1fr auto auto auto; gap: 12px;
  align-items: center; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all .25s ease;
}
.paper-doc:hover { transform: translateX(4px); border-color: var(--accent); }
.paper-doc-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.paper-doc-icon[data-ext="pdf"] { background: #dc2626; }
.paper-doc-icon[data-ext="xlsx"] { background: #16a34a; }
.paper-doc-icon[data-ext="docx"] { background: #2563eb; }
.paper-doc-icon[data-ext="png"], .paper-doc-icon[data-ext="jpg"] { background: #7c3aed; }
.paper-doc-name { font-weight: 600; font-size: 13px; color: var(--text); }
.paper-doc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.paper-doc-stage {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(99,102,241,.12); color: var(--accent);
}
.paper-doc-stage[data-stage="upload"] { background: rgba(245,158,11,.14); color: #f59e0b; }
.paper-doc-stage[data-stage="review"] { background: rgba(6,182,212,.14); color: #06b6d4; }
.paper-doc-stage[data-stage="approval"] { background: rgba(168,85,247,.14); color: #a855f7; }
.paper-doc-stage[data-stage="signed"] { background: rgba(16,185,129,.14); color: #10b981; }
.paper-doc-stage[data-stage="done"] { background: rgba(34,197,94,.18); color: #22c55e; }
.paper-doc-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.paper-doc-actor {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.paper-sig-strip {
  margin-top: 16px; padding: 14px 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.paper-sig-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.paper-sig-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); }
.paper-sig-item .pi-av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.paper-sig-item .pi-name { font-size: 12px; font-weight: 600; color: var(--text); }
.paper-sig-item .pi-tick { color: #10b981; }
.paper-sig-item .pi-tick .i { width: 14px; height: 14px; }
.paper-doc.flow-anim { animation: paperFlow 1.2s ease; }
@keyframes paperFlow {
  0% { transform: translateX(-30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ---- Predictive AI cards ---- */
.predict-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 14px; margin: 16px 0;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(168,85,247,.10));
  border: 1px solid rgba(99,102,241,.30);
}
.predict-banner .pb-orb {
  width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(from 0deg, #6366f1, #a855f7, #ec4899, #6366f1);
  animation: spinOrb 6s linear infinite;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.predict-banner .pb-orb .i { width: 22px; height: 22px; filter: drop-shadow(0 0 8px #fff); }
@keyframes spinOrb { to { transform: rotate(360deg); } }
.predict-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 16px 0;
}
.predict-card {
  position: relative; padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; transition: transform .25s ease;
}
.predict-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 16px; pointer-events: none;
  background: linear-gradient(135deg, rgba(99,102,241,.06), transparent 60%);
}
.predict-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.predict-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; position: relative; z-index: 1; }
.predict-card-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(99,102,241,.06));
  color: var(--accent);
}
.predict-card-icon .i { width: 20px; height: 20px; }
.predict-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.predict-card-sub { font-size: 11px; color: var(--muted); }
.predict-card-body { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 12px; position: relative; z-index: 1; }
.predict-card-body strong { color: var(--accent); }
.predict-card-foot { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.predict-conf { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.predict-conf[data-c="high"] { background: rgba(16,185,129,.16); color: #10b981; }
.predict-conf[data-c="med"] { background: rgba(245,158,11,.16); color: #f59e0b; }
.predict-conf[data-c="low"] { background: rgba(107,114,128,.16); color: #94a3b8; }
.predict-card-spark { display: flex; align-items: end; gap: 2px; height: 24px; }
.predict-card-spark span { width: 4px; background: var(--accent); border-radius: 2px; opacity: .6; display: inline-block; }

/* ---- Auto-Automation triggers ---- */
.auto-engine-card {
  margin: 16px 0; padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.auto-engine-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.auto-engine-pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.7);
  animation: enginePulse 1.6s infinite;
}
@keyframes enginePulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.7); }
  70% { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.auto-trigger-list { display: flex; flex-direction: column; gap: 8px; }
.auto-trigger {
  display: grid; grid-template-columns: 28px 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(99,102,241,.04); border: 1px solid var(--border);
}
.auto-trigger.fired { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.25); }
.auto-trigger-num { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.auto-trigger-rule { font-size: 13px; font-weight: 600; color: var(--text); }
.auto-trigger-action { font-size: 11px; color: var(--muted); margin-top: 2px; }
.auto-trigger-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.auto-trigger-status { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(16,185,129,.14); color: #10b981; font-weight: 700; }

/* ---- Executive Command Dashboard ---- */
.cxo-hero {
  padding: 24px; border-radius: 18px; margin-bottom: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #6366f1 200%);
  color: #fff; position: relative; overflow: hidden;
}
.cxo-hero::after {
  content: ''; position: absolute; top: -40%; right: -10%; width: 400px; height: 400px;
  border-radius: 50%; background: radial-gradient(circle, rgba(168,85,247,.35), transparent 70%);
  pointer-events: none;
}
.cxo-hero-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; position: relative; z-index: 1; }
.cxo-hero-sub { opacity: .85; font-size: 13px; position: relative; z-index: 1; }
.cxo-hero-stamp {
  position: absolute; right: 24px; top: 24px; z-index: 1;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  display: flex; align-items: center; gap: 8px;
}
.cxo-hero-stamp::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: enginePulse 1.6s infinite;
}
.cxo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.cxo-tile {
  padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.cxo-tile::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--c, var(--accent));
}
.cxo-tile-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.cxo-tile-value { font-size: 26px; font-weight: 800; color: var(--text); margin: 6px 0 4px; }
.cxo-tile-delta { font-size: 12px; font-weight: 600; }
.cxo-tile-delta.up { color: #10b981; }
.cxo-tile-delta.down { color: #ef4444; }
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 18px; }
.chart-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.chart-card {
  padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.chart-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.chart-card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.chart-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chart-mini { width: 100%; height: 200px; display: block; }

/* ---- Smart alerts upgrade ---- */
.smart-alert-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0;
}
.smart-alert {
  padding: 14px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--c, var(--accent));
}
.smart-alert .sa-ico {
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--c, var(--accent));
  background: rgba(99,102,241,.10);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.smart-alert .sa-ico .i { width: 18px; height: 18px; }
.smart-alert.critical { --c: #ef4444; }
.smart-alert.critical .sa-ico { background: rgba(239,68,68,.14); }
.smart-alert.warning  { --c: #f59e0b; }
.smart-alert.warning .sa-ico { background: rgba(245,158,11,.14); }
.smart-alert.info     { --c: #06b6d4; }
.smart-alert.info .sa-ico { background: rgba(6,182,212,.14); }
.smart-alert.success  { --c: #10b981; }
.smart-alert.success .sa-ico { background: rgba(16,185,129,.14); }
.smart-alert .sa-title { font-size: 13px; font-weight: 700; color: var(--text); }
.smart-alert .sa-body { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ---- Glass polish (additive — opt in via class) ---- */
.glass-card {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

/* ---- Payment realism: form fields inside pay modal ---- */
.pay-form-block {
  margin: 14px 0; padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.pay-form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pay-form-row.dual { grid-template-columns: 1fr 1fr; }
.pay-form-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.pay-form-input, .pay-form-select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-family: inherit; box-sizing: border-box;
}
.pay-form-input:focus, .pay-form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.10); }
.pay-form-otp { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.pay-form-otp input { width: 40px; height: 46px; text-align: center; font-size: 18px; font-weight: 700; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0; }
.pay-form-otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.pay-bank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.pay-bank { padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: center; transition: all .2s; }
.pay-bank:hover { border-color: var(--accent); transform: translateY(-2px); }
.pay-bank.sel { border-color: var(--accent); background: rgba(99,102,241,.10); box-shadow: 0 0 0 2px rgba(99,102,241,.18); }
.pay-bank-name { font-size: 11px; font-weight: 700; color: var(--text); }
.pay-bank-logo { width: 30px; height: 30px; border-radius: 6px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; }
.pay-vpa-verified { font-size: 11px; color: #10b981; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.pay-vpa-verified .i { width: 14px; height: 14px; }
.pay-card-preview {
  margin: 12px 0; padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, #1f2937, #111827);
  color: #fff; font-family: monospace;
}
.pay-card-num { font-size: 18px; letter-spacing: 3px; margin: 16px 0 12px; }
.pay-card-row { display: flex; justify-content: space-between; font-size: 11px; opacity: .8; }

@media (max-width: 1100px) {
  .predict-grid, .cxo-grid { grid-template-columns: 1fr 1fr; }
  .chart-row, .chart-row-2 { grid-template-columns: 1fr; }
  .paper-pipeline { grid-template-columns: 1fr 1fr; gap: 14px; }
  .paper-stage::after { display: none; }
  .smart-alert-strip { grid-template-columns: 1fr; }
}


/* ==========================================================================
   V6 — Communication Hub / Doc Preview / SaaS Platform / Store Badges
   PURELY ADDITIVE — no existing selector overridden.
   ========================================================================== */

/* ---------- Communication Hub ---------- */
.comm-banner {
  display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-radius: 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(168,85,247,.10));
  border: 1px solid rgba(99,102,241,.30);
}
.comm-banner .cb-ico {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg,#6366f1,#a855f7); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(99,102,241,.4);
}
.comm-banner .cb-ico .i { width: 24px; height: 24px; }
.comm-banner .cb-title { font-size: 16px; font-weight: 800; color: var(--text); }
.comm-banner .cb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.comm-banner .cb-stat { margin-left: auto; text-align: center; padding: 0 14px; }
.comm-banner .cb-stat-num { font-size: 22px; font-weight: 800; color: var(--accent); }
.comm-banner .cb-stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.comm-section { margin-top: 18px; }
.comm-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.comm-section-head .csh-ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(99,102,241,.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.comm-section-head .csh-ico .i { width: 16px; height: 16px; }
.comm-section-head .csh-title { font-size: 14px; font-weight: 800; color: var(--text); }
.comm-section-head .csh-sub { font-size: 11px; color: var(--muted); }

.comm-app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.comm-app-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: 14px; cursor: pointer; transition: all .25s ease;
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.comm-app-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 36px rgba(0,0,0,.18); }
.comm-app-card .cac-logo {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.comm-app-card[data-app="gmail"] .cac-logo { background: linear-gradient(135deg,#ea4335,#fbbc05); }
.comm-app-card[data-app="outlook"] .cac-logo { background: linear-gradient(135deg,#0078d4,#005a9e); }
.comm-app-card[data-app="whatsapp"] .cac-logo { background: linear-gradient(135deg,#25d366,#128c7e); }
.comm-app-card[data-app="telegram"] .cac-logo { background: linear-gradient(135deg,#229ed9,#0088cc); }
.comm-app-card[data-app="sms-android"] .cac-logo { background: linear-gradient(135deg,#3ddc84,#0f9d58); }
.comm-app-card[data-app="sms-ios"] .cac-logo { background: linear-gradient(135deg,#34c759,#1e8a3a); }
.cac-name { font-size: 15px; font-weight: 800; color: var(--text); }
.cac-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cac-pill { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(16,185,129,.14); color: #10b981; }
.cac-arrow { margin-left: auto; color: var(--muted); }
.cac-arrow .i { width: 18px; height: 18px; }
.cac-unread {
  position: absolute; top: 12px; right: 12px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 999px; padding: 3px 8px;
}

/* ---------- Comm popup modal (shared frame) ---------- */
.comm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99000;
}
.comm-modal-overlay.show { opacity: 1; pointer-events: auto; }
.comm-modal {
  background: var(--surface); border-radius: 18px; max-width: 920px; width: 92%;
  max-height: 84vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  transform: scale(.96); transition: transform .25s;
}
.comm-modal-overlay.show .comm-modal { transform: scale(1); }
.comm-modal-head {
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.comm-modal-head .cmh-logo {
  width: 32px; height: 32px; border-radius: 9px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.comm-modal-head .cmh-title { font-weight: 800; color: var(--text); font-size: 15px; }
.comm-modal-head .cmh-sub { font-size: 11px; color: var(--muted); }
.comm-modal-head .cmh-close {
  margin-left: auto; cursor: pointer; padding: 6px; border-radius: 8px;
  color: var(--muted); transition: background .2s;
}
.comm-modal-head .cmh-close:hover { background: rgba(127,127,127,.12); color: var(--text); }
.comm-modal-body { flex: 1; overflow: auto; }

/* ---------- Gmail / Outlook inbox mockup ---------- */
.email-app { display: grid; grid-template-columns: 200px 1fr 1.4fr; height: 540px; max-height: 70vh; background: var(--bg); }
.email-app.outlook { background: #faf9f8; color: #201f1e; }
.email-side {
  background: var(--surface-2); padding: 14px 8px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.email-app.outlook .email-side { background: #f3f2f1; border-right-color: #e1dfdd; }
.email-compose-btn {
  margin: 0 6px 12px; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg,#1a73e8,#1967d2); color: #fff;
  border: none; font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: center;
}
.email-app.outlook .email-compose-btn { background: #0078d4; border-radius: 4px; }
.email-side-item {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.email-app.outlook .email-side-item { color: #201f1e; border-radius: 4px; }
.email-side-item:hover { background: rgba(26,115,232,.08); }
.email-side-item.active { background: rgba(26,115,232,.18); font-weight: 700; }
.email-side-item .i { width: 16px; height: 16px; }
.email-side-item .badge { margin-left: auto; font-size: 11px; color: var(--muted); }

.email-list { background: var(--bg); border-right: 1px solid var(--border); overflow-y: auto; }
.email-app.outlook .email-list { background: #ffffff; border-right-color: #e1dfdd; }
.email-row { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: flex-start; }
.email-app.outlook .email-row { border-bottom-color: #f3f2f1; }
.email-row.unread { background: rgba(26,115,232,.04); font-weight: 600; }
.email-row.active { background: rgba(26,115,232,.10); }
.email-app.outlook .email-row.active { background: #cce4f7; }
.email-row:hover { background: rgba(26,115,232,.06); }
.email-row .er-av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.email-row .er-from { font-size: 13px; color: var(--text); }
.email-app.outlook .email-row .er-from { color: #201f1e; }
.email-row .er-subj { font-size: 12px; color: var(--text); margin-top: 2px; line-height: 1.3; }
.email-row .er-snip { font-size: 11px; color: var(--muted); margin-top: 2px; }
.email-row .er-time { float: right; font-size: 10px; color: var(--muted); font-weight: 400; }
.email-view { padding: 18px 22px; overflow-y: auto; background: var(--bg); }
.email-app.outlook .email-view { background: #fff; }
.email-view-subj { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.email-app.outlook .email-view-subj { color: #201f1e; }
.email-view-meta { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.email-app.outlook .email-view-meta { border-bottom-color: #f3f2f1; }
.email-view-meta .er-av { width: 36px; height: 36px; }
.email-view-from { font-size: 13px; font-weight: 700; color: var(--text); }
.email-view-to { font-size: 11px; color: var(--muted); }
.email-view-body { font-size: 14px; line-height: 1.7; color: var(--text); }
.email-app.outlook .email-view-body { color: #201f1e; }

/* ---------- Phone frame for chat/sms ---------- */
.phone-frame { width: 320px; height: 600px; max-height: 70vh; margin: 16px auto; background: #000; border-radius: 38px; padding: 12px 8px; box-shadow: 0 0 0 4px #1f2937, 0 24px 60px rgba(0,0,0,.5); position: relative; }
.phone-frame.android { border-radius: 28px; padding: 8px; box-shadow: 0 0 0 3px #1f2937, 0 24px 60px rgba(0,0,0,.5); }
.phone-frame.ios::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #000; border-radius: 14px; z-index: 10; }
.phone-screen { width: 100%; height: 100%; border-radius: 28px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.phone-frame.android .phone-screen { border-radius: 22px; }
.phone-statusbar { padding: 6px 18px; font-size: 10px; display: flex; justify-content: space-between; align-items: center; }
.phone-frame.ios .phone-statusbar { padding: 30px 22px 4px; color: #000; font-weight: 600; }
.phone-frame.android .phone-statusbar { background: linear-gradient(180deg,rgba(0,0,0,.04),transparent); color: #5f6368; }

/* WhatsApp */
.wa-app { background: #ECE5DD; flex: 1; display: flex; flex-direction: column; }
.wa-head { background: #075E54; color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.wa-head .wa-av { width: 32px; height: 32px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.wa-head .wa-name { font-weight: 700; font-size: 14px; }
.wa-head .wa-status { font-size: 10px; opacity: .8; }
.wa-msgs { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; background-image: linear-gradient(135deg,#dde6df,#ECE5DD); }
.wa-msg { max-width: 78%; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.3; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-msg.them { background: #fff; align-self: flex-start; border-top-left-radius: 0; }
.wa-msg.me { background: #DCF8C6; align-self: flex-end; border-top-right-radius: 0; }
.wa-msg .wa-time { font-size: 9px; color: #667781; margin-left: 6px; float: right; margin-top: 4px; }
.wa-input { background: #f0f0f0; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.wa-input input { flex: 1; padding: 8px 12px; border-radius: 22px; border: 1px solid #ddd; background: #fff; font-size: 12px; }
.wa-send-btn { width: 36px; height: 36px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; }
.wa-send-btn .i { width: 16px; height: 16px; }

/* Telegram */
.tg-app { background: linear-gradient(180deg,#82caff 0%,#a8ddff 100%); flex: 1; display: flex; flex-direction: column; }
.tg-head { background: #517da2; color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.tg-head .tg-av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#229ed9,#0088cc); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.tg-head .tg-name { font-weight: 700; font-size: 14px; }
.tg-head .tg-status { font-size: 10px; opacity: .8; }
.tg-msgs { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.tg-msg { max-width: 78%; padding: 7px 12px; border-radius: 14px; font-size: 12px; line-height: 1.3; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.tg-msg.them { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; color: #000; }
.tg-msg.me { background: #effdde; align-self: flex-end; border-bottom-right-radius: 4px; color: #000; }
.tg-msg .tg-time { font-size: 9px; color: #5f6368; float: right; margin-left: 8px; margin-top: 3px; }
.tg-input { background: #fff; padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #ddd; }
.tg-input input { flex: 1; padding: 8px 12px; border-radius: 18px; border: 1px solid #ddd; background: #f7f7f7; font-size: 12px; }
.tg-send-btn { width: 36px; height: 36px; border-radius: 50%; background: #229ed9; color: #fff; display: flex; align-items: center; justify-content: center; }
.tg-send-btn .i { width: 16px; height: 16px; }

/* SMS — Android (Messages) */
.sms-and { background: #f5f5f5; flex: 1; display: flex; flex-direction: column; color: #202124; }
.sms-and-head { background: #fff; color: #202124; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e8eaed; }
.sms-and-head .sa-av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#3ddc84,#0f9d58); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.sms-and-head .sa-name { font-weight: 600; font-size: 14px; color: #202124; }
.sms-and-head .sa-num { font-size: 10px; color: #5f6368; }
.sms-and-msgs { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.sms-and-msg { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: 12px; line-height: 1.3; }
.sms-and-msg.them { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sms-and-msg.me { background: #1a73e8; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.sms-and-msg .sa-time { font-size: 9px; opacity: .7; margin-top: 3px; display: block; }
.sms-and-input { background: #fff; padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #e8eaed; }
.sms-and-input input { flex: 1; padding: 8px 14px; border-radius: 22px; border: 1px solid #e8eaed; background: #f1f3f4; font-size: 12px; }
.sms-and-input .sa-send-btn { width: 36px; height: 36px; border-radius: 50%; background: #1a73e8; color: #fff; display: flex; align-items: center; justify-content: center; }
.sms-and-input .sa-send-btn .i { width: 16px; height: 16px; }

/* SMS — iPhone (iMessage) */
.sms-ios { background: #fff; flex: 1; display: flex; flex-direction: column; color: #000; }
.sms-ios-head { background: rgba(247,247,247,.95); padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #c8c7cc; flex-direction: column; }
.sms-ios-head .si-av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#34c759,#1e8a3a); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.sms-ios-head .si-name { font-weight: 600; font-size: 12px; color: #000; }
.sms-ios-msgs { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; background: #fff; }
.sms-ios-msg { max-width: 78%; padding: 7px 12px; border-radius: 18px; font-size: 12px; line-height: 1.3; }
.sms-ios-msg.them { background: #e9e9eb; color: #000; align-self: flex-start; }
.sms-ios-msg.me { background: linear-gradient(180deg,#0a7cff,#0260e6); color: #fff; align-self: flex-end; }
.sms-ios-input { padding: 8px 12px; display: flex; align-items: center; gap: 8px; background: #fff; border-top: 1px solid #c8c7cc; }
.sms-ios-input input { flex: 1; padding: 8px 14px; border-radius: 18px; border: 1px solid #c8c7cc; background: #fff; font-size: 12px; }
.sms-ios-input .si-send-btn { width: 32px; height: 32px; border-radius: 50%; background: #0a7cff; color: #fff; display: flex; align-items: center; justify-content: center; }
.sms-ios-input .si-send-btn .i { width: 16px; height: 16px; }

/* ---------- Doc Preview Modal ---------- */
.doc-prev { background: #525659; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 540px; }
.doc-prev-toolbar { background: #323639; color: #fff; padding: 8px 14px; border-radius: 6px; display: flex; align-items: center; gap: 14px; font-size: 12px; }
.doc-prev-toolbar .dpt-stat { padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.doc-prev-toolbar .dpt-stat[data-s="approved"] { background: rgba(16,185,129,.20); color: #34d399; }
.doc-prev-toolbar .dpt-stat[data-s="pending"] { background: rgba(245,158,11,.20); color: #fbbf24; }
.doc-prev-toolbar .dpt-stat[data-s="rejected"] { background: rgba(239,68,68,.20); color: #f87171; }
.doc-prev-page {
  background: #fff; color: #000; padding: 36px 44px; border-radius: 4px; min-height: 480px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4); margin: 0 auto; max-width: 640px; width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
}
.doc-prev-page h2 { font-size: 22px; margin: 0 0 6px; color: #111; }
.doc-prev-page .dpp-meta { font-size: 11px; color: #666; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.doc-prev-page table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 12px 0; }
.doc-prev-page table th, .doc-prev-page table td { border: 1px solid #ddd; padding: 6px 10px; text-align: left; color: #333; }
.doc-prev-page table th { background: #f5f5f5; font-weight: 700; }
.doc-prev-page .dpp-sig { margin-top: 28px; display: flex; justify-content: space-between; gap: 24px; }
.doc-prev-page .dpp-sig .ds-block { flex: 1; }
.doc-prev-page .dpp-sig .ds-line { border-top: 1px solid #999; margin-top: 36px; font-size: 11px; padding-top: 4px; color: #555; }
.doc-prev-page .dpp-sig .ds-name {
  font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
  font-size: 22px; color: #1f4ba1; transform: rotate(-3deg); margin-top: 8px;
}
.doc-prev-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 14px; background: var(--surface-2); border-top: 1px solid var(--border); }

.paper-doc-status {
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
  margin-left: 6px;
}
.paper-doc-status[data-s="approved"] { background: rgba(16,185,129,.16); color: #10b981; }
.paper-doc-status[data-s="pending"] { background: rgba(245,158,11,.16); color: #f59e0b; }
.paper-doc-status[data-s="rejected"] { background: rgba(239,68,68,.16); color: #ef4444; }

/* ---------- SaaS Platform Page ---------- */
.saas-hero {
  padding: 26px; border-radius: 18px; margin-bottom: 18px;
  background: linear-gradient(135deg,#0c1325 0%,#1e2a4a 60%,#3b82f6 200%);
  color: #fff; position: relative; overflow: hidden;
}
.saas-hero::after {
  content: ''; position: absolute; top: -50%; right: -20%; width: 480px; height: 480px;
  border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.30), transparent 70%);
}
.saas-hero-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.saas-cloud-orb {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #38bdf8 60%, #0284c7);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 0 30px rgba(56,189,248,.6);
}
.saas-cloud-orb .i { width: 26px; height: 26px; }
.saas-hero-title { font-size: 22px; font-weight: 800; }
.saas-hero-sub { opacity: .85; font-size: 13px; margin-top: 2px; }
.saas-co-switch {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.10); padding: 8px 12px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.20);
}
.saas-co-switch .scs-lbl { font-size: 11px; opacity: .8; }
.saas-co-switch select {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.30);
  padding: 6px 10px; border-radius: 8px; font-weight: 700; cursor: pointer;
}
.saas-co-switch select option { color: #000; }
.saas-cloud-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(16,185,129,.20); border: 1px solid rgba(16,185,129,.40);
  font-size: 11px; font-weight: 700; color: #34d399; margin-top: 12px; position: relative; z-index: 1;
}
.saas-cloud-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399;
  animation: enginePulse 1.6s infinite;
}

.saas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.saas-tile {
  padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.saas-tile::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--c, var(--accent));
}
.saas-tile-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.saas-tile-value { font-size: 24px; font-weight: 800; color: var(--text); margin: 6px 0 4px; }
.saas-tile-sub { font-size: 11px; color: var(--muted); }

.saas-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 18px; }
.saas-row-2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.saas-card {
  padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.saas-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.saas-card-title { font-size: 14px; font-weight: 800; color: var(--text); }
.saas-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Subscription plans */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card {
  padding: 22px 20px; border-radius: 16px; position: relative;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s ease;
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.plan-card.popular {
  background: linear-gradient(160deg,#1e293b,#0f172a);
  color: #fff; border-color: #6366f1;
}
.plan-card.popular .plan-name,
.plan-card.popular .plan-price,
.plan-card.popular .plan-feat { color: #fff !important; }
.plan-card.popular .plan-feat .i { color: #34d399 !important; }
.plan-pop-pill {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg,#f59e0b,#dc2626); color: #fff;
  font-size: 10px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(245,158,11,.4); letter-spacing: .08em;
}
.plan-name { font-size: 14px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: .08em; }
.plan-price { font-size: 32px; font-weight: 800; color: var(--text); margin: 8px 0 4px; }
.plan-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-feats { list-style: none; padding: 14px 0; margin: 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.plan-card.popular .plan-feats { border-color: rgba(255,255,255,.15); }
.plan-feat { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.plan-feat .i { width: 14px; height: 14px; color: #10b981; flex-shrink: 0; }
.plan-cta {
  width: 100%; padding: 10px 14px; margin-top: 14px; border: none; border-radius: 10px;
  font-weight: 700; cursor: pointer; transition: all .2s; font-size: 13px;
  background: var(--accent); color: #fff;
}
.plan-card.popular .plan-cta { background: #fff; color: #1e293b; }
.plan-card.active .plan-cta { background: #10b981; }
.plan-cta:hover { filter: brightness(1.08); }

/* User mgmt table */
.user-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.user-table th, .user-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.user-table th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.user-table td { color: var(--text); }
.user-table .ut-av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; vertical-align: middle; }
.user-table .ut-role-pill { font-size: 10px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.user-table .ut-role-pill[data-r="admin"] { background: rgba(168,85,247,.16); color: #a855f7; }
.user-table .ut-role-pill[data-r="manager"] { background: rgba(99,102,241,.14); color: #6366f1; }
.user-table .ut-role-pill[data-r="user"] { background: rgba(16,185,129,.14); color: #10b981; }
.user-table .ut-status { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.user-table .ut-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.user-table .ut-status.off::before { background: #94a3b8; }

/* Cloud sync widget */
.cloud-sync { display: flex; flex-direction: column; gap: 10px; }
.cloud-sync .cs-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cloud-sync .cs-row:last-child { border: none; }
.cloud-sync .cs-ico { width: 28px; height: 28px; border-radius: 8px; background: rgba(16,185,129,.14); color: #10b981; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cloud-sync .cs-ico .i { width: 14px; height: 14px; }
.cloud-sync .cs-name { font-size: 12px; font-weight: 700; color: var(--text); }
.cloud-sync .cs-time { font-size: 10px; color: var(--muted); }
.cloud-sync .cs-ok { font-size: 10px; padding: 3px 8px; border-radius: 999px; background: rgba(16,185,129,.14); color: #10b981; font-weight: 700; margin-left: auto; }

/* Storage usage bar */
.usage-bar { display: flex; flex-direction: column; gap: 10px; }
.usage-bar .ub-row { font-size: 12px; }
.usage-bar .ub-name { color: var(--text); font-weight: 700; }
.usage-bar .ub-num { color: var(--muted); float: right; }
.usage-bar .ub-track { height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.usage-bar .ub-fill { height: 100%; background: linear-gradient(90deg,#10b981,#6366f1); border-radius: 99px; transition: width .6s ease; }

/* Security log */
.sec-log { display: flex; flex-direction: column; gap: 8px; }
.sec-log .sl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.sec-log .sl-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sec-log .sl-ico .i { width: 14px; height: 14px; }
.sec-log .sl-row[data-l="ok"] .sl-ico { background: rgba(16,185,129,.14); color: #10b981; }
.sec-log .sl-row[data-l="warn"] .sl-ico { background: rgba(245,158,11,.14); color: #f59e0b; }
.sec-log .sl-row[data-l="bad"] .sl-ico { background: rgba(239,68,68,.14); color: #ef4444; }
.sec-log .sl-text { flex: 1; color: var(--text); }
.sec-log .sl-time { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Backup card */
.backup-card { display: flex; flex-direction: column; align-items: center; padding: 20px; text-align: center; }
.backup-orb {
  width: 76px; height: 76px; border-radius: 50%;
  background: conic-gradient(from 0deg, #10b981, #6366f1, #10b981);
  display: flex; align-items: center; justify-content: center; color: #fff;
  animation: spinOrb 8s linear infinite; box-shadow: 0 0 30px rgba(16,185,129,.4);
  margin-bottom: 12px;
}
.backup-orb .i { width: 30px; height: 30px; }
.backup-msg { font-weight: 800; color: var(--text); font-size: 15px; }
.backup-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.backup-stat { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(16,185,129,.14); color: #10b981; font-weight: 700; margin-top: 10px; }

/* Global access map */
.global-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.global-loc { padding: 10px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; font-size: 11px; }
.global-loc .gl-flag { width: 24px; height: 18px; border-radius: 3px; background: #ddd; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; }
.global-loc .gl-name { font-weight: 700; color: var(--text); }
.global-loc .gl-count { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* Billing card */
.billing-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.billing-row:last-child { border-bottom: none; }
.billing-row .br-name { color: var(--text); flex: 1; }
.billing-row .br-amt { font-weight: 800; color: var(--text); }
.billing-row .br-stat { font-size: 10px; padding: 3px 8px; border-radius: 999px; background: rgba(16,185,129,.14); color: #10b981; font-weight: 700; margin-left: 10px; }

/* Store badges (Mobile View) */
.store-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.store-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; background: #000; color: #fff;
  font-size: 11px; cursor: pointer; transition: transform .2s; text-decoration: none;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge .sb-ico {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.store-badge .sb-ico .i { width: 22px; height: 22px; }
.store-badge .sb-text { display: flex; flex-direction: column; line-height: 1.1; }
.store-badge .sb-text small { font-size: 8px; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.store-badge .sb-text strong { font-size: 13px; font-weight: 700; }
.store-badge[data-store="apple"] { background: linear-gradient(180deg,#1f1f1f,#000); }
.store-badge[data-store="google"] { background: linear-gradient(180deg,#1a1a1a,#000); }
.store-badge[data-store="ms"] { background: linear-gradient(180deg,#0078d4,#005a9e); }

@media (max-width: 1100px) {
  .saas-grid { grid-template-columns: 1fr 1fr; }
  .saas-row, .saas-row-2 { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .comm-app-grid { grid-template-columns: 1fr; }
  .global-grid { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   V7 — CEO Smart Reminder + Boost Engine + Campaign popups
   PURELY ADDITIVE — all selectors are V7-namespaced.
   ========================================================================== */

.ceo-boost-card {
  --cbgrad: linear-gradient(135deg,#6366f1,#a855f7);
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 22px 26px; margin-bottom: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 56px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
[data-theme="light"] .ceo-boost-card {
  background: rgba(255,255,255,0.65);
  border-color: rgba(15,23,42,0.08);
}
.ceo-boost-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--cbgrad); opacity: 0.10; z-index: 0;
  transition: opacity .8s ease, background .8s ease;
}
.ceo-boost-glow {
  position: absolute; top: -120px; right: -120px; width: 360px; height: 360px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--cbgrad) 0%, transparent 70%);
  filter: blur(40px); opacity: .40;
  animation: ceoBoostGlow 6s ease-in-out infinite;
}
@keyframes ceoBoostGlow {
  0%, 100% { transform: translate(0,0) scale(1); opacity: .40; }
  50%      { transform: translate(-20px,20px) scale(1.10); opacity: .55; }
}
.ceo-boost-row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center;
}
.ceo-boost-left { min-width: 0; }
.ceo-boost-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.ceo-boost-tagrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ceo-boost-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 10px #10b981; animation: enginePulse 1.6s infinite;
}
.ceo-boost-tag {
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: rgba(16,185,129,.18); color: #10b981; letter-spacing: .12em;
}
.ceo-boost-occ-tag {
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: rgba(99,102,241,.16); color: var(--accent); letter-spacing: .08em;
}

.ceo-boost-text {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
}
.ceo-boost-text .cb-emo { font-size: 1.4em; line-height: 1; }
.ceo-boost-text.cb-anim-in {
  animation: ceoBoostFade .55s ease-out;
}
@keyframes ceoBoostFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ceo-boost-sub { font-size: 13px; color: var(--muted); }

.ceo-boost-dots { display: flex; gap: 5px; }
.cb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); cursor: pointer; transition: all .2s;
}
.cb-dot:hover { transform: scale(1.3); }
.cb-dot.active { background: var(--cbgrad, var(--accent)); width: 22px; border-radius: 99px; }

.ceo-boost-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ceo-boost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  transition: all .25s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.ceo-boost-btn .i { width: 16px; height: 16px; }
.ceo-boost-btn.cb-retail { background: linear-gradient(135deg,#f59e0b,#dc2626); }
.ceo-boost-btn.cb-cust   { background: linear-gradient(135deg,#10b981,#0891b2); }
.ceo-boost-btn.cb-all    { background: linear-gradient(135deg,#6366f1,#ec4899); }
.ceo-boost-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 32px rgba(0,0,0,.30), 0 0 28px rgba(255,255,255,.12);
  filter: brightness(1.10);
}
.ceo-boost-btn:active { transform: translateY(-1px) scale(0.98); }

/* ---------- Campaign loader popup ---------- */
.cmp-loader { padding: 40px 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 360px; }
.cmp-loader-orb {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; box-shadow: 0 0 40px currentColor;
  animation: spinOrb 2s linear infinite;
}
.cmp-loader-orb::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--surface); opacity: 0.8;
}
.cmp-loader-msg { font-size: 13px; color: var(--text); font-weight: 700; }
.cmp-loader-bar {
  width: 240px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden;
}
.cmp-loader-bar-fill {
  height: 100%; width: 30%; border-radius: 99px;
  background: linear-gradient(90deg,#6366f1,#a855f7,#ec4899);
  animation: cmpBarSlide 1.4s linear infinite;
}
@keyframes cmpBarSlide {
  0%   { width: 10%; transform: translateX(-20%); }
  60%  { width: 80%; transform: translateX(20%); }
  100% { width: 100%; transform: translateX(120%); }
}

/* ---------- Campaign success popup ---------- */
.cmp-success { padding: 18px 22px; }
.cmp-hero {
  border-radius: 14px; padding: 18px 20px; color: #fff;
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
  position: relative; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.cmp-hero::after {
  content: ''; position: absolute; top: -50%; right: -20%; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.20), transparent 70%);
}
.cmp-hero-emo { font-size: 36px; position: relative; z-index: 1; }
.cmp-hero-title { font-size: 18px; font-weight: 800; position: relative; z-index: 1; }
.cmp-hero-sub { font-size: 12px; opacity: .92; margin-top: 4px; position: relative; z-index: 1; }

.cmp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.cmp-stat { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.cmp-stat-num { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.cmp-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; font-weight: 700; }
.cmp-stat-tag { font-size: 10px; padding: 2px 7px; border-radius: 99px; margin-top: 6px; display: inline-block; font-weight: 700; }
.cmp-stat-tag[data-s="ok"]   { background: rgba(16,185,129,.14); color: #10b981; }
.cmp-stat-tag[data-s="info"] { background: rgba(99,102,241,.14); color: var(--accent); }

.cmp-channels { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cmp-chan {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text);
}
.cmp-chan .i { width: 16px; height: 16px; color: var(--accent); }
.cmp-chan-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px #10b981; animation: enginePulse 1.6s infinite;
}
.cmp-chan-stat {
  margin-left: auto; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  background: rgba(16,185,129,.14); color: #10b981;
}
.cmp-chan[data-c="im"] .cmp-chan-stat  { background: rgba(99,102,241,.14); color: var(--accent); }
.cmp-chan[data-c="sms"] .cmp-chan-stat { background: rgba(245,158,11,.14); color: #f59e0b; }

.cmp-msg-preview {
  border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border);
  padding: 14px 18px; font-size: 13px; color: var(--text); line-height: 1.5;
}
.cmp-msg-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 6px; }
.cmp-msg-body { white-space: pre-line; }

.cmp-actions {
  display: flex; gap: 10px; align-items: center; padding: 14px 22px;
  background: var(--surface-2); border-top: 1px solid var(--border); justify-content: flex-end;
}
.cmp-actions .cmp-step-info { margin-right: auto; font-size: 12px; color: var(--muted); }

/* ---------- Stepper (campaign wizard) ---------- */
.cmp-stepper {
  display: flex; align-items: center; padding: 18px 22px 6px; gap: 6px;
}
.cmp-step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cmp-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--border);
  transition: all .3s ease;
}
.cmp-step.active .cmp-step-dot {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99,102,241,.18);
}
.cmp-step.done .cmp-step-dot { background: #10b981; color: #fff; border-color: #10b981; }
.cmp-step-lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.cmp-step.active .cmp-step-lbl { color: var(--text); }
.cmp-step.done .cmp-step-lbl { color: #10b981; }
.cmp-step-line { flex: 1; height: 2px; background: var(--border); border-radius: 99px; min-width: 24px; }
.cmp-step-line.done { background: #10b981; }

/* ---------- Two-column app preview row in wizard ---------- */
.cmp-twoview { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 22px 22px; align-items: start; }
.cmp-twoview-col {
  background: var(--surface-2); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 1px solid var(--border);
}

/* Compact phone frame for wizard */
.phone-frame.cmp-phone { width: 280px; height: 480px; max-height: 56vh; margin: 0 auto; }

/* Mail preview cards (campaign email mockups) */
.cmp-mailpreview {
  background: #fff; color: #202124; border-radius: 12px; width: 100%; max-width: 320px;
  font-family: 'Roboto', system-ui, sans-serif; font-size: 12px;
  border: 1px solid #e5e5e5; box-shadow: 0 4px 14px rgba(0,0,0,.10);
  overflow: hidden;
}
.cmp-mailpreview.outlook { font-family: 'Segoe UI', system-ui, sans-serif; }
.cmp-mailpreview-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.cmp-mailpreview-logo {
  width: 28px; height: 28px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.cmp-mailpreview-app { font-weight: 700; font-size: 11px; color: #202124; }
.cmp-mailpreview-meta { font-size: 10px; color: #5f6368; }
.cmp-mailpreview-stamp { margin-left: auto; font-size: 10px; color: #5f6368; }
.cmp-mailpreview-subj { padding: 12px 14px 4px; font-size: 13px; font-weight: 700; color: #202124; }
.cmp-mailpreview-body { padding: 6px 14px 16px; color: #3c4043; line-height: 1.5; font-size: 12px; }
.cmp-mailpreview-cta {
  display: inline-block; padding: 8px 16px; color: #fff; border-radius: 6px; font-weight: 700;
  font-size: 12px; margin-top: 10px;
}
.cmp-mailpreview-stat {
  background: #f0f9f4; color: #16a34a; padding: 6px 12px; font-size: 11px; font-weight: 700;
  border-top: 1px solid #f0f0f0;
}

.cmp-channel-stats {
  font-size: 11px; padding: 6px 12px; border-radius: 999px;
  background: rgba(16,185,129,.14); color: #10b981; font-weight: 700; text-align: center;
}

/* Loader modal sizing */
.modal-loader { max-width: 460px !important; }

@media (max-width: 1100px) {
  .ceo-boost-row { grid-template-columns: 1fr; }
  .ceo-boost-right { align-items: flex-start; }
  .ceo-boost-actions { justify-content: flex-start; }
  .cmp-stats { grid-template-columns: 1fr 1fr; }
  .cmp-twoview { grid-template-columns: 1fr; }
}


/* ==========================================================================
   V8 — Live Delivery Tracking System
   PURELY ADDITIVE — all selectors are V8-namespaced under .lt-*
   ========================================================================== */

/* ---------- Hub section ---------- */
.lt-section { margin-bottom: 22px; }
.lt-banner {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 22px 24px; margin-bottom: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(99,102,241,.22), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(16,185,129,.22), transparent 55%),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: center;
}
[data-theme="light"] .lt-banner { background:
  radial-gradient(circle at 100% 0%, rgba(99,102,241,.18), transparent 55%),
  radial-gradient(circle at 0% 100%, rgba(16,185,129,.18), transparent 55%),
  rgba(255,255,255,0.7);
  border-color: rgba(15,23,42,0.08);
}
.lt-banner-tagrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lt-banner-pulse { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 10px #ef4444; animation: enginePulse 1.4s infinite; }
.lt-banner-tag { font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(239,68,68,.18); color: #ef4444; letter-spacing: .12em; }
.lt-banner-sub-tag { font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(99,102,241,.16); color: var(--accent); letter-spacing: .08em; }
.lt-banner-title { font-size: clamp(18px, 1.8vw, 24px); font-weight: 800; color: var(--text); line-height: 1.25; margin-bottom: 6px; }
.lt-banner-sub { font-size: 13px; color: var(--muted); max-width: 520px; line-height: 1.5; }
.lt-banner-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lt-bs { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.lt-bs-num { font-size: 20px; font-weight: 800; color: var(--text); }
.lt-bs-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; font-weight: 700; }

/* ---------- Channel cards ---------- */
.lt-channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lt-chan-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: all .25s ease; position: relative; overflow: hidden;
  font: inherit; color: inherit; text-align: left; width: 100%;
}
.lt-chan-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lt-chan-card::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  transition: left .6s ease;
}
.lt-chan-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.18); border-color: var(--accent); }
.lt-chan-card:hover::before { left: 100%; }
.lt-chan-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.lt-chan-icon .i { width: 18px; height: 18px; }
.lt-chan-body { flex: 1; min-width: 0; }
.lt-chan-title { font-size: 13px; font-weight: 800; color: var(--text); }
.lt-chan-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.lt-chan-cta { display: flex; align-items: center; gap: 8px; }
.lt-chan-cta .i { width: 14px; height: 14px; color: var(--muted); }
.lt-chan-live {
  display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 800; letter-spacing: .12em;
  padding: 3px 8px; border-radius: 999px; background: rgba(239,68,68,.16); color: #ef4444;
}
.lt-cd { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: enginePulse 1.2s infinite; }

/* ---------- Tracking popup wrapper ---------- */
.lt-modal { max-width: 720px !important; }
.lt-popup-wrap { padding: 20px 22px 12px; }
.lt-actions { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--surface-2); border-top: 1px solid var(--border); justify-content: flex-end; }
.lt-action-info { margin-right: auto; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lt-action-info .i { width: 14px; height: 14px; color: var(--accent); }

/* ---------- Animated journey map ---------- */
.lt-journey {
  position: relative;
  width: 100%; max-width: 600px;
  margin: 0 auto 18px;
  aspect-ratio: 600 / 130;
  background: linear-gradient(180deg, rgba(99,102,241,.05), rgba(16,185,129,.05));
  border-radius: 16px; border: 1px solid var(--border);
  padding: 8px 0; overflow: hidden;
}
.lt-svg { display: block; width: 100%; height: 100%; }
.lt-path-bg   { fill: none; stroke: rgba(148,163,184,0.45); stroke-width: 2; }
.lt-path      { fill: none; stroke-width: 3.5; opacity: .95; }
.lt-path-glow { fill: none; stroke: #10b981; stroke-width: 8; opacity: 0; filter: blur(8px); transition: opacity .4s ease; }
.lt-cp        { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.lt-icon {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 700; color: var(--text);
  pointer-events: none;
}
.lt-icon-emo { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.lt-icon-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lt-warehouse { left: 1.5%; top: 60%; }
.lt-destination { right: 0.5%; top: 48%; }
.lt-cp-lbl { position: absolute; font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.lt-cpl1 { left: 22%; top: 12%; }
.lt-cpl2 { left: 53%; top: 38%; }
.lt-cpl3 { left: 78%; top: 24%; }

/* The moving dot rides the offset-path that mirrors ROUTE_D in JS */
.lt-dot {
  position: absolute; left: 0; top: 0; width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  offset-path: path('M 40 95 Q 145 25 250 70 T 460 55 Q 510 60 555 80');
  /* viewBox is 600x130 — convert to a percentage frame so the dot tracks the SVG */
  transform-origin: center;
  animation: ltMove 9s cubic-bezier(.4,.0,.2,1) infinite;
  pointer-events: none;
  z-index: 2;
}
.lt-journey { /* set CSS coordinate frame so offset-path pixel coords align with the SVG */ container-type: inline-size; }
/* When viewport is narrower, scale the dot's pixel-coord offset-path */
.lt-dot-core {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #34d399, #059669);
  box-shadow: 0 0 14px #10b981, 0 0 24px rgba(16,185,129,.55);
}
.lt-ripple {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(16,185,129,.7);
  animation: ltRipple 1.6s ease-out infinite;
}
.lt-ripple2 { animation-delay: .8s; }
@keyframes ltRipple {
  0%   { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(3.4); opacity: 0; }
}
@keyframes ltMove {
  0%, 4%   { offset-distance: 0%; }
  22%      { offset-distance: 25%; }
  26%, 30% { offset-distance: 25%; }
  46%      { offset-distance: 55%; }
  50%, 54% { offset-distance: 55%; }
  72%      { offset-distance: 80%; }
  76%, 80% { offset-distance: 80%; }
  100%     { offset-distance: 100%; }
}

/* Route meta strip below the map */
.lt-route-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px; padding: 6px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,.05), transparent);
  font-size: 10px;
}
.lt-rm { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lt-rm-lbl { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.lt-rm-val { font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.lt-rm-arrow { color: var(--muted); font-size: 14px; }
.lt-rm-right { margin-left: auto; text-align: right; }

/* ---------- Live mode ON ---------- */
.lt-live-on .lt-path { animation: ltPathDash 2s linear infinite; stroke-width: 4.5; }
.lt-live-on .lt-path-glow { opacity: .85; }
.lt-live-on .lt-dot { animation-duration: 4s; }
.lt-live-on .lt-dot-core { background: radial-gradient(circle at 30% 30%, #fbbf24, #f59e0b); box-shadow: 0 0 18px #f59e0b, 0 0 36px rgba(245,158,11,.6); }
.lt-live-on .lt-ripple { border-color: rgba(245,158,11,.75); }
.lt-live-on .lt-cp { stroke: #f59e0b; stroke-width: 2.5; }
.lt-live-on .lt-mm-route { animation: ltPathDash 1.6s linear infinite; stroke: #f59e0b; }
.lt-live-on .lt-mm-dot { fill: #f59e0b; filter: drop-shadow(0 0 4px #f59e0b); animation-duration: 3.5s !important; }
@keyframes ltPathDash { to { stroke-dashoffset: -40; } }

/* ---------- Timeline ---------- */
.lt-timeline { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 0 2px; }
.lt-tl-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; min-width: 80px; }
.lt-tl-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--border);
  position: relative; transition: all .3s ease;
}
.lt-tl-pulse {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid #ef4444; animation: ltTlPulse 1.4s ease-out infinite;
}
@keyframes ltTlPulse {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.lt-tl-step.active .lt-tl-dot { background: #ef4444; color: #fff; border-color: #ef4444; }
.lt-tl-step.done   .lt-tl-dot { background: #10b981; color: #fff; border-color: #10b981; }
.lt-tl-lbl { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; }
.lt-tl-step.active .lt-tl-lbl { color: var(--text); }
.lt-tl-step.done   .lt-tl-lbl { color: #10b981; }
.lt-tl-livetag { font-size: 9px; padding: 2px 6px; border-radius: 999px; background: rgba(239,68,68,.18); color: #ef4444; margin-left: 4px; font-weight: 800; letter-spacing: .08em; }
.lt-tl-time { font-size: 10px; color: var(--muted); }
.lt-tl-line { flex: 1; height: 2px; background: var(--border); border-radius: 99px; min-width: 12px; }
.lt-tl-line.done { background: #10b981; }

/* ---------- ETA card ---------- */
.lt-eta-card {
  display: grid; grid-template-columns: 1fr auto; gap: 18px;
  padding: 14px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.lt-eta-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.lt-eta-val { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 2px; line-height: 1.2; }
.lt-eta-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lt-eta-old { color: var(--muted); font-weight: 600; font-size: 18px; margin-right: 8px; }
.lt-eta-new { color: #10b981; font-weight: 800; }
.lt-eta-right { text-align: right; }
.lt-eta-tag {
  font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: rgba(16,185,129,.18); color: #10b981; letter-spacing: .08em;
  display: inline-block;
}
.lt-eta-tag[data-s="early"] { background: rgba(245,158,11,.18); color: #f59e0b; }
.lt-eta-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- Banner messages (Good news / Near) ---------- */
.lt-banner-msg {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.lt-banner-msg.lt-goodnews {
  background: linear-gradient(90deg, rgba(16,185,129,.18), rgba(245,158,11,.14));
  border-color: rgba(16,185,129,.35); color: var(--text);
}
.lt-banner-msg.lt-near {
  background: linear-gradient(90deg, rgba(99,102,241,.18), rgba(236,72,153,.14));
  border-color: rgba(99,102,241,.35);
}
.lt-fadein { animation: ltFadeIn .55s ease-out; }
@keyframes ltFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Channel preview wrappers ---------- */
.lt-cprev { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.lt-cprev-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 8px; }
.lt-cprev-phone { display: flex; flex-direction: column; align-items: center; }
.lt-cprev-pf { width: 280px; height: 460px; max-height: 56vh; }

/* Email preview */
.lt-mailpreview {
  background: #fff; color: #202124; border-radius: 12px; max-width: 480px; margin: 0 auto;
  font-family: 'Roboto', system-ui, sans-serif; font-size: 12px;
  border: 1px solid #e5e5e5; box-shadow: 0 4px 14px rgba(0,0,0,.10); overflow: hidden;
}
.lt-mailpreview.outlook { font-family: 'Segoe UI', system-ui, sans-serif; }
.lt-mailpreview-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.lt-mailpreview-logo { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.lt-mailpreview-app { font-weight: 700; font-size: 11px; color: #202124; }
.lt-mailpreview-meta { font-size: 10px; color: #5f6368; }
.lt-mailpreview-stamp { margin-left: auto; font-size: 10px; color: #5f6368; }
.lt-mailpreview-subj { padding: 12px 14px 4px; font-size: 13px; font-weight: 700; color: #202124; }
.lt-mailpreview-livebar {
  display: flex; align-items: center; gap: 8px; margin: 6px 14px 8px;
  padding: 8px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #16a34a;
  background: linear-gradient(90deg, rgba(16,185,129,.12), rgba(16,185,129,.04));
  border: 1px solid rgba(16,185,129,.30);
}
.lt-mailpreview-livebar.lt-mp-livebar-on { color: #f59e0b; background: linear-gradient(90deg, rgba(245,158,11,.16), rgba(245,158,11,.06)); border-color: rgba(245,158,11,.4); }
.lt-mp-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: enginePulse 1.4s infinite; }
.lt-mailpreview-mapwrap { padding: 0 14px 8px; }
.lt-mailpreview-body { padding: 4px 14px 16px; color: #3c4043; line-height: 1.5; font-size: 12px; }
.lt-mailpreview-cta { display: inline-block; padding: 8px 16px; color: #fff; border-radius: 6px; font-weight: 700; font-size: 12px; margin-top: 10px; }

/* Mini-map (used inside email + chat bubbles) */
.lt-minimap { width: 100%; height: 80px; border-radius: 8px; overflow: hidden; }
.lt-mm-bg { fill: #eef2ff; }
[data-theme="dark"] .lt-mm-bg { fill: #1e293b; }
.lt-mm-grid { stroke: rgba(99,102,241,.18); stroke-width: 0.5; fill: none; }
.lt-mm-route { fill: none; stroke: #6366f1; stroke-width: 2; stroke-dasharray: 4 5; }
.lt-mm-from { fill: #10b981; }
.lt-mm-to   { fill: #ef4444; }
.lt-mm-dot {
  fill: #6366f1; filter: drop-shadow(0 0 4px #6366f1);
  offset-path: path('M 14 60 Q 60 18, 110 44 T 206 30');
  animation: ltMmMove 6s linear infinite;
}
@keyframes ltMmMove {
  0%   { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* WhatsApp / Telegram map bubble */
.lt-wa-mapbubble, .lt-tg-mapbubble {
  padding: 6px !important; max-width: 220px;
}
.lt-wa-mapbubble .lt-minimap, .lt-tg-mapbubble .lt-minimap { border-radius: 6px; }
.lt-wa-eta, .lt-tg-eta {
  padding: 6px 8px 0; font-size: 11px; font-weight: 700; color: #075e54;
}
.lt-tg-eta { color: #229ed9; }

/* ---------- LIVE STATUS button ---------- */
.lt-livebar { display: flex; justify-content: center; margin: 14px 0 6px; }
.lt-live-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-radius: 999px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 8px 24px rgba(239,68,68,.40), inset 0 1px 0 rgba(255,255,255,.20);
  animation: ltLiveBlink 1.6s ease-in-out infinite;
  letter-spacing: .04em;
}
.lt-live-btn::before {
  content: ''; position: absolute; inset: -4px; border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  opacity: .35; filter: blur(10px); z-index: -1;
  animation: ltLiveBlinkGlow 1.6s ease-in-out infinite;
}
@keyframes ltLiveBlink     { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes ltLiveBlinkGlow { 0%, 100% { opacity: .25; }      50% { opacity: .55; } }
.lt-live-btn:hover { filter: brightness(1.08); }
.lt-live-btn:disabled { cursor: default; }
.lt-live-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 24px rgba(16,185,129,.40), inset 0 1px 0 rgba(255,255,255,.20);
  animation: none;
}
.lt-live-btn.active::before { background: linear-gradient(135deg, #10b981, #059669); animation: none; opacity: .35; }
.lt-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: enginePulse 1.2s infinite; }
.lt-live-text { font-size: 13px; font-weight: 800; }
.lt-live-hint { font-size: 10px; opacity: .85; font-weight: 600; letter-spacing: .04em; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.30); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .lt-banner { grid-template-columns: 1fr; }
  .lt-channel-grid { grid-template-columns: 1fr 1fr; }
  .lt-modal { max-width: 96vw !important; }
}
@media (max-width: 720px) {
  .lt-channel-grid { grid-template-columns: 1fr; }
  .lt-timeline { overflow-x: auto; padding-bottom: 6px; }
  .lt-tl-step { min-width: 70px; }
  .lt-eta-card { grid-template-columns: 1fr; }
  .lt-eta-right { text-align: left; }
  .lt-cprev-pf { width: 240px; height: 400px; }
  .lt-live-hint { display: none; }
}

/* ---------- Reduced motion: respect user accessibility preference ---------- */
@media (prefers-reduced-motion: reduce) {
  .lt-banner-pulse,
  .lt-cd,
  .lt-mp-pulse,
  .lt-tl-pulse,
  .lt-ripple,
  .lt-ripple2,
  .lt-live-btn,
  .lt-live-btn::before,
  .lt-live-dot,
  .lt-mm-dot,
  .lt-dot,
  .lt-path,
  .lt-mm-route { animation: none !important; }
  .lt-dot { offset-distance: 50% !important; }
  .lt-mm-dot { offset-distance: 80% !important; }
  .lt-fadein { animation: none !important; }
}

/* ==========================================================================
   VIDEO GALLERY — bento mosaic of 150 live looping tiles.
   PURELY ADDITIVE — no existing selector overridden.
   ========================================================================== */

/* Banner */
.vg-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 22px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(99,102,241,.06));
  border: 1px solid var(--border-soft);
}
.vg-banner-ico {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff; display: grid; place-items: center;
  box-shadow: var(--accent-glow);
}
.vg-banner-ico .i { width: 24px; height: 24px; }
.vg-banner-body { flex: 1; min-width: 0; }
.vg-banner-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.vg-banner-sub { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; }
.vg-banner-stats { display: flex; gap: 10px; }
.vg-stat {
  text-align: center; padding: 6px 14px; border-left: 1px solid var(--border-soft);
}
.vg-stat:first-child { border-left: none; }
.vg-stat-num {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent-2); font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .vg-stat-num { color: var(--accent); }
.vg-stat-lbl {
  font-size: 10.5px; color: var(--text-mute); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600; margin-top: 2px;
}

/* Toolbar */
.vg-toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap;
  position: sticky; top: calc(var(--topbar-h) + 0px); z-index: 4;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}
[data-theme="dark"] .vg-toolbar { background: rgba(17,21,28,.78); }

.vg-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 220px; max-width: 420px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-pill); padding: 8px 14px 8px 14px;
  color: var(--text-mute);
  transition: all var(--t-fast) var(--ease);
}
.vg-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--panel); }
.vg-search input {
  border: none; outline: none; background: transparent; flex: 1;
  color: var(--text); font-size: 13px; min-width: 0;
}
.vg-search input::placeholder { color: var(--text-mute); }
.vg-search .i { width: 14px; height: 14px; }

.vg-chips {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.vg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-pill);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  color: var(--text-soft); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.vg-chip:hover { color: var(--text); border-color: var(--border-hard); background: var(--hover); }
.vg-chip.active {
  background: var(--accent-soft); color: var(--accent-2);
  border-color: transparent; font-weight: 600;
}
[data-theme="dark"] .vg-chip.active { color: var(--accent); }
.vg-chip .i { width: 13px; height: 13px; }
.vg-chip-count {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--panel-3); color: var(--text-mute); font-weight: 700;
}
.vg-chip.active .vg-chip-count { background: rgba(16,185,129,.18); color: var(--accent-2); }
[data-theme="dark"] .vg-chip.active .vg-chip-count { color: var(--accent); }

.vg-density {
  display: inline-flex; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  margin-left: auto;
}
.vg-dchip {
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  transition: all var(--t-fast) var(--ease);
}
.vg-dchip:hover { color: var(--text); }
.vg-dchip.active {
  background: var(--panel); color: var(--accent-2);
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .vg-dchip.active { color: var(--accent); background: var(--panel-3); }

/* Wall — densities */
.vg-wall {
  display: grid; gap: 12px;
  grid-auto-flow: dense;
}
.vg-wall--bento {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 150px;
}
.vg-wall--grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 160px;
}
.vg-wall--grid .vg-tile.large,
.vg-wall--grid .vg-tile.wide,
.vg-wall--grid .vg-tile.tall { grid-column: span 1; grid-row: span 1; }
.vg-wall--mosaic {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: 110px; gap: 8px;
}
.vg-wall--cinema {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  grid-auto-rows: 220px; gap: 14px;
}
.vg-wall--cinema .vg-tile.large { grid-column: span 2; grid-row: span 2; }
.vg-wall--cinema .vg-tile.wide,
.vg-wall--cinema .vg-tile.tall { grid-column: span 1; grid-row: span 1; }

/* Tile */
.vg-tile {
  position: relative; overflow: hidden;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #0d1217, #161b24);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-fast) var(--ease);
  isolation: isolate;
  animation: vgFadeIn .55s var(--ease) both;
}
@keyframes vgFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.vg-tile:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  z-index: 2;
}
.vg-tile.vg-hidden { display: none !important; }

/* Bento sizes */
.vg-tile.large { grid-column: span 2; grid-row: span 2; }
.vg-tile.wide  { grid-column: span 2; grid-row: span 1; }
.vg-tile.tall  { grid-column: span 1; grid-row: span 2; }

.vg-skel {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #161b24, #1c222c, #161b24);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  z-index: 0;
}
.vg-tile.vg-loaded .vg-skel { display: none; }

.vg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  background: #0a0d12;
  opacity: 0;
  transition: opacity .35s ease;
}
.vg-tile.vg-loaded .vg-video { opacity: 1; }

.vg-grain {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  pointer-events: none; z-index: 2; opacity: .5;
  mix-blend-mode: overlay;
}

.vg-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 30%, transparent 60%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
.vg-top, .vg-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vg-bottom { flex-direction: column; align-items: flex-start; gap: 2px; }

.vg-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(239,68,68,.85); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
}
.vg-live-dot {
  width: 6px; height: 6px; border-radius: 999px; background: #fff;
  animation: vgLivePulse 1.4s ease-in-out infinite;
}
@keyframes vgLivePulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; transform: scale(1.2); }
}
.vg-cat-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.vg-title {
  color: #fff; font-size: 12.5px; font-weight: 700;
  letter-spacing: -0.005em;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.vg-meta {
  color: rgba(255,255,255,.78); font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.vg-foot {
  margin-top: 18px; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-soft);
}
.vg-foot strong { color: var(--text); font-weight: 700; }
.vg-foot-pulse { display: inline-flex; }

/* Spotlight modal */
.vg-spot-overlay {
  position: fixed; inset: 0; z-index: 99500;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease);
  padding: 20px;
}
.vg-spot-overlay.show { opacity: 1; pointer-events: auto; }
.vg-spot {
  width: min(92vw, 1080px);
  background: var(--panel);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-soft);
  transform: scale(.96);
  transition: transform .25s var(--ease);
  position: relative;
}
.vg-spot-overlay.show .vg-spot { transform: scale(1); }
.vg-spot-close {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  width: 36px; height: 36px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease);
}
.vg-spot-close:hover { background: rgba(0,0,0,.8); }
.vg-spot-stage {
  position: relative; aspect-ratio: 16 / 9; background: #000;
}
.vg-spot-vid { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vg-spot-overlay-inner {
  position: absolute; top: 14px; left: 14px;
  display: flex; gap: 8px; z-index: 3;
}
.vg-spot-foot {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
}
.vg-spot-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.vg-spot-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.vg-spot-actions { display: flex; gap: 8px; }

/* Reduced motion safety */
@media (prefers-reduced-motion: reduce) {
  .vg-tile { animation: none !important; }
  .vg-live-dot { animation: none !important; opacity: 1; }
  .vg-skel { animation: none !important; }
}

/* Smaller screens */
@media (max-width: 900px) {
  .vg-banner { flex-direction: column; align-items: flex-start; }
  .vg-banner-stats { width: 100%; justify-content: space-between; }
  .vg-toolbar { position: static; }
  .vg-density { margin-left: 0; }
}
