/* ─── JARVIS MISSION HUB — Dark Charcoal Command Center ─────────────────────── */
/* Vercel Web Interface Guidelines compliant */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

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

:root {
  /* Metric Flow inspired — clean dark SaaS */
  --bg:         #111214;
  --surface:    #1e1f23;
  --surface2:   #252629;
  --surface3:   #2a2c32;
  --border:     #2a2c32;
  --border2:    #2a2c32;
  --accent:     #e05c2e;

  /* Status colors */
  --green:      #22c55e;
  --green-dim:  rgba(34,197,94,0.12);
  --green-ring: rgba(34,197,94,0.25);
  --teal:       #14b8a6;
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,0.12);
  --red-ring:   rgba(239,68,68,0.25);
  --amber:      #f59e0b;
  --amber-dim:  rgba(245,158,11,0.12);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,0.12);
  --blue-ring:  rgba(59,130,246,0.25);
  --violet:     #8b5cf6;

  /* Text */
  --text:       #f4f4f5;
  --text2:      #71717a;
  --text3:      #3f3f46;
  --text4:      #27272a;

  /* Misc */
  --radius:     8px;
  --radius-sm:  5px;
  --shadow:     0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.5);
}

html {
  color-scheme: dark;
}

html, body, #root {
  height: 100%;
  background: #0a0a0a;
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.1); }

/* ─── APP LAYOUT ────────────────────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
  background: transparent;
  position: relative;
}
.app > * {
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(12,12,12,0.72);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 2px 0 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 24px 14px;
}

.sidebar-logo {
  padding-left: 14px;
  margin-bottom: 28px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f97316, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  margin-top: 2px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #4ade80;
  text-transform: uppercase;
  margin-top: 8px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #4ade80; }
  50%       { opacity: 0.4; box-shadow: 0 0 2px #4ade80; }
}

.sidebar-section {
  padding: 10px 0 6px;
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  padding-left: 14px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  margin: 1px 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.1s ease, color 0.1s ease;
  position: relative;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface3);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, rgba(168,85,247,0.08) 100%);
  border: 1px solid rgba(249,115,22,0.15);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before { display: none; }
.nav-item .nav-icon { opacity: 0.4; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-label { color: rgba(255,255,255,0.45); font-weight: 400; }
.nav-item.active .nav-label { color: #fff; font-weight: 600; }

.nav-icon {
  font-size: 13px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  aria-hidden: true;
}

.nav-badge {
  margin-left: auto;
  background: rgba(249,115,22,0.8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  flex-shrink: 0;
}

.nav-tag {
  margin-left: auto;
  background: linear-gradient(135deg, #f97316, #a855f7);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* ─── MAIN AREA ─────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-wrap: balance;
  white-space: nowrap;
}

.topbar-meta {
  font-size: 10px;
  color: var(--text2);
  margin-top: 1px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

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

.topbar-time {
  font-size: 11px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}

/* ─── PAGE HEADER ──────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.3px;
}
.page-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Compare toggle */
.compare-toggle {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.compare-toggle.active {
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.2);
  color: #fb923c;
}

/* Refresh indicator */
.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
  cursor: pointer;
}
.refresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
  animation: pulse 2s infinite;
}

/* Header clock */
.header-clock {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
}

