/* ============================================
   VIN NEST CEO DASHBOARD — Design System
   Premium Dark Gold Luxury Theme
   ============================================ */

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

/* ─── CSS Variables ─── */
:root {
  /* Brand Colors */
  --gold-50: #FFF9E6;
  --gold-100: #FFF0BF;
  --gold-200: #FFE699;
  --gold-300: #FFD966;
  --gold-400: #FFCC33;
  --gold-500: #D4A017;
  --gold-600: #B8860B;
  --gold-700: #9A7209;
  --gold-800: #7C5B07;
  --gold-900: #5E4405;

  /* Dark Theme */
  --bg-primary: #0A0A0F;
  --bg-secondary: #12121A;
  --bg-card: #1A1A25;
  --bg-card-hover: #22222F;
  --bg-elevated: #252535;
  --bg-input: #16161F;

  /* Surfaces with gold accent */
  --surface-gold: linear-gradient(135deg, rgba(212,160,23,0.08), rgba(184,134,11,0.03));
  --surface-gold-hover: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(184,134,11,0.06));
  --border-gold: rgba(212,160,23,0.15);
  --border-gold-active: rgba(212,160,23,0.4);

  /* Text */
  --text-primary: #F0EDE6;
  --text-secondary: #9B97A0;
  --text-muted: #65636B;
  --text-gold: #D4A017;
  --text-gold-light: #FFD966;

  /* Status Colors */
  --success: #34D399;
  --success-bg: rgba(52,211,153,0.1);
  --warning: #FBBF24;
  --warning-bg: rgba(251,191,36,0.1);
  --danger: #F87171;
  --danger-bg: rgba(248,113,113,0.1);
  --info: #60A5FA;
  --info-bg: rgba(96,165,250,0.1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 20px rgba(212,160,23,0.15);
  --shadow-glow: 0 0 40px rgba(212,160,23,0.08);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Light Themes ─── */
body.theme-light-white {
  --bg-primary: #F3F4F6;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9FAFB;
  --bg-elevated: #F9FAFB;
  --bg-input: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --border-gold: rgba(212,160,23,0.3);
  --border-gold-active: rgba(212,160,23,0.6);
  --surface-gold: linear-gradient(135deg, rgba(212,160,23,0.1), rgba(212,160,23,0.05));
  --surface-gold-hover: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(212,160,23,0.08));
}
body.theme-light-ocean {
  --bg-primary: #E0F2FE;
  --bg-secondary: #F0F9FF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F9FF;
  --bg-elevated: #F0F9FF;
  --bg-input: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border-gold: rgba(14,165,233,0.3);
  --border-gold-active: rgba(14,165,233,0.6);
  --surface-gold: linear-gradient(135deg, rgba(14,165,233,0.1), rgba(14,165,233,0.05));
  --surface-gold-hover: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(14,165,233,0.08));
  --text-gold: #0284C7;
  --text-gold-light: #38BDF8;
}
body.theme-light-teal {
  --bg-primary: #CCFBF1;
  --bg-secondary: #F0FDFA;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0FDFA;
  --bg-elevated: #F0FDFA;
  --bg-input: #FFFFFF;
  --text-primary: #134E4A;
  --text-secondary: #115E59;
  --text-muted: #0F766E;
  --border-gold: rgba(20,184,166,0.3);
  --border-gold-active: rgba(20,184,166,0.6);
  --surface-gold: linear-gradient(135deg, rgba(20,184,166,0.1), rgba(20,184,166,0.05));
  --surface-gold-hover: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(20,184,166,0.08));
  --text-gold: #0D9488;
  --text-gold-light: #2DD4BF;
}

body[class*="theme-light-"] .header {
  background: rgba(255,255,255, 0.9);
  border-bottom: 1px solid var(--border-gold);
}
body[class*="theme-light-"] .data-table thead th {
  background: var(--bg-secondary);
}
body[class*="theme-light-"] .stat-card-icon.gold { background: var(--surface-gold); color: var(--text-gold); }


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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(212,160,23,0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212,160,23,0.4);
}

