/**
 * Beverage Technologies Enterprise Production Design System (v3.0 — Civic Titanium)
 * WCAG 2.1 AA / Section 508 ADA Compliant Design Tokens & Components
 * Self-contained stylesheet engineered for deterministic multi-tenant dashboards.
 */

:root {
  /* Beverage Technologies LLC - Civic Titanium Brand Core Colors */
  --brand-midnight: #090A0F;       /* Graphite Onyx Primary Dark */
  --brand-cobalt: #5B4BFF;         /* Sovereign Iris Primary Brand */
  --brand-steel: #131622;          /* Titanium Slate Elevated Dark */
  --brand-sand: #F7F7FA;           /* Warm Platinum Neutral Light */
  --brand-amber: #F97316;          /* Signal Copper Accent */
  --brand-signal: #22D3EE;         /* Electric Ice Carrier Pulse */

  /* Semantic Brand Mappings */
  --brand-primary: #5B4BFF;        /* Sovereign Iris */
  --brand-primary-hover: #4338CA;  /* Deep Sovereign Iris */
  --brand-primary-light: #EEF2FF;  /* Light Iris Tint */
  --brand-primary-dark: #090A0F;   /* Graphite Onyx */

  /* Neutral Surface Palette (Light Theme Default) */
  --bg-page: #F7F7FA;              /* Warm Platinum Neutral Light */
  --bg-surface: #ffffff;           /* White */
  --bg-surface-elevated: #f4f4f8;  /* Elevated Light Surface */
  --bg-surface-subtle: #F7F7FA;    /* Warm Platinum */

  /* High-Contrast Typography (Exceeds WCAG 1.4.3 4.5:1 ratio) */
  --text-primary: #090A0F;         /* Graphite Onyx (Exceeds 18:1 against white) */
  --text-secondary: #27272A;       /* Titanium Zinc */
  --text-muted: #52525B;           /* Readable Slate */
  --text-inverse: #ffffff;

  /* Deterministic Borders */
  --border-subtle: #e4e4e7;        /* Subtle Border */
  --border-default: #d4d4d8;       /* Neutral Border */
  --border-strong: #131622;        /* Titanium Slate Border */
  --border-focus: #5B4BFF;         /* Sovereign Iris Focus */

  /* Semantic Status Tokens */
  --status-success-bg: #ecfdf5;
  --status-success-text: #065f46;
  --status-success-border: #a7f3d0;

  --status-warning-bg: #fff7ed;
  --status-warning-text: #9a3412;
  --status-warning-border: #fed7aa;

  --status-danger-bg: #fff1f2;
  --status-danger-text: #9f1239;
  --status-danger-border: #fecdd3;

  --status-info-bg: #eef2ff;
  --status-info-text: #4338CA;
  --status-info-border: #c7d2fe;

  --status-accent-amber: #F97316;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(11, 19, 43, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(11, 19, 43, 0.08), 0 2px 4px -2px rgba(11, 19, 43, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(11, 19, 43, 0.08), 0 4px 6px -4px rgba(11, 19, 43, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(11, 19, 43, 0.1), 0 8px 10px -6px rgba(11, 19, 43, 0.06);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Typography: Inter / Plus Jakarta Sans & JetBrains Mono / Fira Code */
  --font-sans: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Consolas, Menlo, monospace;
}

/* Base Document Setup */
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Accessibility Focus Rings (WCAG 2.4.7 Focus Visible) */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Section 508 / WCAG 2.4.1 Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--brand-primary-dark);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  z-index: 1000;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.15s ease-in-out;
}
.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Component: Cards & Containers
   ========================================================================== */
.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.dash-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.dash-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-body {
  padding: 1.5rem;
}

.dash-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-subtle);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* ==========================================================================
   Component: Stat Widgets
   ========================================================================== */
.dash-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.dash-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.dash-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dash-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Component: Buttons & Controls
   ========================================================================== */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  line-height: 1.25;
}

.dash-btn-primary {
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}
.dash-btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--shadow-md);
}

.dash-btn-secondary {
  background-color: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.dash-btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.dash-btn-danger {
  background-color: #e11d48;
  color: var(--text-inverse);
}
.dash-btn-danger:hover {
  background-color: #be123c;
}

/* ==========================================================================
   Component: Status Badges
   ========================================================================== */
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-family: var(--font-mono);
}

