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

/* ==========================================================================
   SalesArmy Super Admin - Ultra-Minimalist Enterprise SaaS Design System
   Inspired by Linear, Stripe & Vercel
   ========================================================================== */

:root {
  /* Surface & Background (Light - Pristine Zinc) */
  --bg-body: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4F4F5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FA;
  --bg-active: #E4E4E7;

  /* Typography */
  --text-main: #09090B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --text-tertiary: #A1A1AA;

  /* Borders & Dividers */
  --border: #E4E4E7;
  --border-subtle: #F4F4F5;
  --border-focus: #18181B;

  /* Primary Brand & Accents */
  --primary: #18181B;
  --primary-text: #FFFFFF;
  --primary-hover: #27272A;
  --primary-accent: #4F46E5;
  --primary-glow: rgba(79, 70, 229, 0.15);

  /* Status Tokens */
  --emerald: #10B981;
  --emerald-bg: rgba(16, 185, 129, 0.08);
  --emerald-border: rgba(16, 185, 129, 0.2);
  --emerald-text: #059669;

  --amber: #F59E0B;
  --amber-bg: rgba(245, 158, 11, 0.08);
  --amber-border: rgba(245, 158, 11, 0.2);
  --amber-text: #D97706;

  --rose: #F43F5E;
  --rose-bg: rgba(244, 63, 94, 0.08);
  --rose-border: rgba(244, 63, 94, 0.2);
  --rose-text: #E11D48;

  --indigo: #6366F1;
  --indigo-bg: rgba(99, 102, 241, 0.08);
  --indigo-border: rgba(99, 102, 241, 0.2);
  --indigo-text: #4F46E5;

  /* Sidebar Design (Obsidian Matte) */
  --sidebar-bg: #090A0F;
  --sidebar-surface: #111319;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #A1A1AA;
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover: rgba(255, 255, 255, 0.04);
  --sidebar-active-bg: rgba(255, 255, 255, 0.07);
  --sidebar-active-border: rgba(255, 255, 255, 0.12);
  --sidebar-label: #52525B;

  /* Topbar */
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --topbar-border: #E4E4E7;

  /* Radii & Geometry */
  --radius-xs: 5px;
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Shadows (Subtle, Linear-style) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Dark Theme (Obsidian & Carbon)
   ========================================================================== */
[data-theme="dark"] {
  --bg-body: #060709;
  --bg-surface: #0E1015;
  --bg-subtle: #14171E;
  --bg-card: #0E1015;
  --bg-card-hover: #141720;
  --bg-active: #1D212B;

  --text-main: #F4F4F5;
  --text-secondary: #D4D4D8;
  --text-muted: #A1A1AA;
  --text-tertiary: #71717A;

  --border: #1F232D;
  --border-subtle: #161922;
  --border-focus: #6366F1;

  --primary: #F4F4F5;
  --primary-text: #09090B;
  --primary-hover: #FFFFFF;
  --primary-accent: #6366F1;
  --primary-glow: rgba(99, 102, 241, 0.3);

  --sidebar-bg: #040507;
  --sidebar-surface: #0A0C10;
  --sidebar-border: rgba(255, 255, 255, 0.06);

  --topbar-bg: rgba(14, 16, 21, 0.85);
  --topbar-border: #1F232D;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

code, kbd, pre {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Authentication Gate (Modal Overlay)
   ========================================================================== */
.auth-gate {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-gate.hidden {
  display: none !important;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  text-align: center;
  position: relative;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-error {
  display: none;
  background: var(--rose-bg);
  color: var(--rose-text);
  border: 1px solid var(--rose-border);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  margin-bottom: 14px;
}

.auth-error.show {
  display: block;
}

.auth-demo-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  text-align: left;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(161, 161, 170, 0.2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(161, 161, 170, 0.4);
}

/* SVG Micro-Icons Base */
.icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 20px; height: 20px; }

/* ==========================================================================
   Sidebar Navigation (Obsidian Studio)
   ========================================================================== */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.logo-badge {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #18181B 0%, #27272A 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

[data-theme="dark"] .logo-badge {
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  border-color: rgba(99, 102, 241, 0.4);
}

.brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-info h2 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.brand-info span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #71717A;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sidebar-label);
  text-transform: uppercase;
  padding: 14px 10px 6px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: var(--radius-xs);
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

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

.nav-item.active {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 0 2px 2px 0;
  background: #6366F1;
  box-shadow: 0 0 8px #6366F1;
}

.nav-item svg,
.nav-item .icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  min-width: 16px;
  stroke-width: 1.75;
  color: #71717A;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-item:hover svg,
.nav-item.active svg,
.nav-item:hover .icon,
.nav-item.active .icon {
  color: #FFFFFF;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #A1A1AA;
  font-family: var(--font-mono);
}

.nav-item.active .nav-badge {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.admin-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: #27272A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

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

.admin-name {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 10px;
  color: #71717A;
}

.btn-sidebar-icon {
  background: transparent;
  border: none;
  color: #71717A;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-sidebar-icon:hover {
  color: var(--rose-text);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   Main Wrapper & Topbar
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.breadcrumbs-root {
  font-weight: 500;
  color: var(--text-muted);
}

.breadcrumbs-sep {
  color: var(--text-tertiary);
  font-size: 12px;
}

.page-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

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

/* Status Pill with Pulsing Dot */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-pill:hover {
  border-color: var(--text-tertiary);
}

.dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse-ring 2.5s infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Content Area & Sections
   ========================================================================== */
.content-area {
  padding: 24px;
  flex: 1;
}

.view-section {
  display: none;
  animation: sectionFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   Linear-Style Executive Metric Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.stat-card:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-sm);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card-icon {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.stat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-weight: 600;
}

.stat-indicator.emerald {
  background: var(--emerald-bg);
  color: var(--emerald-text);
  border: 1px solid var(--emerald-border);
}

.stat-indicator.indigo {
  background: var(--indigo-bg);
  color: var(--indigo-text);
  border: 1px solid var(--indigo-border);
}

.stat-indicator.neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ==========================================================================
   Command Action Strip
   ========================================================================== */
.command-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.command-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.command-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-tertiary);
}

.command-btn.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: transparent;
  font-weight: 600;
}

.command-btn.primary:hover {
  background: var(--primary-hover);
  color: var(--primary-text);
}

/* ==========================================================================
   Panels & Containers
   ========================================================================== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

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

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

.panel-body {
  padding: 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-text);
}

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-tertiary);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: var(--radius-xs);
  gap: 5px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

th {
  background: var(--bg-subtle);
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  background: var(--bg-surface);
  transition: background 0.12s ease;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--bg-card-hover);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-active, .badge-delivered {
  background: var(--emerald-bg);
  color: var(--emerald-text);
  border-color: var(--emerald-border);
}

.badge-pending, .badge-trial, .badge-warning {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-color: var(--amber-border);
}

/* Scheduled coupons, info states (also used by order / notification badges). */
.badge-blue {
  background: var(--indigo-bg);
  color: var(--indigo-text);
  border-color: var(--indigo-border);
}

.badge-expired {
  background: var(--rose-bg);
  color: var(--rose-text);
  border-color: var(--rose-border);
}

.badge-flat, .badge-pct, .badge-freemium {
  background: var(--indigo-bg);
  color: var(--indigo-text);
  border-color: var(--indigo-border);
}

.code-pill {
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   Telemetry Card (Modern Sleek Diagnostics)
   ========================================================================== */
.telemetry-card {
  background: #090A0F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

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

.telemetry-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818CF8;
}

.telemetry-meta h4 {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.telemetry-meta p {
  font-size: 11.5px;
  color: #A1A1AA;
}

.telemetry-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.telemetry-pill {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #D4D4D8;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 7px 11px;
  font-size: 12.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  transition: all 0.15s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

/* ==========================================================================
   Enterprise Search Box Design System (Linear / Stripe / Vercel Inspired)
   ========================================================================== */

.panel-search-bar {
  padding: 14px 20px 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background 0.2s ease;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.search-input-wrap:hover {
  border-color: var(--border-focus);
  background: var(--bg-surface);
}

.search-input-wrap:focus-within {
  border-color: var(--primary-accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input-wrap:focus-within .search-icon {
  color: var(--primary-accent);
}

.search-input-wrap input.search-input,
.search-input-wrap input.form-control {
  width: 100%;
  height: 38px;
  padding: 8px 65px 8px 38px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.4;
}

.search-input-wrap input.search-input::placeholder,
.search-input-wrap input.form-control::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
  transition: color 0.15s ease;
}

.search-input-wrap:focus-within input::placeholder {
  color: var(--text-muted);
}

.search-input-wrap .search-clear-btn {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--bg-active);
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.search-input-wrap .search-clear-btn:hover {
  background: var(--rose-bg);
  color: var(--rose-text);
}

.search-input-wrap .search-kbd-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  pointer-events: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.search-input-wrap:focus-within .search-kbd-shortcut {
  opacity: 0.4;
}

/* Global Topbar Omnisearch */
.topbar-omnisearch {
  position: relative;
  width: 320px;
  max-width: 100%;
}

@media (max-width: 900px) {
  .topbar-omnisearch {
    display: none;
  }
}

.topbar-omnisearch .search-input-wrap {
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  height: 34px;
}

.topbar-omnisearch .search-input-wrap input.search-input {
  height: 32px;
  font-size: 12.5px;
  padding-left: 36px !important;
}

.omnisearch-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 340px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  overflow-y: auto;
  z-index: 999;
  display: none;
}

.omnisearch-dropdown.active {
  display: block;
  animation: fadeInDown 0.15s ease;
}

.omnisearch-group-title {
  padding: 8px 14px 4px 14px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.omnisearch-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 1px solid var(--border-subtle);
}

.omnisearch-item:last-child {
  border-bottom: none;
}

.omnisearch-item:hover,
.omnisearch-item.selected {
  background: var(--bg-card-hover);
}

.omnisearch-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.omnisearch-item-info {
  flex: 1;
  min-width: 0;
}

.omnisearch-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.omnisearch-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.omnisearch-item-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* iOS Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background-color: var(--primary-accent);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.feature-toggle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}

.feature-toggle-card:hover {
  border-color: var(--text-tertiary);
}

.feature-toggle-card.disabled {
  opacity: 0.6;
}

.feature-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.feature-info p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-inner-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

/* Modal Overlay & Dialog Cards */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.modal, .modal-card {
  background: #FFFFFF !important;
  color: #09090B !important;
  border: 1px solid #E4E4E7 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .modal,
[data-theme="dark"] .modal-card {
  background: #111319 !important;
  color: #F4F4F5 !important;
  border: 1px solid #242938 !important;
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #E4E4E7 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF !important;
  position: sticky;
  top: 0;
  z-index: 10;
}

[data-theme="dark"] .modal-header {
  background: #111319 !important;
  border-bottom: 1px solid #242938 !important;
}

.modal-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #09090B !important;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .modal-title {
  color: #FFFFFF !important;
}

.modal-body {
  padding: 24px;
  flex: 1;
  background: #FFFFFF !important;
  color: #09090B !important;
}

[data-theme="dark"] .modal-body {
  background: #111319 !important;
  color: #E4E4E7 !important;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #E4E4E7 !important;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #F8FAFC !important;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

[data-theme="dark"] .modal-footer {
  background: #0A0C10 !important;
  border-top: 1px solid #242938 !important;
}

/* Modal Inputs & Controls (Solid background and clear text) */
.modal-card input,
.modal-card select,
.modal-card textarea {
  background: #FFFFFF !important;
  color: #09090B !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
}

[data-theme="dark"] .modal-card input,
[data-theme="dark"] .modal-card select,
[data-theme="dark"] .modal-card textarea {
  background: #181B24 !important;
  color: #F4F4F5 !important;
  border: 1px solid #2C3242 !important;
}

.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
  border-color: #2563EB !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

[data-theme="dark"] .modal-card input:focus,
[data-theme="dark"] .modal-card select:focus,
[data-theme="dark"] .modal-card textarea:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
}

.modal-card label,
.modal-card .form-label {
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  margin-bottom: 6px !important;
  display: block;
}

[data-theme="dark"] .modal-card label,
[data-theme="dark"] .modal-card .form-label {
  color: #94A3B8 !important;
}

.modal-card .info-banner,
.modal-card .plan-tier-pill {
  border-radius: 8px;
}

.plan-tab-btn {
  background: var(--bg-subtle) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.plan-tab-btn:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-main) !important;
}

.plan-tab-btn.active {
  background: #18181B !important;
  color: #FFFFFF !important;
  border-color: #18181B !important;
}

[data-theme="dark"] .plan-tab-btn.active {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
}

/* ==========================================================================
   Agencies & Tenants - Modern SaaS Enterprise UI
   ========================================================================== */

/* Top Metrics Grid */
.tenant-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

@media (max-width: 640px) {
  .tenant-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.tenant-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tenant-metric-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tenant-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.tenant-metric-content {
  flex: 1;
  min-width: 0;
}

.tenant-metric-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.tenant-metric-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-main);
  line-height: 1.2;
}

.tenant-metric-subtext {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Table Header Sorting */
th.sortable-col {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

th.sortable-col:hover {
  background: var(--bg-subtle) !important;
  color: var(--text-main);
}

th.sortable-col.sort-active {
  color: var(--primary-accent);
}

.sort-indicator {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 6px;
  display: inline-block;
  transition: all 0.15s ease;
}

.sort-indicator.active {
  color: var(--primary-accent);
  font-weight: 800;
  transform: scale(1.15);
}

/* Toolbar Sort Control Widget */
.tenant-sort-widget {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  height: 32px;
  transition: all 0.15s ease;
}

.tenant-sort-widget:hover {
  border-color: var(--border-focus);
}

.btn-sort-dir {
  border: none;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-sort-dir:hover {
  background: var(--bg-active);
  color: var(--primary-accent);
}

/* Controls Toolbar */
.tenant-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tenant-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tenant-filters-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tenant-pill-btn {
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tenant-pill-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.tenant-pill-btn.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

[data-theme="dark"] .tenant-pill-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
  border-color: #3B82F6;
}

.tenant-pill-btn .pill-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .tenant-pill-btn .pill-count {
  background: rgba(255, 255, 255, 0.12);
}

.tenant-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

/* View Mode Toggle */
.view-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: 2px;
  gap: 2px;
}

.view-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
}

.view-mode-btn:hover {
  color: var(--text-main);
}

.view-mode-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* Cards Grid View */
.tenant-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  padding: 20px;
}

@media (max-width: 640px) {
  .tenant-cards-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

.tenant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tenant-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tenant-card.suspended {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.02);
}

.tenant-card.suspended::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rose);
}

.tenant-card-header {
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tenant-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.tenant-card-main {
  flex: 1;
  min-width: 0;
}

.tenant-card-firm {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tenant-card-prop {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-card-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tenant-card-stats-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.tenant-card-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tenant-card-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.tenant-card-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.tenant-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.tenant-contact-chip:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
}

.tenant-contact-chip.whatsapp {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
}

.tenant-contact-chip.whatsapp:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10B981;
}

.tenant-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Modal Inspector & Details Styling */
.tenant-inspector-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.tenant-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tenant-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.tenant-detail-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.tenant-detail-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.tenant-detail-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.shipping-label-preview {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 2px solid #0F172A;
  border-radius: 8px;
  padding: 20px;
  font-family: var(--font-sans);
}

.shipping-label-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.shipping-barcode {
  height: 44px;
  background: repeating-linear-gradient(90deg, #000 0, #000 2px, transparent 2px, transparent 4px, #000 4px, #000 7px, transparent 7px, transparent 10px);
  margin: 12px 0 6px 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 440px;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #18181B;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  opacity: 0;
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.success {
  border-left: 4px solid var(--emerald);
}

.toast-item.danger,
.toast-item.error {
  border-left: 4px solid var(--rose);
}

.toast-item.warning {
  border-left: 4px solid var(--amber);
}

.toast-item.info {
  border-left: 4px solid var(--indigo);
}

[data-theme="dark"] .toast-item {
  background: #111319;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.8);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #18181B;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(40px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .toast {
  background: #0E1015;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.15s ease;
}

.plan-card:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-sm);
}

.plan-card.featured {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 18px;
  background: var(--indigo);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.plan-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.plan-price {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 12px 0 6px 0;
}

.plan-price span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 95;
  }
  .sidebar-backdrop.active {
    display: block;
  }
}

/* Dynamic Order Line Item Rows */
.order-line-row {
  display: grid;
  grid-template-columns: 2fr 70px 100px 75px 100px 36px;
  gap: 8px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
}

@media (max-width: 650px) {
  .order-line-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}

/* Clean Thermal & Invoice Print Layout */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .sidebar, .topbar, .modal-footer, .command-strip, .auth-gate, .toast, .toast-container {
    display: none !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
  }
  .modal-card {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}



/* ============================================== */
/* EXECUTIVE DASHBOARD & INTERACTIVE CHARTS STYLES */
/* ============================================== */

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dash-toolbar-left,
.dash-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dash-filter-group {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 3px;
}

.dash-filter-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-filter-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.dash-filter-btn.active {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dash-filter-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
}

.dash-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-text);
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
  margin-top: 20px;
}

.dash-charts-grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .dash-charts-grid,
  .dash-charts-grid-equal {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

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

.chart-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.chart-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-container-wrap {
  position: relative;
  width: 100%;
  height: 270px;
  flex: 1;
}

.chart-container-wrap-donut {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center-metric {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.donut-center-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.health-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.health-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.stat-micro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.dash-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.dash-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-tab-btn:hover {
  color: var(--text-main);
}

.dash-tab-btn.active {
  color: #3B82F6;
  border-bottom-color: #3B82F6;
}

@keyframes spin-sync {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinning {
  animation: spin-sync 0.8s linear infinite;
}

/* Dashboard User-Friendly Chart Legends & Breakdown Cards */
.chart-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.chart-summary-item {
  display: flex;
  flex-direction: column;
}

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

.chart-summary-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
  font-family: var(--font-mono, monospace);
}

.chart-summary-val.emerald {
  color: #10B981;
}

.chart-summary-val.indigo {
  color: #3B82F6;
}

.chart-donut-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.donut-breakdown-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.donut-breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-breakdown-card.delivered .donut-breakdown-dot { background: #10B981; }
.donut-breakdown-card.processing .donut-breakdown-dot { background: #3B82F6; }
.donut-breakdown-card.dispatched .donut-breakdown-dot { background: #F59E0B; }
.donut-breakdown-card.cancelled .donut-breakdown-dot { background: #F43F5E; }

.donut-breakdown-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.donut-breakdown-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.chart-insight-footer {
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(59, 130, 246, 0.15);
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-plans-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.plan-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.plan-pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.plan-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plan-pill.enterprise .plan-pill-dot { background: #10B981; }
.plan-pill.grow .plan-pill-dot { background: #8B5CF6; }
.plan-pill.startup .plan-pill-dot { background: #3B82F6; }
.plan-pill.freemium .plan-pill-dot { background: #F59E0B; }

.plan-pill-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-pill-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  padding: 1px 6px;
  background: var(--bg-card);
  border-radius: 4px;
  margin-left: 6px;
}

/* ==========================================================================
   Tenant Drill-Down & Billing Styles
   ========================================================================== */
.drilldown-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.drilldown-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.drilldown-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.drilldown-firm-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.25;
}

.drilldown-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

.drilldown-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.drilldown-section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}

.drilldown-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}


/* ==========================================================================
   In-App Broadcast Center & Interactive Smartphone Simulator
   ========================================================================== */

.broadcast-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1080px) {
  .broadcast-grid-layout {
    grid-template-columns: 1fr;
  }
}

.composer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

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

.composer-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Priority Type Selector Pills */
.priority-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.priority-pill {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.priority-pill:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-card);
}

.priority-pill.active {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.08);
  color: #1D4ED8;
  box-shadow: 0 0 0 1px #3B82F6;
}

.priority-pill[data-type="warning"].active {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  color: #B45309;
  box-shadow: 0 0 0 1px #F59E0B;
}

.priority-pill[data-type="critical"].active {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
  color: #B91C1C;
  box-shadow: 0 0 0 1px #EF4444;
}

.priority-pill[data-type="festive"].active {
  border-color: #8B5CF6;
  background: rgba(139, 92, 246, 0.1);
  color: #6D28D9;
  box-shadow: 0 0 0 1px #8B5CF6;
}

.priority-pill[data-type="success"].active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  box-shadow: 0 0 0 1px #10B981;
}

/* Custom iOS Toggle Switches */
.toggle-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.toggle-switch-meta {
  display: flex;
  flex-direction: column;
}

.toggle-switch-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

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

.custom-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.custom-switch input:checked + .switch-slider {
  background-color: #10B981;
}

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

/* Preset Template Cards */
.presets-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.preset-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-card-item:hover {
  border-color: #3B82F6;
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.preset-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ==========================================================================
   SMARTPHONE SIMULATOR ENCLOSURE (Interactive Hardware Chassis)
   ========================================================================== */
.phone-simulator-sticky {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-control-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 340px;
  margin-bottom: 12px;
  gap: 8px;
}

.phone-view-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
}

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

.phone-tab-btn:hover {
  color: var(--text-main);
}

.phone-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Hardware Chassis Frame */
.smartphone-device {
  width: 328px;
  height: 660px;
  background: #111827;
  border-radius: 46px;
  padding: 10px;
  position: relative;
  box-shadow:
    0 0 0 2px #374151,
    0 0 0 5px #1F2937,
    0 24px 50px -12px rgba(0, 0, 0, 0.45),
    0 12px 24px -8px rgba(0, 0, 0, 0.3);
  user-select: none;
  box-sizing: border-box;
}

/* Hardware Buttons */
.smartphone-device::before {
  content: "";
  position: absolute;
  top: 100px;
  left: -7px;
  width: 3px;
  height: 48px;
  background: #374151;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 65px 0 #374151;
}

.smartphone-device::after {
  content: "";
  position: absolute;
  top: 130px;
  right: -7px;
  width: 3px;
  height: 64px;
  background: #374151;
  border-radius: 0 2px 2px 0;
}

/* Screen Glass Container */
.smartphone-screen {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease;
}

.smartphone-screen.dark-mode {
  background: #0B0F19;
  color: #F8FAFC;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 22px;
  background: #000000;
  border-radius: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.dynamic-island-cam {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #111827;
  border: 1px solid #1F2937;
}

.dynamic-island-sensor {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #064E3B;
  opacity: 0.8;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 38px;
  padding: 10px 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #0F172A;
  z-index: 50;
  box-sizing: border-box;
}

.smartphone-screen.dark-mode .phone-status-bar {
  color: #F8FAFC;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
}

/* Phone App Bar */
.phone-app-bar {
  padding: 6px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 40;
}

.smartphone-screen.dark-mode .phone-app-bar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.phone-agency-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.phone-agency-avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phone-agency-name {
  font-size: 12px;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  line-height: 1.2;
}

.smartphone-screen.dark-mode .phone-agency-name {
  color: #F8FAFC;
}

.phone-agency-sub {
  font-size: 9.5px;
  color: #64748B;
}

/* ==========================================================================
   LIVE MOBILE BROADCAST BANNER (Interactive & Animated)
   ========================================================================== */
.phone-broadcast-slot {
  position: relative;
  z-index: 45;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-banner-widget {
  margin: 8px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid transparent;
  animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-banner-widget.banner-dismissed {
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Banner Theme Styles */
.mobile-banner-widget.info {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border-color: #BFDBFE;
  color: #1E3A8A;
}
.smartphone-screen.dark-mode .mobile-banner-widget.info {
  background: linear-gradient(135deg, #1E3A8A, #172554);
  border-color: #2563EB;
  color: #DBEAFE;
}

.mobile-banner-widget.warning {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border-color: #FDE68A;
  color: #78350F;
}
.smartphone-screen.dark-mode .mobile-banner-widget.warning {
  background: linear-gradient(135deg, #78350F, #451A03);
  border-color: #D97706;
  color: #FEF3C7;
}

.mobile-banner-widget.critical {
  background: linear-gradient(135deg, #FFF1F2, #FFE4E6);
  border-color: #FECDD3;
  color: #881337;
}
.smartphone-screen.dark-mode .mobile-banner-widget.critical {
  background: linear-gradient(135deg, #881337, #4C0519);
  border-color: #E11D48;
  color: #FFE4E6;
}

.mobile-banner-widget.festive {
  background: linear-gradient(135deg, #FAF5FF, #F3E8FF);
  border-color: #E9D5FF;
  color: #581C87;
}
.smartphone-screen.dark-mode .mobile-banner-widget.festive {
  background: linear-gradient(135deg, #581C87, #3B0764);
  border-color: #9333EA;
  color: #F3E8FF;
}

.mobile-banner-widget.success {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border-color: #A7F3D0;
  color: #064E3B;
}
.smartphone-screen.dark-mode .mobile-banner-widget.success {
  background: linear-gradient(135deg, #064E3B, #022C22);
  border-color: #059669;
  color: #D1FAE5;
}

.banner-headline-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.banner-title-text {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 4px;
}

.banner-dismiss-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.6;
  line-height: 1;
  transition: opacity 0.15s ease;
  color: inherit;
}

.banner-dismiss-btn:hover {
  opacity: 1;
}

.banner-message-text {
  font-size: 10px;
  line-height: 1.35;
  margin-top: 3px;
  opacity: 0.95;
}

.banner-action-btn {
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.smartphone-screen.dark-mode .banner-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.banner-action-btn:hover {
  background: rgba(0, 0, 0, 0.14);
}

.banner-undo-chip {
  margin: 6px 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  font-size: 9.5px;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* Phone In-App Screen Content */
.phone-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-stat-pill-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.phone-mini-stat {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px;
}

.smartphone-screen.dark-mode .phone-mini-stat {
  background: #1E293B;
  border-color: #334155;
}

.phone-mini-stat-label {
  font-size: 8.5px;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 700;
}

.phone-mini-stat-val {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 2px;
}

.smartphone-screen.dark-mode .phone-mini-stat-val {
  color: #F8FAFC;
}

.phone-mini-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px;
}

.smartphone-screen.dark-mode .phone-mini-card {
  background: #1E293B;
  border-color: #334155;
}

.phone-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 10px;
}

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

/* Phone Bottom Nav */
.phone-bottom-bar {
  height: 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #FFFFFF;
  padding-bottom: 6px;
  box-sizing: border-box;
}

.smartphone-screen.dark-mode .phone-bottom-bar {
  background: #0B0F19;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.phone-nav-icon-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #94A3B8;
  font-size: 8px;
  font-weight: 600;
}

.phone-nav-icon-btn.active {
  color: #3B82F6;
}

/* In-Phone Feedback Toast / Notification Dropdown */
.phone-heads-up-alert {
  position: absolute;
  top: 38px;
  left: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: white;
  border-radius: 14px;
  padding: 10px 12px;
  z-index: 90;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: headsUpDrop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes headsUpDrop {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-toast-feedback {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  z-index: 85;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  animation: toastFade 0.2s ease;
  white-space: nowrap;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================== */
/* AUDIT TRAIL COMPONENT STYLES                   */
/* ============================================== */
.audit-filter-pill {
  transition: all 0.15s ease;
  font-size: 11.5px;
}

.audit-filter-pill.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
}