/* ─── Layout Container ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-base);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-gold);
  min-height: 72px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-gold);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.sidebar-brand span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--surface-gold-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--surface-gold);
  color: var(--text-gold);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--gold-500);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.nav-item .nav-label {
  font-size: 0.9rem;
  flex: 1;
}

.nav-item .nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-gold);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--surface-gold-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-600), var(--gold-800));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
}

.user-info .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.user-info .role {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Sidebar Collapsed State ─── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info {
  display: none;
}
.sidebar.collapsed .sidebar-header {
  padding: var(--space-md) 0;
  justify-content: center;
}
.sidebar.collapsed .nav-item {
  padding: 12px;
  justify-content: center;
}
.sidebar.collapsed .nav-item .nav-icon {
  margin: 0;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-base);
  min-width: 0;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ─── Header ─── */
.header {
  height: var(--header-height);
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-search {
  position: relative;
}

.header-search input {
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 36px;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 220px;
  transition: all var(--transition-fast);
  outline: none;
  font-family: inherit;
}

.header-search input:focus {
  border-color: var(--border-gold-active);
  width: 280px;
  box-shadow: var(--shadow-gold);
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  font-size: 1.1rem;
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-gold);
  border-color: var(--border-gold);
}

.header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-primary);
}

/* ─── Page Content ─── */
.page-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1400px;
  width: 100%;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* ─── Stat Cards ─── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card-icon.gold { background: rgba(212,160,23,0.12); color: var(--gold-400); }
.stat-card-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card-icon.purple { background: rgba(167,139,250,0.1); color: #A78BFA; }

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-card-trend.up { color: var(--success); background: var(--success-bg); }
.stat-card-trend.down { color: var(--danger); background: var(--danger-bg); }

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Cards / Panels ─── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.card:hover {
  border-color: rgba(255,255,255,0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Two Column Layout ─── */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* ─── Table ─── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  background: var(--bg-card);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr.order-hover-active,
.data-table tbody tr:hover {
  background: var(--surface-gold-hover) !important;
}

.data-table tbody td {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.data-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: rgba(212,160,23,0.12); color: var(--gold-400); }
.badge-purple { background: rgba(167,139,250,0.1); color: #A78BFA; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: #fff;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212,160,23,0.25);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-gold);
}

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

.btn-ghost:hover {
  background: var(--surface-gold-hover);
  color: var(--text-gold);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-gold-active);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239B97A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ─── Chart Container ─── */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ─── Activity / Timeline ─── */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  position: relative;
}

.activity-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 38px;
  bottom: -8px;
  width: 1px;
  background: rgba(255,255,255,0.06);
}

.activity-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-content p strong {
  color: var(--text-primary);
}

.activity-content .time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Progress Bar ─── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
  transition: width var(--transition-slow);
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-spring);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s var(--transition-spring);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 400px;
}

/* ─── Quick Actions Floating ─── */
.fab {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(212,160,23,0.3);
  transition: all var(--transition-fast);
  z-index: 90;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(212,160,23,0.4);
}

/* ─── Loading Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ─── Page Transition ─── */
.page-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* ─── Sparkle effect for gold elements ─── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.text-shimmer {
  background: linear-gradient(90deg, var(--gold-400), var(--gold-200), var(--gold-400));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* ─── Product Card ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.product-card-img {
  height: 160px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: var(--space-md);
}

.product-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-gold);
}

.product-card-stock {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-md); }
}

/* ─── Tab System ─── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--text-gold);
  border-bottom-color: var(--gold-500);
}

/* ─── Calendar Grid ─── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-header-cell {
  padding: var(--space-sm);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.calendar-cell {
  min-height: 80px;
  padding: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-cell:hover {
  border-color: var(--border-gold);
}

.calendar-cell.today {
  border-color: var(--gold-500);
  background: rgba(212,160,23,0.05);
}

.calendar-cell .day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.calendar-cell.today .day-num {
  color: var(--text-gold);
}

.calendar-event {
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Tooltip ─── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  border: 1px solid rgba(255,255,255,0.1);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Pulse animation for live indicators ─── */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}

