/* ==========================================================================
   MartBot — Ultra-Modern shadcn/AIO-Tier Glass & OLED Design System
   Customer Portal Cockpit (Self-Hosted Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
  /* Surface Palette (Deep Zinc / OLED Slate) */
  --bg-base: #09090b;
  --bg-mesh: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.12), transparent 70%),
             radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
             #09090b;

  --bg-surface: rgba(18, 18, 23, 0.72);
  --bg-card: rgba(24, 24, 30, 0.60);
  --bg-card-hover: rgba(32, 32, 42, 0.80);
  --bg-elevated: rgba(39, 39, 48, 0.65);
  --bg-muted: rgba(255, 255, 255, 0.05);

  /* Borders & Glass Refractions */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.20);
  --border-emerald: rgba(16, 185, 129, 0.40);
  --border-cyan: rgba(56, 189, 248, 0.40);

  /* Accents */
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-cyan: #38bdf8;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.14);
  --accent-rose: #f43f5e;
  --accent-rose-subtle: rgba(244, 63, 94, 0.12);

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Shadows & Glass Blurs */
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --card-shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --glass-blur: blur(20px) saturate(190%);
  --input-bg: rgba(12, 12, 16, 0.75);
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-mesh: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.08), transparent 70%),
             radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
             #f8fafc;

  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-elevated: rgba(241, 245, 249, 0.85);
  --bg-muted: rgba(0, 0, 0, 0.04);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-glass: rgba(0, 0, 0, 0.12);
  --border-highlight: rgba(0, 0, 0, 0.18);
  --border-emerald: rgba(5, 150, 105, 0.40);
  --border-cyan: rgba(2, 132, 199, 0.40);

  --accent-emerald: #059669;
  --accent-emerald-subtle: rgba(5, 150, 105, 0.10);
  --accent-cyan: #0284c7;
  --accent-cyan-subtle: rgba(2, 132, 199, 0.10);
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-rose-subtle: rgba(225, 29, 72, 0.10);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --card-shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 1);
  --glass-blur: blur(20px) saturate(180%);
  --input-bg: rgba(255, 255, 255, 0.92);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
  font-feature-settings: 'tnum' 1;
}

.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }

.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 16px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100vh;
}

/* Floating Glass Navbar Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* Status Pill & Pulse Dot */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--accent-emerald-subtle);
  border: 1px solid var(--border-emerald);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
  user-select: none;
}

.status-pill.offline {
  background: var(--accent-rose-subtle);
  border-color: var(--border-subtle);
  color: var(--accent-rose);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: #10b981;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.btn-pause {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-pause:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
}

.btn-resume {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid var(--border-emerald);
}
.btn-resume:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.btn-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover {
  text-decoration: underline;
}

/* Warnings */
.banner-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  color: #f59e0b;
  font-size: 13px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Metrics Overview Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.metric-card.clickable {
  cursor: pointer;
}

.metric-card.clickable:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  box-shadow: var(--card-shadow-hover);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.metric-card.clickable:hover .metric-icon-box {
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.metric-value-flags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  min-height: 28px;
}

.flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-footer {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font-weight: 500;
}

.metric-click-hint {
  color: var(--accent-cyan);
  font-weight: 600;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}

.metric-card.clickable:hover .metric-click-hint {
  opacity: 1;
  transform: translateX(0);
}