.dash-badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.dash-badge-warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.dash-badge-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.dash-badge-info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}

/* ==========================================================================
   Component: Form Controls (WCAG 1.4.11 Non-text Contrast >= 3:1)
   ========================================================================== */
.dash-input, .dash-select, .dash-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.dash-input:focus, .dash-select:focus, .dash-textarea:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.dash-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

/* ==========================================================================
   Component: Accessible Data Tables
   ========================================================================== */
.dash-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.dash-table thead {
  background-color: var(--bg-surface-elevated);
  border-bottom: 2px solid var(--border-default);
}

.dash-table th {
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.dash-table tbody tr:hover {
  background-color: var(--bg-surface-subtle);
}

.dash-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Component: Interactive Mobile Handset Simulator (160 GSM-7 Budget)
   ========================================================================== */
.phone-mockup {
  width: 320px;
  height: 600px;
  background-color: #0f172a;
  border-radius: 40px;
  border: 10px solid #1e293b;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.phone-screen {
  flex: 1;
  background-color: #0b1120;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sms-bubble-inbound {
  align-self: flex-start;
  background-color: #334155;
  color: #f8fafc;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  font-size: 0.8125rem;
  max-width: 80%;
  line-height: 1.4;
}

.sms-bubble-outbound {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  border-bottom-right-radius: 0.25rem;
  font-size: 0.8125rem;
  max-width: 80%;
  line-height: 1.4;
  word-break: break-word;
}

.char-meter-container {
  padding: 0.75rem 1rem;
  background-color: #0f172a;
  border-top: 1px solid #1e293b;
}

.char-meter-bar-track {
  height: 6px;
  width: 100%;
  background-color: #334155;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.char-meter-bar-fill {
  height: 100%;
  background-color: #38bdf8;
  transition: width 0.15s ease, background-color 0.15s ease;
}

.char-meter-bar-fill.warning {
  background-color: #f59e0b;
}

.char-meter-bar-fill.overflow {
  background-color: #ef4444;
}

/* ==========================================================================
   Component: Accessible Floating Toasts
   ========================================================================== */
#dash-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.dash-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  animation: toast-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

.dash-toast.toast-success {
  border-left: 4px solid #10b981;
}

.dash-toast.toast-error {
  border-left: 4px solid #ef4444;
}

.dash-toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Enterprise v4.0 Layout Engine: Persistent Sidebar + High-Density Shell
   ========================================================================== */
.ent-shell {
  display: flex;
  min-height: 100vh;
  background-color: #0b0f19;
  color: #f1f5f9;
}

.ent-sidebar {
  width: 256px;
  background-color: #0d121f;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, transform 0.2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.ent-sidebar.collapsed {
  width: 72px;
}

.ent-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.ent-nav-group-title {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.375rem;
}

.ent-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}

.ent-nav-item:hover {
  background-color: #1e293b;
  color: #f8fafc;
}

.ent-nav-item.active {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}

.ent-nav-item i {
  font-size: 0.9375rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.ent-nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  background-color: #1e293b;
  color: #cbd5e1;
}

.ent-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #080c14;
}

.ent-topbar {
  height: 56px;
  background-color: rgba(13, 18, 31, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.ent-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Enterprise Data Table */
.ent-table-container {
  background-color: #0d121f;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  overflow: hidden;
}

.ent-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.ent-table th {
  background-color: #131b2e;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid #1e293b;
}

.ent-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #141c2e;
  color: #e2e8f0;
}

.ent-table tr:hover td {
  background-color: rgba(30, 41, 59, 0.4);
}

.ent-card {
  background-color: #0d121f;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: border-color 0.15s ease;
}

.ent-card:hover {
  border-color: #334155;
}

.ent-kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #f8fafc;
}

.ent-kpi-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

/* ==========================================================================
   Command Palette & Enterprise Modal Styles (Cmd+K)
   ========================================================================== */
#command-palette-modal {
  animation: cmdFadeIn 0.12s ease-out;
}

@keyframes cmdFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ent-skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: entSkeletonPulse 1.5s infinite;
  border-radius: 0.375rem;
}

@keyframes entSkeletonPulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}