/* ─── Kanban Board & CRM Styles ─── */
.b2b-kanban-board {
  min-height: 500px;
}
.kanban-column {
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: border-color var(--transition-fast);
}
.kanban-column:hover {
  border-color: rgba(255,255,255,0.08);
}
.kanban-cards {
  padding: 5px;
  border-radius: 6px;
}
.kanban-card {
  user-select: none;
}
.badge {
  font-variant-numeric: tabular-nums;
}

/* ─── TikTok Range Slider styling ─── */
#ttSimDiscountRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff0050;
  cursor: pointer;
  box-shadow: 0 0 10px #ff0050;
  transition: transform var(--transition-fast);
}
#ttSimDiscountRange::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
#ttSimDiscountRange::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff0050;
  cursor: pointer;
  box-shadow: 0 0 10px #ff0050;
  border: none;
  transition: transform var(--transition-fast);
}
#ttSimDiscountRange::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* ─── CFO Dashboard Styles ─── */
.cfo-card {
  border-left: 4px solid var(--text-muted);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 140px;
}
.cfo-card .stat-card-value {
  margin-top: auto;
}
.cfo-card.cfo-good {
  border-left-color: var(--success) !important;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.08);
}
.cfo-card.cfo-warning {
  border-left-color: var(--warning) !important;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.08);
}
.cfo-card.cfo-risk {
  border-left-color: var(--danger) !important;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.08);
}

.cfo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  text-transform: uppercase;
  width: fit-content;
  align-self: flex-start;
}
.cfo-badge.bg-good {
  background: var(--success-bg);
  color: var(--success);
}
.cfo-badge.bg-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.cfo-badge.bg-risk {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-cfo-good {
  background: var(--success-bg);
  color: var(--success);
  font-weight: bold;
}
.badge-cfo-warning {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: bold;
}
.badge-cfo-risk {
  background: var(--danger-bg);
  font-weight: bold;
}

/* ─── DATA TABLES ENHANCEMENTS ─── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-md);
  /* Hide scrollbar for cleaner UI */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.table-responsive::-webkit-scrollbar {
  display: none;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.data-table th.sortable:hover {
  color: var(--gold-400);
  background-color: rgba(255,255,255,0.05);
}

/* ─── WAR ROOM WIDGET ─── */
.war-room-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.war-room-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--gold-400), var(--danger));
}

.war-room-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.war-room-header {
  display: flex;
  flex-direction: column;
}

.war-room-title {
  color: var(--text-primary);
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.war-room-countdown {
  color: var(--text-gold);
  margin: 8px 0 0 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.war-room-days {
  font-size: 1.8rem;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
  line-height: 1.2;
}

.war-room-progress-container {
  flex: 1;
  min-width: 300px;
}

.war-room-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.war-room-target {
  color: var(--text-primary);
  font-weight: 600;
}

.war-room-percent {
  color: var(--success);
  font-weight: bold;
  font-size: 1.1rem;
}

.war-room-progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

.war-room-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-500), var(--success));
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-full);
}

.war-room-progress-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
}

.war-room-current {
  color: var(--text-secondary);
}

.war-room-edit {
  color: var(--text-gold);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.war-room-edit:hover {
  color: var(--gold-400);
}

/* ─── HIGHLIGHT ORDER ROWS ─── */
.data-table tbody tr.order-row:hover,
.data-table tbody tr.order-hover-active {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="theme-light-white"] .data-table tbody tr.order-row:hover,
[data-theme="theme-light-white"] .data-table tbody tr.order-hover-active {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="theme-light-ocean"] .data-table tbody tr.order-row:hover,
[data-theme="theme-light-ocean"] .data-table tbody tr.order-hover-active {
  background-color: rgba(2, 132, 199, 0.06) !important;
}

[data-theme="theme-light-teal"] .data-table tbody tr.order-row:hover,
[data-theme="theme-light-teal"] .data-table tbody tr.order-hover-active {
  background-color: rgba(13, 148, 136, 0.06) !important;
}
