/* ==========================================================================
   Jerry-Midnight: Music Artist & Event Management System
   Theme: Midnight Stage Aesthetic & Modern Studio Design System
   ========================================================================== */

:root {
  /* Midnight Dark Theme (Default) */
  --bg-main: #0a0d14;
  --bg-surface: #111726;
  --bg-surface-elevated: #182033;
  --bg-surface-glass: rgba(17, 23, 38, 0.82);
  --bg-input: #0f1422;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(168, 85, 247, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  /* Vibrant Stage Accents */
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --primary-subtle: rgba(139, 92, 246, 0.15);
  
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --danger: #f43f5e;
  --danger-subtle: rgba(244, 63, 94, 0.15);
  --info: #38bdf8;
  --info-subtle: rgba(56, 189, 248, 0.15);
  
  /* Layout Dimensions */
  --sidebar-width: 270px;
  --sidebar-collapsed-width: 72px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35), 0 4px 12px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.45), 0 8px 16px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --font-sans: 'Plus Jakarta Sans', 'Kantumruy Pro', 'Battambang', 'Noto Sans Khmer', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-khmer: 'Kantumruy Pro', 'Battambang', 'Noto Sans Khmer', sans-serif;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Light Theme: Modern Ultra-Clean Pure White & Crisp Indigo Design System
   ========================================================================== */
[data-theme="light"] {
  /* Pure Crisp White & Modern Neutral Palette */
  --bg-main: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f9fafb;
  --bg-surface-glass: rgba(255, 255, 255, 0.96);
  --bg-input: #ffffff;
  
  /* Modern Crisp Light Borders */
  --border-color: #e5e7eb;
  --border-hover: #6366f1;
  
  /* Deep High-Contrast Sharp Typography */
  --text-main: #111827;
  --text-muted: #374151;
  --text-subtle: #6b7280;
  
  /* Modern Vibrant Indigo Accent */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.18);
  --primary-subtle: rgba(99, 102, 241, 0.08);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] body {
  background-color: #ffffff !important;
  color: #111827;
}

/* Light Theme Component Overrides for Pure White Minimalist Look */
[data-theme="light"] .app-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .app-header,
[data-theme="light"] .top-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .card,
[data-theme="light"] .table-responsive,
[data-theme="light"] .package-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .filter-bar,
[data-theme="light"] .modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .custom-table th {
  background: #f9fafb;
  color: #1f2937;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .custom-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .custom-table tbody tr:hover {
  background-color: #f8fafc;
}

[data-theme="light"] .form-control,
[data-theme="light"] .search-box input,
[data-theme="light"] select.form-control {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .search-box input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #0f172a;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-secondary:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
  color: #020617;
}

[data-theme="light"] .settings-tabs-nav {
  background: #f9fafb !important;
  border: 1px solid var(--border-color) !important;
}

[data-theme="light"] .settings-tab-btn:hover {
  background: #ffffff !important;
  color: #111827 !important;
}

[data-theme="light"] .nav-link {
  color: #334155;
  font-weight: 600;
}

[data-theme="light"] .nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .nav-link.active {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  font-weight: 700;
}

[data-theme="light"] .badge-gray {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-weight: 700;
}

[data-theme="light"] .badge-emerald {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 700;
}

[data-theme="light"] .badge-amber {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
}

[data-theme="light"] .badge-indigo {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-weight: 700;
}

[data-theme="light"] .badge-rose {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-weight: 700;
}

[data-theme="light"] .badge-blue {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 700;
}

/* Base Reset & Core Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Custom Minimalist Capsule Scrollbar (Matches Screenshot)
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.45);
}

::-webkit-scrollbar-thumb:active {
  background-color: rgba(255, 255, 255, 0.65);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Light Mode Overrides */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.22);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:active {
  background-color: rgba(0, 0, 0, 0.65);
}

/* Firefox Standard Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

[data-theme="light"] * {
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p {
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* App Layout Wrapper */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  z-index: 100;
  transition: width 0.28s cubic-bezier(0.2, 0, 0, 1), transform 0.28s cubic-bezier(0.2, 0, 0, 1);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-header {
  height: var(--header-height);
  flex-shrink: 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
  box-sizing: border-box;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}