/* ─── KPI CARDS ─────────────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 1000px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-row { grid-template-columns: 1fr; } }

.kpi-card {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(12,12,12,0.72);
  border: 1px solid rgba(255,255,255,0.055);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  position: relative;
  cursor: default;
}
.kpi-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
}
.kpi-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 33%;
  z-index: 1;
  pointer-events: none;
}
.kpi-bloom {
  position: absolute;
  top: -4px;
  left: 15%;
  right: 15%;
  height: 28%;
  z-index: 1;
  filter: blur(10px);
  pointer-events: none;
}
.kpi-content {
  position: relative;
  z-index: 2;
  padding: 18px 22px 20px;
}

.kpi-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.kpi-change {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-change.up      { color: #4ade80; }
.kpi-change.down    { color: #f87171; }
.kpi-change.neutral { color: rgba(255,255,255,0.35); }

/* ─── CARDS ─────────────────────────────────────────────────────────────────── */
.card {
  background: rgba(12,12,12,0.72);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: #3a3c42; }
.card::before { display: none; }
.card > * { position: relative; z-index: 1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2a2c32;
  background: rgba(255,255,255,0.02);
  gap: 12px;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}

.card-meta {
  font-size: 10px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.card-body {
  padding: 16px 18px;
}

/* ─── TABLES ────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead tr {
  background: var(--surface2);
}

.data-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.035);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.data-table td {
  padding: 10px 12px;
  color: var(--text2);
  border-bottom: 1px solid rgba(255,255,255,0.025);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.data-table td:first-child { color: var(--text); }

.data-table tbody tr {
  transition: background-color 0.08s ease;
}
.data-table tbody tr:hover td {
  background: rgba(255,255,255,0.03);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ─── STATUS BADGES — flat with 6px radius ─────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.paid, .status-pill.ok {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}
.status-pill.pending, .status-pill.watch {
  background: rgba(249,115,22,0.1);
  color: #fb923c;
  border: 1px solid rgba(249,115,22,0.2);
}
.status-pill.refunded, .status-pill.high {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}
.status-pill.info {
  background: rgba(96,165,250,0.1);
  color: #93bbfd;
  border: 1px solid rgba(96,165,250,0.2);
}

/* ─── PROGRESS BAR ──────────────────────────────────────────────────────────── */
.progress-bar {
  background: var(--surface3);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */
button {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease, color 0.1s ease, box-shadow 0.1s ease;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Primary — blue gradient pill */
.btn-primary {
  background: linear-gradient(90deg, rgba(59,130,246,0.45) 0%, rgba(8,15,30,0.95) 100%);
  color: #fff;
  border: 1px solid rgba(59,130,246,0.3);
  padding: 6px 14px 6px 10px;
  border-radius: 50px;
  box-shadow: 0 0 12px rgba(59,130,246,0.25);
}
.btn-primary:hover { background: linear-gradient(90deg, rgba(59,130,246,0.6) 0%, rgba(8,15,30,0.95) 100%); box-shadow: 0 0 18px rgba(59,130,246,0.35); }

/* Ghost — dark neutral pill */
.btn-ghost {
  background: linear-gradient(90deg, rgba(113,113,122,0.2) 0%, rgba(15,15,18,0.95) 100%);
  border: 1px solid rgba(113,113,122,0.25);
  color: var(--text2);
  padding: 6px 14px 6px 10px;
  border-radius: 50px;
}
.btn-ghost:hover { background: linear-gradient(90deg, rgba(113,113,122,0.3) 0%, rgba(15,15,18,0.95) 100%); color: var(--text); border-color: rgba(113,113,122,0.35); }

/* Danger — red gradient pill */
.btn-danger {
  background: linear-gradient(90deg, rgba(239,68,68,0.45) 0%, rgba(25,8,8,0.95) 100%);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fff;
  padding: 6px 14px 6px 10px;
  border-radius: 50px;
  box-shadow: 0 0 12px rgba(239,68,68,0.25);
}
.btn-danger:hover { background: linear-gradient(90deg, rgba(239,68,68,0.6) 0%, rgba(25,8,8,0.95) 100%); box-shadow: 0 0 18px rgba(239,68,68,0.35); }

/* Refresh — green gradient pill */
.btn-refresh {
  background: linear-gradient(90deg, rgba(34,197,94,0.45) 0%, rgba(8,25,15,0.95) 100%);
  border: 1px solid rgba(34,197,94,0.3);
  color: #fff;
  padding: 6px 14px 6px 10px;
  border-radius: 50px;
  box-shadow: 0 0 12px rgba(34,197,94,0.25);
}
.btn-refresh:hover { background: linear-gradient(90deg, rgba(34,197,94,0.6) 0%, rgba(8,25,15,0.95) 100%); box-shadow: 0 0 18px rgba(34,197,94,0.35); }

/* ─── INPUTS ────────────────────────────────────────────────────────────────── */
input, textarea, select {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
input::placeholder, textarea::placeholder {
  color: var(--text3);
}

/* ─── SEARCH BAR ────────────────────────────────────────────────────────────── */
.search-bar {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.search-bar:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

/* ─── RECHARTS ──────────────────────────────────────────────────────────────── */
.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: #1e2126 !important;
  stroke-dasharray: none !important;
}
.recharts-text { fill: var(--text2) !important; font-family: 'DM Sans', sans-serif !important; }
.recharts-wrapper, .recharts-surface { background: transparent !important; }

/* ─── FOG ATMOSPHERE ────────────────────────────────────────────────────────── */
.fog-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.fog-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}
.fog-blob:nth-child(1) { width: 700px; height: 700px; top: -200px; left: -100px; background: rgba(59,130,246,0.10); }
.fog-blob:nth-child(2) { width: 600px; height: 600px; bottom: -150px; right: -80px; background: rgba(34,197,94,0.07); }
.fog-blob:nth-child(3) { width: 400px; height: 400px; top: 35%; left: 28%; background: rgba(139,92,246,0.06); }
.fog-blob:nth-child(4) { width: 300px; height: 300px; top: 10%; right: 20%; background: rgba(59,130,246,0.05); }

/* ─── SKELETON SHIMMER ──────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 4px;
}

/* ─── ANIMATION — respect prefers-reduced-motion ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── UTILITY ───────────────────────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-blue   { color: var(--blue); }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.fw-800      { font-weight: 800; }
.fw-700      { font-weight: 700; }
.fw-600      { font-weight: 600; }
.mono        { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; }
.tabnum      { font-variant-numeric: tabular-nums; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ─── GRID LAYOUTS ─────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

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

/* ─── OVERVIEW MAIN GRID (Monthly Profit + Last 30 Days) ───────────────────── */
.overview-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .overview-main-grid { grid-template-columns: 1fr; }
}

/* ─── CRON STATUS ──────────────────────────────────────────────────────────── */
.cron-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cron-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}

.cron-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cron-dot.active {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.cron-dot.idle {
  background: var(--text2);
}

.cron-dot.error {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.cron-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.cron-time {
  font-size: 10px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

/* ─── ALERTS ───────────────────────────────────────────────────────────────── */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.alert-item.warn {
  background: var(--amber-dim);
  border: 1px solid rgba(245,158,11,0.18);
  color: var(--amber);
}

.alert-item.danger {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.18);
  color: var(--red);
}

.alert-item.info {
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.18);
  color: var(--blue);
}

.alert-item.success {
  background: var(--green-dim);
  border: 1px solid rgba(34,197,94,0.18);
  color: var(--green);
}

.alert-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.alert-text {
  line-height: 1.4;
  color: var(--text);
}

.alert-time {
  font-size: 10px;
  color: var(--text2);
  margin-top: 2px;
}

/* ─── STATUS BADGE — shipped (blue) ────────────────────────────────────────── */
.status-pill.shipped {
  background: rgba(96,165,250,0.1);
  color: #93bbfd;
  border: 1px solid rgba(96,165,250,0.2);
}

/* ─── FUN WIDGETS ──────────────────────────────────────────────────────────── */
.fun-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

/* ─── TICKER ───────────────────────────────────────────────────────────────── */
.ticker {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--green);
  line-height: 1.8;
}

.ticker-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid var(--border2);
}

.ticker-row:last-child {
  border-bottom: none;
}

.ticker-symbol {
  color: var(--text);
  font-weight: 600;
}

.ticker-val {
  color: var(--text2);
}

.ticker-val.up {
  color: var(--green);
}

.ticker-val.down {
  color: var(--red);
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}


/* ─── HAMBURGER + SIDEBAR TOGGLE ────────────────────────────────────────────── */

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
  width: 32px;
  height: 32px;
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: background-color 0.1s ease;
}
.hamburger-btn:hover span { background: var(--text); }
.hamburger-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Overlay — only on mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}

/* Close X inside sidebar — only on mobile */
.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
  display: none;
}
.sidebar-close-btn:hover { color: var(--text); }

/* ── DESKTOP (>768px): sidebar collapses with width transition ── */
@media (min-width: 769px) {
  .sidebar {
    width: 220px !important;
    min-width: 220px !important;
    overflow: hidden;
    transform: none !important;
  }
  .sidebar-overlay { display: none !important; }
  .sidebar-close-btn { display: none !important; }
  .hamburger-btn { display: none !important; }
}

/* ── MOBILE (≤768px): sidebar slides over content ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    z-index: 200;
    width: 220px;
    min-width: 220px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 6px 0 24px rgba(0,0,0,0.6);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  .sidebar.sidebar-closed {
    transform: translateX(-100%);
    width: 220px;
    min-width: 220px;
    border-right: 1px solid rgba(255,255,255,0.03);
  }
  .sidebar-close-btn { display: block; }
  .content { padding: 16px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 10px 16px; }
  .topbar-meta, .topbar-time { display: none; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-right { flex-wrap: wrap; }
  .header-clock { display: none; }
}

/* ─── IMAGE STUDIO LAYOUT ───────────────────────────────────────────────────── */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 768px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

/* Order Velocity — live pulse indicator */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}