/* Custom CSS Vector Flags */
.flag-svg-icon {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  display: inline-block;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.flag-us { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23b22234"/><rect y="2.3" width="60" height="2.3" fill="%23fff"/><rect y="6.9" width="60" height="2.3" fill="%23fff"/><rect y="11.5" width="60" height="2.3" fill="%23fff"/><rect y="16.1" width="60" height="2.3" fill="%23fff"/><rect y="20.7" width="60" height="2.3" fill="%23fff"/><rect y="25.3" width="60" height="2.3" fill="%23fff"/><rect width="24" height="16.1" fill="%233c3b6e"/></svg>'); }
.flag-uk, .flag-gb { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><clipPath id="s"><path d="M0,0 v30 h60 v-30 z"/></clipPath><clipPath id="t"><path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/></clipPath><g clip-path="url(%23s)"><path d="M0,0 v30 h60 v-30 z" fill="%23012169"/><path d="M0,0 L60,30 M60,0 L0,30" stroke="%23fff" stroke-width="6"/><path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(%23t)" stroke="%23C8102E" stroke-width="4"/><path d="M30,0 v30 M0,15 h60" stroke="%23fff" stroke-width="10"/><path d="M30,0 v30 M0,15 h60" stroke="%23C8102E" stroke-width="6"/></g></svg>'); }
.flag-au { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%2300008b"/><path d="M0,0 h30 v15 h-30 z" fill="%23012169"/><path d="M0,0 L30,15 M30,0 L0,15" stroke="%23fff" stroke-width="3"/><path d="M15,0 v15 M0,7.5 h30" stroke="%23fff" stroke-width="5"/><path d="M15,0 v15 M0,7.5 h30" stroke="%23c8102e" stroke-width="3"/><circle cx="45" cy="8" r="2" fill="%23fff"/><circle cx="50" cy="13" r="2" fill="%23fff"/><circle cx="40" cy="18" r="2" fill="%23fff"/><circle cx="46" cy="23" r="2" fill="%23fff"/><circle cx="15" cy="22" r="3.5" fill="%23fff"/></svg>'); }
.flag-ca { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23ff0000"/><rect x="15" width="30" height="30" fill="%23ffffff"/><polygon points="30,5 33,12 39,11 36,16 39,21 33,20 30,26 27,20 21,21 24,16 21,11 27,12" fill="%23ff0000"/></svg>'); }
.flag-nz { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%2300247d"/><circle cx="45" cy="8" r="2" fill="%23cc142b"/><circle cx="50" cy="13" r="2" fill="%23cc142b"/><circle cx="40" cy="18" r="2" fill="%23cc142b"/><circle cx="46" cy="23" r="2" fill="%23cc142b"/></svg>'); }
.flag-ae { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="10" fill="%2300732f"/><rect y="10" width="60" height="10" fill="%23ffffff"/><rect y="20" width="60" height="10" fill="%23000000"/><rect width="16" height="30" fill="%23ff0000"/></svg>'); }
.flag-sg { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="15" fill="%23ed2939"/><rect y="15" width="60" height="15" fill="%23ffffff"/><circle cx="12" cy="7.5" r="4.5" fill="%23ffffff"/><circle cx="13.5" cy="7.5" r="4.5" fill="%23ed2939"/></svg>'); }
.flag-de { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="10" fill="%23000000"/><rect y="10" width="60" height="10" fill="%23dd0000"/><rect y="20" width="60" height="10" fill="%23ffce00"/></svg>'); }
.flag-jp { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23ffffff"/><circle cx="30" cy="15" r="9" fill="%23bc002d"/></svg>'); }
.flag-sa { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23006c35"/><rect x="18" y="12" width="24" height="4" fill="%23ffffff" rx="1"/><line x1="16" y1="21" x2="44" y2="21" stroke="%23ffffff" stroke-width="2"/></svg>'); }
.flag-fr { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="20" height="30" fill="%23002654"/><rect x="20" width="20" height="30" fill="%23ffffff"/><rect x="40" width="20" height="30" fill="%23ce1126"/></svg>'); }
.flag-nl { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="10" fill="%23ae1c28"/><rect y="10" width="60" height="10" fill="%23ffffff"/><rect y="20" width="60" height="10" fill="%2321468b"/></svg>'); }
.flag-it { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="20" height="30" fill="%23009246"/><rect x="20" width="20" height="30" fill="%23ffffff"/><rect x="40" width="20" height="30" fill="%23ce2b37"/></svg>'); }
.flag-es { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="7.5" fill="%23aa151b"/><rect y="7.5" width="60" height="15" fill="%23f1bf00"/><rect y="22.5" width="60" height="7.5" fill="%23aa151b"/></svg>'); }
.flag-br { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23009c3b"/><polygon points="30,3 54,15 30,27 6,15" fill="%23fedf00"/><circle cx="30" cy="15" r="6" fill="%23002776"/></svg>'); }
.flag-ru { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="10" fill="%23ffffff"/><rect y="10" width="60" height="10" fill="%230039a6"/><rect y="20" width="60" height="10" fill="%23d52b1e"/></svg>'); }
.flag-tr { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23e30a17"/><circle cx="26" cy="15" r="7" fill="%23ffffff"/><circle cx="28" cy="15" r="5.6" fill="%23e30a17"/></svg>'); }
.flag-ch { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23d52b1e"/><rect x="27" y="6" width="6" height="18" fill="%23ffffff"/><rect x="21" y="12" width="18" height="6" fill="%23ffffff"/></svg>'); }
.flag-in { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="10" fill="%23ff9933"/><rect y="10" width="60" height="10" fill="%23ffffff"/><rect y="20" width="60" height="10" fill="%23138808"/><circle cx="30" cy="15" r="3.5" fill="%23000080"/></svg>'); }
.flag-global { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2338bdf8" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>'); }

/* Workspace Split Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 480px;
}

.panel {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.panel-title-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.panel-title-cluster h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge.live-badge {
  background: var(--accent-emerald-subtle);
  border-color: var(--border-emerald);
  color: var(--accent-emerald);
  font-weight: 700;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 12px 6px 30px;
  border-radius: 8px;
  width: 220px;
  outline: none;
  transition: all 0.15s ease;
}
.search-input:focus {
  border-color: var(--border-highlight);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

/* Tab Group */
.tab-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .tab-btn.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Lead Stream Container */
.stream-container {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 280px);
}

.lead-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.lead-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.lead-card.claimed {
  border-color: var(--border-emerald);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--bg-card));
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.lead-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lead-geo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.lead-time { color: var(--text-muted); font-size: 11px; }

.lead-status-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.lead-status-pill.claimed { background: #10b981; color: #000000; }
.lead-status-pill.matched { background: var(--accent-cyan-subtle); color: var(--accent-cyan); border: 1px solid var(--border-cyan); }
.lead-status-pill.skipped { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.lead-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.lead-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.lead-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-kw-tag {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid var(--border-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.lead-latency-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.lead-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25d366;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.lead-wa-btn:hover {
  background: #25d366;
  color: #000000;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}

/* Activity Feed */
.activity-feed {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 280px);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.activity-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.activity-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  margin-top: 1px;
}

.activity-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.activity-pill.success, .activity-pill.claim { background: var(--accent-emerald-subtle); color: var(--accent-emerald); border: 1px solid var(--border-emerald); }
.activity-pill.info, .activity-pill.match { background: var(--accent-cyan-subtle); color: var(--accent-cyan); border: 1px solid var(--border-cyan); }
.activity-pill.warn, .activity-pill.skip { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.activity-pill.alert, .activity-pill.fail { background: var(--accent-rose-subtle); color: var(--accent-rose); border: 1px solid var(--border-subtle); }
.activity-pill.system { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

.activity-text {
  flex: 1;
  color: var(--text-primary);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
  margin: auto;
}

.empty-icon {
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 12px;
  max-width: 360px;
  line-height: 1.5;
}

/* Settings Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.modal-title-wrap h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.btn-close:hover { color: var(--text-primary); }

/* Modal Navigation Tabs */
.modal-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.nav-tab-btn.active {
  background: #10b981;
  color: #000000;
  border-color: #059669;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-content.active {
  display: flex;
}

.setting-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Custom Keywords / Products Box */
.custom-keywords-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
}

.setting-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.setting-title-cluster {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.setting-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* AI Quota Pill */
.ai-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--accent-cyan-subtle);
  border: 1px solid var(--border-cyan);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.quota-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.keyword-input-box {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.keyword-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  outline: none;
  transition: all 0.15s ease;
}
.keyword-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.btn-ai-resolve {
  background: #10b981;
  color: #000000;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 38px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-ai-resolve:hover {
  background: #059669;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Quick Suggestion Pills */
.quick-suggestions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.quick-suggest-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-quick-tag,
.btn-quick-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-quick-country .flag-svg-icon {
  width: 18px;
  height: 12px;
  border-radius: 2px;
}

.btn-quick-tag:hover,
.btn-quick-country:hover {
  background: var(--bg-elevated);
  border-color: var(--border-highlight);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.chips-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 10px;
}

.chips-count-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Empty Groups Box */
.empty-groups-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  background: var(--bg-muted);
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  text-align: center;
  gap: 8px;
  width: 100%;
}

.empty-groups-icon {
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 2px;
}

.empty-groups-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-groups-desc {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 460px;
  line-height: 1.5;
}

/* Medicine Groups Container */
.medicine-groups-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.medicine-group-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.medicine-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.medicine-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.medicine-group-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.medicine-group-category {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

.medicine-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.source-badge.source-ai { background: var(--accent-cyan-subtle); color: var(--accent-cyan); border: 1px solid var(--border-cyan); }
.source-badge.source-cache { background: var(--accent-emerald-subtle); color: var(--accent-emerald); border: 1px solid var(--border-emerald); }
.source-badge.source-manual { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.alias-count-pill {
  font-size: 11px;
  color: var(--text-muted);
}

.group-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
}
.group-remove-btn:hover {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
}

.medicine-group-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.alias-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 1px;
}
.alias-remove:hover { color: var(--accent-rose); }

.inline-alias-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.inline-alias-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
}
.inline-alias-input:focus {
  border-color: var(--border-highlight);
}

.resolve-status-box {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.resolve-status-box.info { background: var(--accent-cyan-subtle); color: var(--accent-cyan); border: 1px solid var(--border-cyan); }
.resolve-status-box.success { background: var(--accent-emerald-subtle); color: var(--accent-emerald); border: 1px solid var(--border-emerald); }
.resolve-status-box.error { background: var(--accent-rose-subtle); color: var(--accent-rose); border: 1px solid var(--border-subtle); }

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 80px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.chip-remove:hover {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
}

/* Worldwide Switch */
.worldwide-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.worldwide-card.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), var(--bg-card));
  border-color: var(--border-cyan);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.12);
}

.worldwide-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.worldwide-text { flex: 1; }

.worldwide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.worldwide-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.switch-toggle input:checked + .switch-slider {
  background-color: #10b981;
  border-color: #059669;
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Daily Limits Card */
.limit-control-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

.limit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.limit-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.limit-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stepper-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 8px;
}

.btn-stepper {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-stepper:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.stepper-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 28px;
  text-align: center;
}

.quick-preset-limits {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.preset-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-preset-limit {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-preset-limit:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.btn-preset-limit.active {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  border-color: #ffffff;
}

[data-theme="light"] .btn-preset-limit.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.slider-range {
  width: 100%;
  accent-color: #10b981;
  cursor: pointer;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-card-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.toggle-card-body { flex: 1; }

.toggle-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}

.btn-save { padding: 0 20px; }

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Expiry Banner */
.expiry-banner {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  padding: 10px 24px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.expiry-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Master Login Modal */
.auth-modal-overlay {
  z-index: 999999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 32px;
  border-radius: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-brand-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.auth-modal-card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 24px;
}

.auth-form-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-box {
  width: 100%;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.auth-input-box:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}

.auth-error-msg {
  font-size: 12px;
  color: var(--accent-rose);
  min-height: 18px;
  line-height: 1.3;
}

/* Account & Logout Row */
.account-license-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  gap: 12px;
}

.account-license-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-license-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.account-license-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--accent-rose);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-outline:hover {
  background: var(--accent-rose);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}

.toast.success { border-color: var(--accent-emerald); color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); color: var(--accent-rose); }
.toast.info { border-color: var(--accent-cyan); color: var(--accent-cyan); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