.brand-info {
  overflow: hidden;
  white-space: nowrap;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 2px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
  position: relative;
}

.nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: var(--text-subtle);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover i {
  color: var(--primary);
  transform: scale(1.1);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.22) 0%, rgba(139, 92, 246, 0.06) 100%);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--primary);
}

.nav-counter {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  box-sizing: border-box;
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: capitalize;
}

.btn-logout-icon {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #f87171;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.btn-logout-icon:hover {
  color: #ffffff;
  background: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: scale(1.05);
}

.btn-logout-icon:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Desktop Collapsed Sidebar (Icon-Only Mode)
   ========================================================================== */
/* ==========================================================================
   Desktop Collapsed Sidebar (Icon-Only Mode)
   ========================================================================== */
@media (min-width: 1025px) {
  html.sidebar-collapsed .app-sidebar,
  .sidebar-collapsed .app-sidebar,
  .app-sidebar.collapsed,
  .app-layout.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
  }

  html.sidebar-collapsed .app-main,
  .sidebar-collapsed .app-main,
  .app-layout.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
    max-width: calc(100% - var(--sidebar-collapsed-width));
  }

  html.sidebar-collapsed .sidebar-header,
  .sidebar-collapsed .sidebar-header,
  .app-sidebar.collapsed .sidebar-header,
  .app-layout.sidebar-collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
  }

  html.sidebar-collapsed .brand-info,
  .sidebar-collapsed .brand-info,
  .app-sidebar.collapsed .brand-info,
  .app-layout.sidebar-collapsed .brand-info {
    display: none;
  }

  html.sidebar-collapsed .brand-icon,
  .sidebar-collapsed .brand-icon,
  .app-sidebar.collapsed .brand-icon,
  .app-layout.sidebar-collapsed .brand-icon {
    width: 38px;
    height: 38px;
  }

  html.sidebar-collapsed .sidebar-content,
  .sidebar-collapsed .sidebar-content,
  .app-sidebar.collapsed .sidebar-content,
  .app-layout.sidebar-collapsed .sidebar-content {
    padding: 1.25rem 0.4rem;
    gap: 0.65rem;
    overflow-x: hidden;
  }

  html.sidebar-collapsed .nav-group-title,
  .sidebar-collapsed .nav-group-title,
  .app-sidebar.collapsed .nav-group-title,
  .app-layout.sidebar-collapsed .nav-group-title {
    font-size: 0;
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0.35rem;
    padding: 0;
    overflow: hidden;
  }

  html.sidebar-collapsed .nav-list,
  .sidebar-collapsed .nav-list,
  .app-sidebar.collapsed .nav-list,
  .app-layout.sidebar-collapsed .nav-list {
    gap: 0.35rem;
    align-items: center;
  }

  html.sidebar-collapsed .nav-link,
  .sidebar-collapsed .nav-link,
  .app-sidebar.collapsed .nav-link,
  .app-layout.sidebar-collapsed .nav-link {
    padding: 0.65rem 0;
    justify-content: center;
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-left: none;
  }

  html.sidebar-collapsed .nav-link.active,
  .sidebar-collapsed .nav-link.active,
  .app-sidebar.collapsed .nav-link.active,
  .app-layout.sidebar-collapsed .nav-link.active {
    border-left: none;
    background: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
  }

  html.sidebar-collapsed .nav-link.active i,
  .sidebar-collapsed .nav-link.active i,
  .app-sidebar.collapsed .nav-link.active i,
  .app-layout.sidebar-collapsed .nav-link.active i {
    color: #ffffff;
  }

  html.sidebar-collapsed .nav-link span:not(.nav-counter),
  .sidebar-collapsed .nav-link span:not(.nav-counter),
  .app-sidebar.collapsed .nav-link span:not(.nav-counter),
  .app-layout.sidebar-collapsed .nav-link span:not(.nav-counter) {
    display: none;
  }

  html.sidebar-collapsed .nav-link i,
  .sidebar-collapsed .nav-link i,
  .app-sidebar.collapsed .nav-link i,
  .app-layout.sidebar-collapsed .nav-link i {
    font-size: 1.2rem;
    width: auto;
    margin: 0;
  }

  html.sidebar-collapsed .nav-counter,
  .sidebar-collapsed .nav-counter,
  .app-sidebar.collapsed .nav-counter,
  .app-layout.sidebar-collapsed .nav-counter {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 8px;
    height: 8px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: 0;
    border: 2px solid var(--bg-surface);
  }

  html.sidebar-collapsed .sidebar-footer,
  .sidebar-collapsed .sidebar-footer,
  .app-sidebar.collapsed .sidebar-footer,
  .app-layout.sidebar-collapsed .sidebar-footer {
    padding: 0.75rem 0.35rem;
  }

  html.sidebar-collapsed .user-mini-card,
  .sidebar-collapsed .user-mini-card,
  .app-sidebar.collapsed .user-mini-card,
  .app-layout.sidebar-collapsed .user-mini-card {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }

  html.sidebar-collapsed .user-details,
  .sidebar-collapsed .user-details,
  .app-sidebar.collapsed .user-details,
  .app-layout.sidebar-collapsed .user-details {
    display: none;
  }

  html.sidebar-collapsed .btn-logout-icon,
  .sidebar-collapsed .btn-logout-icon,
  .app-sidebar.collapsed .btn-logout-icon,
  .app-layout.sidebar-collapsed .btn-logout-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    margin: 0 auto;
  }

  /* Floating Tooltips on Hover for Collapsed Mode */
  html.sidebar-collapsed .nav-link[data-tooltip]:hover::after,
  .sidebar-collapsed .nav-link[data-tooltip]:hover::after,
  .app-sidebar.collapsed .nav-link[data-tooltip]:hover::after,
  .app-layout.sidebar-collapsed .nav-link[data-tooltip]:hover::after,
  html.sidebar-collapsed .btn-logout-icon[data-tooltip]:hover::after,
  .sidebar-collapsed .btn-logout-icon[data-tooltip]:hover::after,
  .app-sidebar.collapsed .btn-logout-icon[data-tooltip]:hover::after,
  .app-layout.sidebar-collapsed .btn-logout-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    left: calc(var(--sidebar-collapsed-width) + 12px);
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1000;
    pointer-events: none;
    line-height: 1.3;
    animation: tooltipFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
  }
}

/* ==========================================================================
   Main Content Area & Top Header
   ========================================================================== */
.app-main {
  flex: 1 1 0%;
  min-width: 0;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s cubic-bezier(0.2, 0, 0, 1), width 0.28s cubic-bezier(0.2, 0, 0, 1);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.top-header {
  height: var(--header-height);
  flex-shrink: 0;
  background-color: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  padding-left: max(2rem, env(safe-area-inset-left));
  padding-right: max(2rem, env(safe-area-inset-right));
  gap: 1rem;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-toggle-btn {
  display: inline-flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.header-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.header-page-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
}

.lang-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-theme-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
  flex-shrink: 0;
}

.header-user-profile .user-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

.header-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* Header Profile Dropdown Component */
.header-profile-dropdown-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 0.25rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-color);
}

.header-user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-main);
}

.header-user-profile-btn:hover,
.header-user-profile-btn.active {
  background: var(--bg-surface-hover);
  border-color: var(--border-color);
}

.header-user-profile-btn .user-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  flex-shrink: 0;
}

.header-user-profile-btn .user-avatar img,
.user-mini-card .user-avatar img,
.user-avatar img,
.table-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-dropdown-caret {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.header-user-profile-btn.active .profile-dropdown-caret {
  transform: rotate(180deg);
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  max-width: calc(100vw - 20px);
  background: var(--bg-surface-elevated, #1a202c);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 99999;
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.profile-dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.dropdown-user-info-card {
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.dropdown-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.dropdown-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropdown-user-text {
  min-width: 0;
  flex: 1;
}

.dropdown-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dropdown-badge-wrap {
  margin-top: 5px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-super-admin {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-admin {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-manager {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-artist {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.dropdown-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.dropdown-links-list {
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-link-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--text-main);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-link-btn:hover {
  background: var(--bg-surface-hover);
  color: #ffffff;
}

.dropdown-link-btn i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.dropdown-link-btn .link-label-group {
  display: flex;
  flex-direction: column;
}

.dropdown-link-btn .link-title {
  font-weight: 600;
  line-height: 1.25;
}

.dropdown-link-btn .link-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.content-container {
  flex: 1;
  padding: 1.75rem 2rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   Page Headers & Action Bars
   ========================================================================== */
.page-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-title-group h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-title-group p {
  font-size: 0.92rem;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Card Components & Glass Panels
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title i {
  color: var(--primary);
}

/* ==========================================================================
   Stat Widgets (Dashboard)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--primary));
  border-radius: 4px 0 0 4px;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--stat-bg, var(--primary-subtle));
  color: var(--stat-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.85rem 1.65rem;
  font-size: 1.02rem;
  border-radius: var(--radius-md);
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-indigo {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-gray {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  position: relative;
}

.table-responsive::-webkit-scrollbar {
  height: 7px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-surface-elevated, #182033);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #8b5cf6);
}

.custom-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.custom-table th {
  background: var(--bg-surface-elevated);
  padding: 0.9rem 1.15rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr {
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-label span.req {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  padding: 0.72rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control,
textarea {
  min-height: 110px;
  resize: vertical;
  font-family: 'Kantumruy Pro', 'Plus Jakarta Sans', 'Battambang', 'Noto Sans Khmer', sans-serif;
  font-size: 1.12rem;
  line-height: 1.85;
  padding: 0.85rem 1.1rem;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Khmer Typography & Senior-Friendly High-Legibility Form Styling
   Specifically optimized for tablets (HONOR MagicOS / Android / iPad) & desktop
   ========================================================================== */
#bookingNotesInput,
#creatorNotes,
#modalPayNotes,
#dpmNotes,
#artistAddress,
#invoiceNotesDefault,
#invoicePaymentTerms,
.notes-input,
.booking-item-desc,
.item-desc-input,
.item-desc,
.khmer-readable {
  font-family: 'Kantumruy Pro', 'Plus Jakarta Sans', 'Battambang', 'Noto Sans Khmer', sans-serif !important;
  font-size: 1.15rem !important; /* ~18.4px, beautifully large & legible for elderly users */
  line-height: 1.85 !important;  /* prevents Khmer subscripts (ជើង) and accents from clipping */
  letter-spacing: 0.015em;
}

/* Tablet / Touch Screen (HONOR MagicOS / Android Tablet / iPad) Accessibility */
@media (max-width: 1024px) {
  .form-control,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  select.form-control {
    font-size: 1.05rem !important;
    padding: 0.78rem 1rem !important;
  }

  textarea.form-control,
  #bookingNotesInput,
  #creatorNotes,
  #modalPayNotes,
  #dpmNotes {
    font-size: 1.18rem !important; /* ~19px on tablet screens */
    line-height: 1.9 !important;
    min-height: 130px;
  }
}

.form-control::placeholder,
textarea.form-control::placeholder {
  font-family: 'Kantumruy Pro', 'Plus Jakarta Sans', 'Battambang', sans-serif;
  opacity: 0.65;
  font-size: 0.98rem;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input-addon {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-subtle);
  font-weight: 600;
}

.input-group .form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Search and Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.search-box input {
  padding-left: 2.5rem;
}

.filter-options {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.show .modal-dialog {
  transform: translateY(0) scale(1);
}

@keyframes modalNudge {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.018); }
}

.modal-dialog.modal-nudge {
  animation: modalNudge 0.22s ease;
}

.modal-dialog.modal-lg {
  max-width: 880px;
}

.modal-dialog.modal-xl {
  max-width: 1100px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--text-main);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

.toast-icon {
  font-size: 1.25rem;
  margin-top: 2px;
}
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.toast-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Pricing & Packages Card Grid (Section 20)
   ========================================================================== */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.package-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.package-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.package-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-gold {
  border-color: rgba(245, 158, 11, 0.65);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-red {
  border-color: rgba(239, 68, 68, 0.65);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-blue {
  border-color: rgba(6, 182, 212, 0.65);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-green {
  border-color: rgba(16, 185, 129, 0.65);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-purple {
  border-color: rgba(139, 92, 246, 0.65);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-surface) 100%);
}

.package-card.highlight-rose {
  border-color: rgba(244, 63, 94, 0.65);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, var(--bg-surface) 100%);
}

.package-badge-popular,
.package-badge-pill {
  position: absolute;
  top: -12px;
  right: 1.5rem;
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.package-badge-pill.color-gold,
.package-badge-popular {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.package-badge-pill.color-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
}

.package-badge-pill.color-blue {
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

.package-badge-pill.color-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.package-badge-pill.color-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}

.package-badge-pill.color-rose {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45);
}

.package-header {
  margin-bottom: 1.25rem;
}

.package-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.package-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 1rem 0;
}

.package-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.package-duration {
  font-size: 0.88rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.package-services-list {
  list-style: none;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.package-services-list li {
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--text-main);
}

.package-services-list li i {
  color: var(--success);
  margin-top: 3px;
  flex-shrink: 0;
}

.package-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Calendar Styles
   ========================================================================== */
.calendar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.calendar-month-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border-color);
}

.calendar-weekday {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--bg-surface-elevated);
  border-right: 1px solid var(--border-color);
}

.calendar-weekday:last-child {
  border-right: none;
}

.calendar-day {
  min-height: 110px;
  padding: 0.65rem;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
}

.calendar-day:hover {
  background: rgba(139, 92, 246, 0.06);
}

.calendar-day:active {
  background: rgba(139, 92, 246, 0.12);
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day.other-month {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.15);
}

.calendar-day.other-month:hover {
  opacity: 0.85;
  background: rgba(139, 92, 246, 0.05);
}

.calendar-day.today {
  background: rgba(139, 92, 246, 0.08);
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.day-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.calendar-day.today .day-number {
  color: var(--primary);
  display: inline-block;
  background: var(--primary-subtle);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  text-align: center;
  line-height: 24px;
}

.calendar-day .day-add-icon {
  font-size: 0.68rem;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  background: rgba(139, 92, 246, 0.12);
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover .day-add-icon {
  opacity: 1;
  transform: scale(1.08);
}

@media (max-width: 768px) {
  .calendar-day .day-add-icon {
    opacity: 0.6;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
  }
}

.calendar-event-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--primary);
  margin-bottom: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--text-main);
  transition: var(--transition);
}

.calendar-event-pill:hover {
  filter: brightness(1.2);
  transform: translateX(2px);
}

.calendar-event-pill.status-confirmed { border-color: var(--success); }
.calendar-event-pill.status-pending { border-color: var(--warning); }
.calendar-event-pill.status-completed { border-color: var(--info); }
.calendar-event-pill.status-cancelled { border-color: var(--danger); text-decoration: line-through; }

/* Conflict Warning Alert */
.conflict-alert {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid var(--danger);
  color: #fb7185;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

/* ==========================================================================
   Utility Classes & Display Helpers
   ========================================================================== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (max-width: 768px) {
  .d-none-sm { display: none !important; }
  .d-block-sm { display: block !important; }
  .d-flex-sm { display: flex !important; }
}

@media (min-width: 769px) {
  .d-none-md { display: none !important; }
  .d-block-md { display: block !important; }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  html.sidebar-collapsed .app-sidebar,
  .sidebar-collapsed .app-sidebar,
  .app-sidebar.collapsed,
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--sidebar-width) !important;
    transform: translateX(-100%) !important;
    z-index: 100 !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: none !important;
  }
  
  html.sidebar-collapsed .app-sidebar.mobile-open,
  .sidebar-collapsed .app-sidebar.mobile-open,
  .app-sidebar.collapsed.mobile-open,
  .app-sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) !important;
  }
  
  html.sidebar-collapsed .app-main,
  .sidebar-collapsed .app-main,
  .app-layout.sidebar-collapsed .app-main,
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .content-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem 1.25rem;
    box-sizing: border-box;
  }
  
  .sidebar-toggle-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .content-container {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  .page-action-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-day {
    min-height: 70px;
    padding: 0.35rem;
  }
}

/* Mobile & iPhone Pro Max viewports */
@media (max-width: 480px) {
  .top-header {
    padding: 0 0.85rem;
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-right {
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .lang-btn .lang-text {
    display: none;
  }
}
