/* ==========================================================================
   FUTURE DESK - UAE BUSINESS SETUP & LEGAL CONSULTANCY
   EXECUTIVE DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* ==========================================================================
   THEME PALETTES:
   1. DARK LUXURY (NAVY & GOLD) - DEFAULT
   2. WHITE & GOLD COMBINATION - EXECUTIVE ELEGANCE
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  /* Color Palette - Dark Luxury */
  --bg-dark: #070B16;
  --bg-surface: #0E1626;
  --bg-surface-elevated: #141F36;
  --bg-surface-hover: #1A2845;
  --bg-card: rgba(18, 28, 48, 0.7);
  --bg-glass: rgba(14, 22, 38, 0.75);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(224, 169, 109, 0.3);
  --border-gold-focus: #E0A96D;

  /* Accent Colors */
  --gold-primary: #D4AF37;
  --gold-light: #F3C969;
  --gold-dark: #AA820A;
  --gold-gradient: linear-gradient(135deg, #F5D061 0%, #D4AF37 50%, #AA820A 100%);
  
  --emerald-gov: #10B981;
  --emerald-light: #34D399;
  --emerald-bg: rgba(16, 185, 129, 0.12);

  --blue-accent: #3B82F6;
  --blue-bg: rgba(59, 130, 246, 0.12);

  --purple-accent: #8B5CF6;
  --purple-bg: rgba(139, 92, 246, 0.12);

  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Text Colors */
  --text-white: #FFFFFF;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-gold: #F3C969;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.25);

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

:root[data-theme="light"] {
  /* Color Palette - White & Gold Luxury */
  --bg-dark: #F6F8FB;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-surface-hover: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.95);

  --border-subtle: rgba(212, 175, 55, 0.22);
  --border-gold: rgba(212, 175, 55, 0.42);
  --border-gold-focus: #C59B27;

  /* Accent Colors */
  --gold-primary: #C59B27;
  --gold-light: #B48C14;
  --gold-dark: #8C6A08;
  --gold-gradient: linear-gradient(135deg, #F3C969 0%, #D4AF37 50%, #B88E14 100%);

  --emerald-gov: #059669;
  --emerald-light: #10B981;
  --emerald-bg: rgba(5, 150, 105, 0.1);

  --blue-accent: #2563EB;
  --blue-bg: rgba(37, 99, 235, 0.08);

  --purple-accent: #7C3AED;
  --purple-bg: rgba(124, 58, 237, 0.08);

  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.08);

  /* Text Colors */
  --text-white: #0F172A; /* Main headings obsidian */
  --text-primary: #1E293B; /* High readability body text */
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-gold: #99730E; /* Deep metallic gold text */

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 36px rgba(212, 175, 55, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.25);
}
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #070B16 0%, #0B1120 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 1100;
  padding: 8px 0;
}

.header-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-container {
  background: #FFFFFF;
  padding: 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.35);
  height: 44px;
  width: 44px;
  flex-shrink: 0;
}

.brand-logo-svg,
.track-brand-logo {
  height: 100%;
  width: 100%;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}

/* Header Contact Pills */
.header-contact-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 20px;
  color: var(--text-white);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}

.contact-pill:hover {
  background: var(--bg-surface-hover);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.contact-pill-text small {
  color: var(--text-muted);
  font-family: var(--font-main);
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  margin-right: 2px;
}

.contact-pill-wa {
  border-color: rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.1);
  color: #34D399;
}

.contact-pill-wa:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: #25D366;
  color: #FFFFFF;
}

.contact-pill-web {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #60A5FA;
}

.contact-pill-web:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3B82F6;
  color: #FFFFFF;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
}

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

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

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--gold-gradient);
  color: #070B16;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

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

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

.btn-ghost:hover {
  color: var(--text-white);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-whatsapp {
  background: #25D366;
  color: #070B16;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: #22BF5B;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: #FFFFFF;
}

.btn-link-danger {
  background: none;
  border: none;
  color: #F87171;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.btn-link-danger:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

.btn-group-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ==========================================================================
   QUICK STATS BAR
   ========================================================================== */
.quick-stats-bar {
  background: rgba(14, 22, 38, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.quick-stats-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

.text-gov {
  color: var(--emerald-light) !important;
}

.text-gold {
  color: var(--gold-light) !important;
}

.text-grand {
  color: #FBBF24 !important;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

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

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.main-wrapper {
  padding-top: 24px;
  padding-bottom: 60px;
}

.app-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 28px;
  align-items: start;
}

.catalog-section,
.catalog-column {
  min-width: 0;
  width: 100%;
}

.calculator-sidebar,
.quotation-sidebar {
  min-width: 0;
  width: 100%;
}

/* Mobile & Tablet Tab Switcher (Hidden on Desktop) */
.mobile-view-tabs {
  display: none;
}

/* Floating Mobile Quick Action Bar (Hidden on Desktop) */
.floating-mobile-bar {
  display: none;
}

.mobile-quote-back-bar {
  display: none;
}

@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 1fr 420px;
    gap: 20px;
  }
}

/* ==========================================================================
   TABLET & MOBILE CALIBRATION (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  .main-wrapper {
    padding-top: 12px;
    padding-bottom: 110px; /* Space for floating bottom bar */
  }

  .app-layout {
    display: block;
    gap: 0;
  }

  /* Sticky Segmented Tab Switcher on Tablet & Mobile */
  .mobile-view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(11, 17, 32, 0.96);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .m-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .m-tab-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
  }

  .m-tab-btn.active {
    background: var(--gold-gradient);
    color: #070B16;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
  }

  .m-tab-badge {
    background: #10B981;
    color: #FFFFFF;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    font-family: var(--font-mono);
  }

  .m-tab-btn.active .m-tab-badge {
    background: #070B16;
    color: var(--gold-light);
  }

  /* View Visibility Toggling on Tablet & Mobile */
  .catalog-section {
    display: block;
  }

  .calculator-sidebar {
    display: none;
    position: static;
    top: auto;
    width: 100%;
  }

  /* When Quotation Tab is Active */
  .app-layout.show-quote-mobile .catalog-section {
    display: none !important;
  }

  .app-layout.show-quote-mobile .calculator-sidebar {
    display: block !important;
  }

  /* Back to Services Bar in Quote View */
  .mobile-quote-back-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .btn-mobile-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-gold);
    color: var(--gold-light);
    min-height: 40px;
    cursor: pointer;
  }

  .btn-mobile-back:hover {
    background: var(--gold-primary);
    color: #070B16;
  }

  .mobile-quote-count-pill {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 4px 12px;
    border-radius: 14px;
  }

  /* Filter Pills: Smooth Native Horizontal Swipe on Tablet & Mobile */
  .tabs-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    gap: 8px;
  }

  .tabs-pills::-webkit-scrollbar {
    display: none;
  }

  .pill-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.82rem;
    min-height: 40px;
  }

  /* Expand quote items list fully on tablet/mobile */
  .selected-items-list {
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Touch-friendly Steppers */
  .btn-qty {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.1rem !important;
  }

  .qty-input {
    width: 38px !important;
    font-size: 0.95rem !important;
  }

  .btn-remove-item {
    font-size: 1.2rem !important;
    padding: 6px 10px !important;
    min-width: 36px;
    min-height: 36px;
  }

  /* Floating Mobile Action Bar */
  .floating-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-gold);
    padding: 10px 18px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.25s ease-out;
  }

  .floating-mobile-bar.visible {
    display: flex !important;
  }

  /* Hide floating bar if already on quote view */
  .app-layout.show-quote-mobile ~ .floating-mobile-bar {
    display: none !important;
  }

  .floating-bar-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .floating-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .floating-total {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--gold-light);
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
  }

  .btn-floating-quote {
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 14px rgba(212, 175, 55, 0.45);
    white-space: nowrap;
    min-height: 44px;
  }

  /* Tablet grid: 2 columns */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* ==========================================================================
   SMARTPHONES & MOBILE PHONES (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .container {
    padding: 0 12px;
  }

  /* Header on Mobile: Unstuck so viewport isn't compromised */
  .app-header {
    padding: 10px 0;
    position: relative;
    top: auto;
    z-index: 1100;
  }

  .header-container {
    padding: 0 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand-block {
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-logo-container {
    height: 38px;
    width: 38px;
    padding: 3px;
  }

  .brand-logo-svg {
    height: 100%;
    width: 100%;
  }

  .brand-tag {
    font-size: 0.6rem;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-sub {
    font-size: 0.68rem;
    max-width: 100%;
  }

  .header-contact-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .header-contact-pills::-webkit-scrollbar {
    display: none;
  }

  .contact-pill {
    padding: 6px 10px;
    font-size: 0.74rem;
    flex-shrink: 0;
    min-height: 34px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.76rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .header-actions .user-menu-wrapper {
    width: 100%;
  }

  .header-actions .user-menu-pill {
    width: 100%;
    min-height: 38px;
    padding: 6px 12px;
    box-sizing: border-box;
    justify-content: space-between;
  }

  /* Quick Stats Bar on Mobile: 2x2 Grid */
  .quick-stats-bar {
    padding: 8px 0;
  }

  .quick-stats-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
  }

  .stat-label {
    font-size: 0.64rem;
  }

  .stat-value {
    font-size: 0.98rem;
  }

  /* Service Cards: 1 column on Mobile */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .service-card {
    padding: 14px;
  }

  .card-title {
    font-size: 1.02rem;
  }

  .card-desc {
    -webkit-line-clamp: 2;
    margin-bottom: 12px;
    font-size: 0.8rem;
  }

  .btn-card-add {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .btn-card-edit {
    min-height: 42px;
    min-width: 42px;
    padding: 8px 12px;
  }

  /* Input fields: 16px to prevent iOS auto-zoom */
  input, select, textarea {
    font-size: 16px !important;
  }

  .catalog-controls {
    padding: 14px;
    gap: 12px;
  }

  .search-box {
    max-width: 100%;
  }

  .search-box input {
    padding: 11px 36px 11px 38px;
    font-size: 16px !important;
  }

  /* Calculator Sidebar panel on mobile */
  .calculator-panel {
    padding: 14px 12px;
  }

  .quote-item-row {
    padding: 10px 8px;
  }

  .quote-item-controls {
    gap: 6px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-group-dual {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Modal on Mobile: Modern Native Bottom-Sheet */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .glass-modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    margin: 0;
  }

  .modal-form {
    padding: 16px;
    gap: 12px;
  }

  .modal-header {
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 10;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   CATALOG CONTROLS (SEARCH & FILTERS)
   ========================================================================== */
.controls-card,
.catalog-controls {
  padding: 20px 0 8px 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.search-box input {
  box-sizing: border-box;
  width: 100%;
  padding: 13px 40px 13px 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.btn-icon-clear,
.btn-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-icon-clear:hover,
.btn-clear-search:hover {
  color: var(--gold-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.tabs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.15);
}

.pill-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.pill-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.catalog-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

.bullet {
  color: var(--border-subtle);
}

/* ==========================================================================
   SERVICE CARDS GRID
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(212, 175, 55, 0.08);
  transform: translateY(-2px);
}

.service-card.selected {
  border-color: var(--gold-primary);
  background: rgba(20, 30, 52, 0.85);
  box-shadow: 0 0 0 1px var(--gold-primary), var(--shadow-gold);
}

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

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.badge-dubai {
  background: rgba(59, 130, 246, 0.18);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-abudhabi {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-freezone {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-all {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-category {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.35;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pricing Breakdown Inside Card */
.pricing-chips-row {
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.chip-item {
  display: flex;
  flex-direction: column;
}

.chip-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.chip-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}

.chip-total-row {
  grid-column: span 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.chip-total-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.chip-total-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

/* Card Action Footer */
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-card-add {
  flex: 1;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
  padding: 8px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-card-add:hover {
  background: var(--gold-primary);
  color: #070B16;
}

.btn-card-add.is-added {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
}

.btn-card-edit {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-card-edit:hover {
  color: var(--text-white);
  border-color: var(--text-secondary);
}

/* ==========================================================================
   CALCULATOR SIDEBAR & QUOTATION SUMMARY
   ========================================================================== */
.calculator-sidebar {
  position: sticky;
  top: 92px;
}

.calculator-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(212, 175, 55, 0.05);
}

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

.quote-header-title h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
}

.quote-ref-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-gold);
}

.quote-header-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* View Mode Selector (Client Mode vs Internal Staff Mode) */
.view-mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  background: rgba(10, 16, 30, 0.6);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

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

.view-mode-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}

.view-mode-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.view-mode-btn:hover {
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.2);
}

.view-mode-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Internal Staff Panel in Quotation */
.internal-staff-panel {
  background: rgba(16, 24, 42, 0.95);
  border: 1px dashed var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 6px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.internal-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

/* Client Details Card */
.client-details-card {
  background: rgba(10, 16, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.client-details-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--bg-surface-elevated);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}

.client-details-header:hover {
  background: var(--bg-surface-hover);
  color: var(--text-white);
}

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

.toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.client-details-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.client-details-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-details-body.collapsed {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-size: 0.82rem;
  font-family: var(--font-main);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
}

/* Selected Items Section */
.selected-items-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.selected-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.selected-items-list {
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom Scrollbar */
.selected-items-list::-webkit-scrollbar {
  width: 5px;
}

.selected-items-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.selected-items-list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 10px;
}

.selected-items-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Empty State */
.empty-quote-state {
  text-align: center;
  padding: 30px 16px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(10, 16, 28, 0.4);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty-quote-state h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-quote-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 260px;
  margin: 0 auto;
}

/* Item Selected Row */
.quote-item-row {
  background: rgba(14, 22, 38, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.quote-item-row:hover {
  border-color: rgba(212, 175, 55, 0.3);
}

.quote-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.quote-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.3;
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
}

.btn-remove-item:hover {
  color: var(--danger);
}

/* Inline Edit Row inside Quote Item */
.quote-item-controls {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.item-qty-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-qty {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.btn-qty:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.qty-input {
  width: 32px;
  border: none;
  background: transparent;
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-price-edit {
  display: flex;
  flex-direction: column;
}

.input-price-edit label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.price-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.price-field-wrap input {
  width: 100%;
  padding: 4px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.price-field-wrap input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.quote-item-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding-top: 4px;
  border-top: 1px dashed var(--border-subtle);
}

.subtotal-label {
  color: var(--text-muted);
}

.subtotal-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-light);
}

/* ==========================================================================
   CALCULATION BREAKDOWN
   ========================================================================== */
.calculation-breakdown-card {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}

.calc-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.calc-value {
  font-weight: 700;
  color: var(--text-white);
  font-size: 0.95rem;
}

/* Discount & VAT Controls */
.discount-control-box,
.vat-control-box {
  background: rgba(10, 16, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discount-header,
.vat-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
}

.checkbox-container input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--gold-primary);
}

.discount-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.discount-inputs select,
.discount-inputs input {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-size: 0.78rem;
  padding: 4px 6px;
}

.discount-inputs input {
  width: 70px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.text-discount {
  color: #F87171 !important;
}

.vat-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  padding: 2px 6px;
  border-radius: 4px;
}

.vat-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.text-vat {
  color: #93C5FD;
}

.calc-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Grand Total Box */
.grand-total-box {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(14, 22, 38, 0.8) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.08);
}

.grand-total-meta {
  display: flex;
  flex-direction: column;
}

.grand-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-light);
}

.grand-currency {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.grand-total-amount {
  font-size: 1.55rem;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.quote-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* ==========================================================================
   MODAL DIALOG (ADD / EDIT SERVICE)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.glass-modal,
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(212, 175, 55, 0.15);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 17, 32, 0.9);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold-light);
}

.modal-close,
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover,
.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

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

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-gold);
  border-left: 4px solid var(--gold-primary);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideInRight 0.25s ease-out;
}

.toast.toast-success {
  border-left-color: var(--emerald-gov);
}

/* ==========================================================================
   PRINT / PDF OFFICIAL QUOTATION STYLESHEET
   ========================================================================== */
.print-document {
  display: none;
}

@media print {
  body {
    background: #FFFFFF !important;
    color: #111827 !important;
    font-size: 12pt;
    line-height: 1.4;
  }

  .app-header,
  .quick-stats-bar,
  .main-wrapper,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  .print-document {
    display: block !important;
    padding: 20mm 15mm;
    max-width: 100%;
    margin: 0 auto;
    background: #FFFFFF;
  }

  /* Formal Letterhead */
  .p-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }

  .p-brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .p-logo {
    height: 52px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
  }

  .p-brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 20pt;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: 0.05em;
    margin: 0;
  }

  .p-brand-text p {
    font-size: 9pt;
    color: #4B5563;
    margin: 2px 0 0 0;
  }

  .p-quote-meta {
    text-align: right;
    font-size: 9.5pt;
  }

  .p-quote-ref {
    font-size: 13pt;
    font-weight: 700;
    color: #92400E;
    font-family: monospace;
  }

  /* Client & Info Block */
  .p-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 9.5pt;
  }

  .p-info-col h4 {
    font-size: 9pt;
    text-transform: uppercase;
    color: #6B7280;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
  }

  .p-info-row {
    margin-bottom: 4px;
  }

  .p-info-label {
    font-weight: 600;
    color: #374151;
  }

  /* Quotation Table */
  .p-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 9pt;
  }

  .p-table th {
    background: #0F172A;
    color: #FFFFFF;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #0F172A;
  }

  .p-table td {
    padding: 8px 10px;
    border: 1px solid #E5E7EB;
    vertical-align: top;
  }

  .p-table tr:nth-child(even) td {
    background: #F9FAFB;
  }

  .p-col-num { width: 35px; text-align: center; }
  .p-col-jurisdiction { width: 120px; }
  .p-col-qty { width: 50px; text-align: center; }
  .p-col-total { width: 140px; text-align: right; font-family: monospace; font-weight: 700; font-size: 10pt; }

  /* Summary Table */
  .p-summary-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
  }

  .p-summary-table {
    width: 340px;
    border-collapse: collapse;
    font-size: 9.5pt;
  }

  .p-summary-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #E5E7EB;
  }

  .p-summary-table .p-sum-label {
    color: #4B5563;
  }

  .p-summary-table .p-sum-val {
    text-align: right;
    font-family: monospace;
    font-weight: 700;
  }

  .p-summary-table .p-sum-grand td {
    border-top: 2px solid #0F172A;
    border-bottom: 2px solid #0F172A;
    font-size: 11pt;
    font-weight: 800;
    background: #FEF3C7;
    color: #78350F;
  }

  /* Notes & Terms */
  .p-terms {
    background: #F9FAFB;
    border-left: 3px solid #D4AF37;
    padding: 10px 14px;
    margin-bottom: 25px;
    font-size: 8.5pt;
    color: #4B5563;
  }

  .p-terms h5 {
    font-size: 9pt;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
  }

  .p-terms ul {
    padding-left: 18px;
    margin: 0;
  }

  /* Signature & Stamp Section */
  .p-sign-row {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
  }

  .p-sign-box {
    width: 220px;
    border-top: 1px solid #9CA3AF;
    text-align: center;
    padding-top: 6px;
    font-size: 8.5pt;
    color: #4B5563;
  }

  .p-stamp-box {
    width: 140px;
    height: 70px;
    border: 1px dashed #9CA3AF;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8pt;
    color: #9CA3AF;
    margin-bottom: 6px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ==========================================================================
   USER PROFILE MENU & AUTHENTICATION UI
   ========================================================================== */

.user-menu-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1200;
}

.user-menu-wrapper.menu-open,
.user-menu-wrapper:has(.show),
.app-header:has(.user-dropdown-card.show) {
  z-index: 2500 !important;
}

.user-menu-pill {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated, #10192e);
  border: 1px solid var(--border-gold, rgba(212, 175, 55, 0.35));
  border-radius: 40px;
  padding: 6px 14px 6px 8px;
  color: var(--text-white, #FFFFFF);
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.user-menu-pill:hover {
  background: var(--bg-surface-hover, #182542);
  border-color: var(--gold-primary, #D4AF37);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
  transform: translateY(-1px);
}

.user-menu-pill:active,
.user-menu-pill.active {
  transform: scale(0.98);
  border-color: var(--gold-primary, #D4AF37);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5D061 0%, #E6AF2E 100%);
  color: #070B16;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.user-meta-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.user-fullname {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white, #FFFFFF);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.role-admin {
  color: #FDE047;
}

.role-staff {
  color: #93C5FD;
}

.chevron-icon {
  color: var(--text-muted, #94A3B8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.user-menu-pill.active .chevron-icon {
  transform: rotate(180deg);
  color: #FDE047;
}

/* Luxury Dropdown Card */
.user-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: #0B1224;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.18);
  padding: 14px;
  z-index: 2501 !important;
  display: none;
  box-sizing: border-box;
}

.user-dropdown-card.show {
  display: block;
  animation: dropdownLuxurySlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownLuxurySlide {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  padding: 6px 8px 12px 8px;
}

.dropdown-user-name {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
}

.dropdown-user-id {
  font-size: 12px;
  color: #F3C969;
  margin-top: 4px;
}

.dropdown-user-id code {
  font-family: var(--font-mono, monospace);
  background: rgba(212, 175, 55, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #FDE047;
}

.dropdown-user-email {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.2);
  margin: 8px 0;
}

.dropdown-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Bulletproof Dropdown Items Reset & Luxury Styling */
.dropdown-item,
button.dropdown-item,
a.dropdown-item {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--font-main, 'Inter', sans-serif);
  font-weight: 500;
  color: #E2E8F0;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  position: relative;
}

.dropdown-item * {
  pointer-events: none;
}

.dropdown-item:hover,
button.dropdown-item:hover,
a.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.14) !important;
  color: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.35) !important;
  transform: translateX(6px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.dropdown-item:active,
button.dropdown-item:active,
a.dropdown-item:active {
  transform: translateX(6px) scale(0.96) !important;
  background: rgba(212, 175, 55, 0.28) !important;
  border-color: rgba(212, 175, 55, 0.6) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 14px rgba(212, 175, 55, 0.35) !important;
}

.dropdown-item .item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.14);
  color: #F3C969;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropdown-item:hover .item-icon {
  background: rgba(212, 175, 55, 0.25);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  transform: scale(1.08);
}

.dropdown-item:active .item-icon {
  transform: scale(0.9);
}

.dropdown-item-danger,
button.dropdown-item-danger,
a.dropdown-item-danger {
  color: #F87171 !important;
}

.dropdown-item-danger .item-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171 !important;
  border-color: rgba(239, 68, 68, 0.3);
}

.dropdown-item-danger:hover,
button.dropdown-item-danger:hover,
a.dropdown-item-danger:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #FCA5A5 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  transform: translateX(6px) !important;
}

.dropdown-item-danger:active,
button.dropdown-item-danger:active,
a.dropdown-item-danger:active {
  transform: translateX(6px) scale(0.96) !important;
  background: rgba(239, 68, 68, 0.32) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 14px rgba(239, 68, 68, 0.4) !important;
}

/* ==========================================================================
   CLIENT INFORMATION PANEL (PROPOSAL DETAILS)
   ========================================================================== */
.client-details-accordion {
  background: rgba(14, 22, 38, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
}

.client-details-accordion:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.accordion-toggle {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  box-sizing: border-box;
  user-select: none;
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #F3C969;
  font-family: var(--font-heading, 'Outfit', sans-serif);
}

.accordion-title svg {
  color: #D4AF37;
}

.accordion-arrow {
  font-size: 11px;
  color: #94A3B8;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-toggle.collapsed .accordion-arrow {
  transform: rotate(-90deg);
}

.accordion-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.accordion-body.collapsed {
  display: none !important;
}

.form-row-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .form-row-compact {
    grid-template-columns: 1fr;
  }
}

.form-field-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field-compact label {
  font-size: 11px;
  font-weight: 500;
  color: #94A3B8;
}

.form-field-compact input,
.form-field-compact select {
  background: rgba(7, 11, 22, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 6px;
  padding: 8px 10px;
  color: #FFFFFF;
  font-size: 12px;
  font-family: var(--font-main, 'Inter', sans-serif);
  transition: all 0.2s;
  box-sizing: border-box;
  width: 100%;
}

.form-field-compact input:focus,
.form-field-compact select:focus {
  outline: none;
  border-color: #D4AF37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.form-field-compact select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 26px;
  cursor: pointer;
}
}

/* Modal Extensions */
.modal-large {
  max-width: 920px;
  width: 95%;
}

.modal-icon-badge {
  font-size: 24px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-body-content {
  margin-top: 20px;
}

/* Tables in Modals (Saved Quotes & Users) */
.db-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.db-search-bar input {
  flex: 1;
  background: rgba(7, 11, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-white);
  font-size: 13px;
}

.db-search-bar input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.db-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(7, 11, 22, 0.6);
  max-height: 400px;
  overflow-y: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.db-table th {
  background: rgba(14, 22, 38, 0.95);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

.db-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.db-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* User Management Tabs */
.um-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.um-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.um-tab-btn.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

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

.btn-save-db {
  transition: all 0.25s ease;
}

.btn-save-db:hover {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #34D399 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   WHITE & GOLD LUXURY THEME ENHANCEMENTS
   ========================================================================== */

[data-theme="light"] body {
  background-color: #F6F8FB !important;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #F8FAFC 0%, #EFF4F9 100%) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35) !important;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08) !important;
}

[data-theme="light"] .contact-pill {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
  color: #334155 !important;
}

[data-theme="light"] .contact-pill:hover {
  background: #FAF8F2 !important;
  border-color: var(--gold-primary) !important;
}

[data-theme="light"] .quick-stats-bar {
  background: #FFFFFF !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .stat-value {
  color: #0F172A !important;
}

[data-theme="light"] .stat-divider {
  background: rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .service-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .service-card:hover {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.18) !important;
}

[data-theme="light"] .service-card.selected {
  background: #FFFDF7 !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 0 1px var(--gold-primary), 0 8px 24px rgba(212, 175, 55, 0.2) !important;
}

[data-theme="light"] .service-title {
  color: #0F172A !important;
}

[data-theme="light"] .service-description {
  color: #475569 !important;
}

[data-theme="light"] .price-value {
  color: #0F172A !important;
}

[data-theme="light"] .quote-card,
[data-theme="light"] .calculator-panel,
[data-theme="light"] .glass-panel,
[data-theme="light"] .catalog-controls {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.32) !important;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.08) !important;
}

[data-theme="light"] .quote-header-title h2 {
  color: #0F172A !important;
}

[data-theme="light"] .view-mode-bar {
  background: #F8FAFC !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .client-details-accordion {
  background: #FAF8F2 !important;
  border: 1px solid rgba(212, 175, 55, 0.32) !important;
}

[data-theme="light"] .accordion-title {
  color: #8C6A08 !important;
}

[data-theme="light"] .form-field-compact input,
[data-theme="light"] .form-field-compact select,
[data-theme="light"] .search-box input,
[data-theme="light"] .setup-field input,
[data-theme="light"] .db-search-bar input,
[data-theme="light"] .auth-input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid rgba(212, 175, 55, 0.32) !important;
}

[data-theme="light"] .form-field-compact input:focus,
[data-theme="light"] .form-field-compact select:focus,
[data-theme="light"] .search-box input:focus,
[data-theme="light"] .auth-input:focus {
  border-color: #C59B27 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
}

[data-theme="light"] .pill-btn {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
  color: #475569 !important;
}

[data-theme="light"] .pill-btn:hover {
  background: #FAF8F2 !important;
  color: #0F172A !important;
  border-color: var(--gold-primary) !important;
}

[data-theme="light"] .pill-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.08) 100%) !important;
  border-color: var(--gold-primary) !important;
  color: #8C6A08 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .btn-secondary {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.38) !important;
  color: #8C6A08 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .btn-secondary:hover {
  background: #FAF8F2 !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .btn-ghost {
  color: #475569 !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
}

[data-theme="light"] .btn-ghost:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

[data-theme="light"] .user-menu-pill {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  color: #0F172A !important;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.12) !important;
}

[data-theme="light"] .user-fullname {
  color: #0F172A !important;
}

[data-theme="light"] .user-dropdown-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 25px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .dropdown-user-name {
  color: #0F172A !important;
}

[data-theme="light"] .dropdown-item,
[data-theme="light"] button.dropdown-item,
[data-theme="light"] a.dropdown-item {
  color: #334155 !important;
}

[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] button.dropdown-item:hover,
[data-theme="light"] a.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  color: #0F172A !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}

[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
}

[data-theme="light"] .modal-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 35px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .modal-header {
  background: #FAF8F2 !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .modal-header h3 {
  color: #8C6A08 !important;
}

[data-theme="light"] .db-table th {
  background: #FAF8F2 !important;
  color: #475569 !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .db-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: #1E293B !important;
}

[data-theme="light"] .db-table-wrapper {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .selected-item-row {
  background: #FAF8F2 !important;
  border: 1px solid rgba(212, 175, 55, 0.25) !important;
}

[data-theme="light"] .calc-financial-summary {
  background: #FAF8F2 !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

[data-theme="light"] .total-row-grand {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
}

[data-theme="light"] .total-row-grand .total-label,
[data-theme="light"] .total-row-grand .total-amount {
  color: #8C6A08 !important;
}

[data-theme="light"] .internal-staff-panel {
  background: #FFFDF7 !important;
  border-color: var(--gold-primary) !important;
}

[data-theme="light"] .view-mode-btn {
  background: #FFFFFF !important;
  color: #475569 !important;
  border-color: rgba(212, 175, 55, 0.28) !important;
}

[data-theme="light"] .view-mode-btn.active {
  background: rgba(212, 175, 55, 0.18) !important;
  border-color: var(--gold-primary) !important;
  color: #8C6A08 !important;
}

[data-theme="light"] .quote-item-row {
  background: #FAF8F2 !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
}

[data-theme="light"] .quote-item-title {
  color: #0F172A !important;
}

[data-theme="light"] .empty-quote-state {
  background: #F8FAFC !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
}

.theme-toggle-btn .theme-icon {
  font-size: 15px;
  line-height: 1;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
}

/* Base Authentication Container & Input Reset */
.auth-card {
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.auth-form, .auth-field, .auth-input-wrapper {
  box-sizing: border-box !important;
  width: 100% !important;
}
.auth-input {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}
.auth-btn-submit {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover, 
.auth-input:-webkit-autofill:focus, 
.auth-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #090E1C inset !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.45) !important;
  caret-color: #FFFFFF !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Light Mode Authentication Card */
[data-theme="light"] .auth-page {
  background-color: #F6F8FB !important;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #F8FAFC 0%, #EFF4F9 100%) !important;
}

[data-theme="light"] .auth-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 0 0 30px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .auth-subtitle {
  color: #8C6A08 !important;
}

[data-theme="light"] .auth-input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(212, 175, 55, 0.35) !important;
}

[data-theme="light"] .auth-input:focus {
  border-color: #C59B27 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
}

[data-theme="light"] .auth-footer {
  color: #64748B !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
}

/* ==========================================================================
   WORK STATUS & APPLICATION TRACKER (STAFF & CUSTOMER)
   ========================================================================== */

/* Main Header & Titles */
.tracker-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.tracker-main-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.tracker-main-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.tracker-quick-stats-summary {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* 4-Card Metrics Grid */
.tracker-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tracker-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}
.tracker-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 12px rgba(212, 175, 55, 0.15);
}
.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.metric-icon-total { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.metric-icon-active { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.metric-icon-govt { background: rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.3); }
.metric-icon-completed { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.metric-body { display: flex; flex-direction: column; }
.metric-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
}
.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

/* Controls Panel */
.tracker-controls-panel {
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tracker-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.tracker-search-box {
  flex: 1 1 300px;
  min-width: 220px;
  max-width: 480px;
  position: relative;
  box-sizing: border-box;
}
.tracker-search-box input {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 38px 10px 42px !important;
  font-size: 13px !important;
  height: 42px !important;
  border-radius: var(--radius-md) !important;
}
.tracker-select-wrap {
  flex-shrink: 0;
  display: inline-flex;
}
.tracker-select {
  box-sizing: border-box !important;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  padding: 10px 34px 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  height: 42px !important;
  min-width: 150px;
}
.tracker-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.btn-icon-only {
  box-sizing: border-box !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border-radius: var(--radius-md) !important;
}

/* Date Range Filter Controls */
.tracker-date-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated, #0B1224);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 3px 10px;
  height: 42px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.date-input-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-input-group .date-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary, #94A3B8);
}

.tracker-date-input {
  background: transparent !important;
  border: none !important;
  color: var(--text-white, #FFFFFF) !important;
  font-size: 12px !important;
  font-family: inherit;
  padding: 4px 4px !important;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

/* Future Reference Monospace Pill in Table */
.future-ref-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold-light, #F9E79F);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Excel Export Button */
.btn-export-excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #10B981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  border-radius: var(--radius-md, 8px) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-export-excel:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Export Presets Pills */
.export-preset-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-white, #FFFFFF);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary, #D4AF37);
  color: var(--gold-light, #F9E79F);
}

/* Export Notice */
.export-format-notice {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Status Filter Tabs */
.tracker-status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.status-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.status-tab-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.3);
}
.status-tab-btn.active {
  background: var(--gold-primary);
  color: #070B16;
  border-color: var(--gold-primary);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}
.status-tab-btn .tab-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
}
.status-tab-btn.active .tab-badge {
  background: rgba(0, 0, 0, 0.3);
  color: #FFFFFF;
}

/* Table Styling */
.tracker-table-card {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tracker-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.tracker-table thead tr {
  background: rgba(14, 22, 38, 0.9);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.tracker-table th {
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.tracker-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}
.tracker-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}
.tracker-table td {
  padding: 14px 18px;
  vertical-align: middle;
}
.table-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.btn-app-ref {
  background: none;
  border: none;
  color: var(--gold-light);
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-app-ref:hover {
  color: #FFFFFF;
}
.table-client-name { font-weight: 600; color: var(--text-white); }
.table-client-company { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.table-client-phone { font-size: 11px; margin-top: 3px; }
.phone-link { color: #25D366; text-decoration: none; }
.phone-link:hover { text-decoration: underline; }
.table-service-name { font-weight: 500; color: var(--text-white); max-width: 280px; }
.table-jurisdiction-name { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Status Badges */
.status-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
}
.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  animation: statusPulse 2s infinite ease-in-out;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.status-pill-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Priority & Due Badges */
.badge-priority {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  margin-left: 6px;
}
.badge-urgent { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-vip { background: rgba(212, 175, 55, 0.2); color: #FDE047; border: 1px solid rgba(212, 175, 55, 0.4); }
.due-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.due-completed { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.due-overdue { background: rgba(239, 68, 68, 0.2); color: #F87171; }
.due-today { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.due-upcoming { color: var(--text-secondary); }
.govt-ref-pill {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Table Action Buttons */
.table-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-action-pill {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-pill:hover {
  background: var(--gold-primary);
  color: #070B16;
  border-color: var(--gold-primary);
}
.btn-action-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-icon:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
}
.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #EF4444 !important;
}

/* Import Quote Box */
.import-quote-box {
  background: rgba(212, 175, 55, 0.07);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.import-quote-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.import-badge {
  background: rgba(212, 175, 55, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Details Summary Card */
.details-summary-card {
  background: rgba(14, 22, 38, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.details-summary-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
.details-share-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; font-weight: 600; }
.share-url-input {
  flex: 1;
  background: rgba(7, 11, 22, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: var(--gold-light);
  font-family: monospace;
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
}

/* Timeline Components */
.timeline-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin: 18px 0 12px 0;
}
.timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-left: 8px;
}
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  margin-top: 4px;
  flex-shrink: 0;
}
.timeline-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
}
.timeline-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}
.timeline-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}
.timeline-public-pill {
  font-size: 9px;
  font-weight: 700;
  color: #34D399;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}
.timeline-internal-pill {
  font-size: 9px;
  font-weight: 700;
  color: #93C5FD;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Customer Portal Specific Styles */
.track-customer-page {
  background-color: #070B16;
  min-height: 100vh;
}
.track-customer-header {
  background: rgba(11, 18, 36, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 1100;
  padding: 8px 0;
}

/* Header Brand Styles for Track & Tracker Portals */
.header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 40px;
  width: 40px;
  max-height: 40px;
  max-width: 40px;
  object-fit: contain;
  background: #FFFFFF;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border-gold, #D4AF37);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-primary, #D4AF37);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin: 1px 0;
}

.brand-location {
  font-size: 10px;
  color: var(--text-secondary, #94A3B8);
  line-height: 1.2;
}

.track-hero-section {
  text-align: center;
  padding: 18px 16px 10px 16px;
}
.track-hero-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.track-hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.track-hero-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.45;
}
.track-search-card {
  max-width: 600px;
  margin: 0 auto 20px auto;
  padding: 14px 18px;
}
.track-form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.track-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.track-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.track-input-wrap input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.track-input-wrap input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}
.btn-track-submit {
  padding: 13px 26px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.track-hint-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}
.track-hint-text code {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Customer Summary & Stepper */
.track-results-wrap {
  max-width: 860px;
  margin: 0 auto 60px auto;
}
.track-summary-card {
  padding: 28px;
  margin-bottom: 24px;
}
.track-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.track-ref-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  font-weight: 600;
}
.track-ref-number-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.track-ref-number-row h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 1px;
}
.btn-copy-ref {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-copy-ref:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-light);
  border-color: var(--gold-primary);
}
.track-status-pill-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(14, 22, 38, 0.8);
  font-size: 14px;
  font-weight: 700;
}
.track-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.2);
  margin: 24px 0;
}

/* 5-Stage Stepper */
.stepper-section {
  padding: 8px 0;
}
.stepper-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}
.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #111827;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s ease;
}
.step-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 -8px 30px -8px;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}
.step-node.step-active .step-circle {
  background: var(--gold-gradient);
  border-color: var(--gold-light);
  color: #070B16;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.6);
  transform: scale(1.1);
}
.step-node.step-done .step-circle {
  background: #10B981;
  border-color: #34D399;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
.step-bar.bar-active {
  background: linear-gradient(90deg, #10B981, var(--gold-primary));
}
.step-bar.bar-done {
  background: #10B981;
}
.step-info {
  margin-top: 10px;
}
.step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-white);
}
.step-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Meta Grid */
.track-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.meta-item {
  display: flex;
  flex-direction: column;
}
.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 600;
}
.meta-val {
  font-size: 13px;
  color: var(--text-white);
  font-weight: 600;
  margin-top: 4px;
}

/* Customer Timeline */
.track-timeline-card {
  padding: 28px;
  margin-bottom: 24px;
}
.timeline-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.timeline-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
}
.timeline-main-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.timeline-badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
}
.timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.customer-timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
}
.customer-timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -20px;
  width: 2px;
  background: rgba(212, 175, 55, 0.2);
}
.customer-timeline-item:last-child::before {
  display: none;
}
.timeline-badge-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 2px solid var(--gold-primary);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 2;
}
.timeline-body-wrap {
  flex: 1;
  background: rgba(14, 22, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 18px;
}
.timeline-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.timeline-event-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
}
.timeline-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}
.timeline-event-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* Support Bar */
.track-support-bar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.support-info-text strong {
  color: var(--text-white);
  font-size: 14px;
}
.support-info-text p {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}
.support-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Loading & Error States */
.track-loading-state, .track-error-card {
  max-width: 640px;
  margin: 0 auto 36px auto;
  text-align: center;
  padding: 40px 24px;
}
.track-error-card .error-icon {
  font-size: 38px;
  margin-bottom: 12px;
}
.track-error-card h3 {
  color: #F87171;
  font-size: 20px;
  margin-bottom: 8px;
}
.track-error-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Footer */
.track-customer-footer {
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR TRACKER & CUSTOMER PORTAL
   ========================================================================== */
[data-theme="light"] .track-customer-page,
[data-theme="light"] .tracker-page {
  background-color: #F6F8FB !important;
}
[data-theme="light"] .track-customer-header {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}
[data-theme="light"] .tracker-main-title {
  color: #0F172A !important;
}
[data-theme="light"] .tracker-metric-card {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] .metric-value {
  color: #0F172A !important;
}
[data-theme="light"] .tracker-select {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}
[data-theme="light"] .status-tab-btn {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
  color: #475569 !important;
}
[data-theme="light"] .status-tab-btn.active {
  background: var(--gold-primary) !important;
  color: #070B16 !important;
}
[data-theme="light"] .tracker-table thead tr {
  background: #F1F5F9 !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
}
[data-theme="light"] .tracker-table tbody tr {
  border-color: #E2E8F0 !important;
}
[data-theme="light"] .tracker-table tbody tr:hover {
  background: #F8FAFC !important;
}
[data-theme="light"] .table-client-name,
[data-theme="light"] .table-service-name {
  color: #0F172A !important;
}
[data-theme="light"] .track-search-card,
[data-theme="light"] .track-summary-card,
[data-theme="light"] .track-timeline-card,
[data-theme="light"] .track-support-bar,
[data-theme="light"] .tracker-table-card,
[data-theme="light"] .tracker-controls-panel {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.35) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}
[data-theme="light"] .track-input-wrap input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(212, 175, 55, 0.35) !important;
}
[data-theme="light"] .track-ref-number-row h2,
[data-theme="light"] .step-label,
[data-theme="light"] .meta-val,
[data-theme="light"] .timeline-main-title,
[data-theme="light"] .timeline-event-title,
[data-theme="light"] .support-info-text strong {
  color: #0F172A !important;
}
[data-theme="light"] .timeline-body-wrap {
  background: #F8FAFC !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
}
[data-theme="light"] .track-status-pill-large {
  background: #FFFFFF !important;
}
[data-theme="light"] .step-circle {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
}

/* ==========================================================================
   WORK STATUS MODAL ARCHITECTURE & CONTROLS
   ========================================================================== */
.modal-dialog {
  background: var(--bg-surface, #0B1224);
  border: 1px solid var(--border-gold, rgba(212, 175, 55, 0.35));
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 175, 55, 0.18);
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  box-sizing: border-box;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-dialog-lg {
  max-width: 780px;
}

.modal-dialog-sm {
  max-width: 480px;
}

/* Modal Form wrapper ensures footer is never clipped or pushed off-screen */
.modal-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  margin: 0;
}

@keyframes modalScaleIn {
  0% { opacity: 0; transform: scale(0.95) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: rgba(14, 22, 38, 0.85);
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white, #FFFFFF);
  line-height: 1.2;
}

.modal-subtext {
  font-size: 12px;
  color: var(--text-secondary, #94A3B8);
  margin-top: 3px;
}

.modal-body-content {
  padding: 20px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(11, 18, 36, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

/* Modal Form Grids */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-field-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-field-compact label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #CBD5E1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: #EF4444;
}

.form-input-control,
.form-field-compact input,
.form-field-compact select,
.form-field-compact textarea {
  background: var(--bg-surface-elevated, #070B16);
  border: 1px solid var(--border-subtle, rgba(212, 175, 55, 0.28));
  border-radius: var(--radius-sm, 8px);
  padding: 10px 14px;
  color: var(--text-white, #FFFFFF);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
  outline: none;
}

.form-input-control:focus,
.form-field-compact input:focus,
.form-field-compact select:focus,
.form-field-compact textarea:focus {
  border-color: var(--gold-primary, #D4AF37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.form-field-compact textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.45;
}

.table-swipe-hint {
  display: none;
}

/* ==========================================================================
   TABLET CALIBRATION (768px - 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .tracker-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  
  .tracker-metric-card {
    padding: 14px 16px;
  }

  .tracker-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tracker-table {
    min-width: 860px;
  }

  .form-grid-3col {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stepper-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .stepper-track {
    min-width: 640px;
  }

  .track-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   SMARTPHONE & MOBILE DEVICE CALIBRATION (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Global Touch & Safe Area Fixes */
  body {
    -webkit-tap-highlight-color: transparent;
  }

  /* Form Inputs on Mobile: 16px prevents iOS auto-zoom */
  .form-input-control,
  .form-field-compact input,
  .form-field-compact select,
  .form-field-compact textarea,
  .track-input-wrap input,
  .tracker-select {
    font-size: 16px !important;
  }

  /* ------------------------------------------------------------------------
     1. Tracker Page (Staff / Admin Work Status)
     ------------------------------------------------------------------------ */
  .tracker-page .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Tracker Page Header Actions on Mobile */
  .tracker-page .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .tracker-page .header-actions > .btn-primary {
    grid-column: span 2;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
  }

  .tracker-page .header-actions .user-menu-wrapper {
    grid-column: span 2;
  }

  .tracker-page .header-actions .user-menu-pill {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }

  .user-dropdown-card {
    max-width: calc(100vw - 24px) !important;
    right: 0 !important;
  }

  .tracker-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  .tracker-main-title {
    font-size: 20px;
    line-height: 1.25;
  }

  .tracker-main-sub {
    font-size: 12px;
    line-height: 1.4;
  }

  .tracker-quick-stats-summary {
    font-size: 11px;
    padding: 3px 10px;
  }

  /* 2x2 Metric Grid on Mobile */
  .tracker-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    margin-bottom: 16px;
  }

  .tracker-metric-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .metric-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 8px;
  }

  .metric-value {
    font-size: 22px;
  }

  .metric-label {
    font-size: 10px;
    letter-spacing: 0.2px;
  }

  /* Controls Panel on Mobile */
  .tracker-controls-panel {
    padding: 14px;
    gap: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }

  .tracker-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tracker-search-box {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .tracker-select-wrap {
    width: 100%;
  }

  .tracker-select {
    width: 100%;
  }

  .tracker-date-range-wrap {
    width: 100% !important;
    justify-content: space-between;
  }

  .btn-export-excel {
    width: 100% !important;
    justify-content: center;
  }

  /* Status Filter Pills: Native Smooth Swiping */
  .tracker-status-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    gap: 6px;
  }

  .tracker-status-pills::-webkit-scrollbar {
    display: none;
  }

  .status-tab-btn {
    padding: 6px 12px;
    font-size: 11px;
    flex-shrink: 0;
    min-height: 34px;
  }

  /* Table Mobile Swipe Hint */
  .table-swipe-hint {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  }

  /* Responsive Table Card & Horizontal Touch Scroll */
  .tracker-table-card {
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tracker-table {
    min-width: 860px;
  }

  .tracker-table th,
  .tracker-table td {
    padding: 10px 14px;
    font-size: 12px;
  }

  /* Sticky First Column for Reference on Mobile Swipe */
  .tracker-table th:first-child,
  .tracker-table td:first-child {
    position: sticky;
    left: 0;
    background: #0E1626;
    z-index: 2;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
  }

  [data-theme="light"] .tracker-table th:first-child,
  [data-theme="light"] .tracker-table td:first-child {
    background: #FFFFFF !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  }

  /* Mobile Modals (Bottom-Sheet Experience) */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog,
  .modal-dialog-lg,
  .modal-dialog-sm {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 90vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    animation: modalSlideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .modal-dialog form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    margin: 0;
  }

  @keyframes modalSlideUpMobile {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
  }

  .modal-header {
    padding: 14px 18px;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
  }

  .modal-body-content {
    padding: 16px 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none !important;
    gap: 12px;
  }

  .modal-footer {
    padding: 12px 18px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    flex-direction: column-reverse;
    gap: 8px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .form-grid-2col,
  .form-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .details-summary-row {
    flex-direction: column;
    gap: 8px;
  }

  .details-share-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* ------------------------------------------------------------------------
     2. Customer Tracking Portal (track.php)
     ------------------------------------------------------------------------ */
  .track-customer-page .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .track-customer-header .header-container {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-brand a {
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-logo-img {
    height: 38px;
    width: auto;
  }

  .brand-text .brand-title {
    font-size: 18px;
  }

  .brand-text .brand-subtitle {
    font-size: 9px;
  }

  .track-customer-header .header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .track-customer-header .header-actions .btn {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: 11px;
    min-height: 38px;
    justify-content: center;
  }

  .track-hero-section {
    padding: 24px 12px 18px 12px;
  }

  .track-hero-title {
    font-size: 22px;
    line-height: 1.25;
  }

  .track-hero-sub {
    font-size: 12px;
    line-height: 1.45;
  }

  .track-search-card {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }

  .track-form-row {
    flex-direction: column;
    gap: 10px;
  }

  .track-input-wrap {
    min-width: 0;
    width: 100%;
  }

  .track-input-wrap input {
    padding: 12px 14px 12px 42px;
    border-radius: 8px;
  }

  .btn-track-submit {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    justify-content: center;
    min-height: 44px;
  }

  .track-hint-text {
    font-size: 11px;
    line-height: 1.4;
  }

  /* Summary Card */
  .track-summary-card {
    padding: 18px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
  }

  .track-card-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .track-ref-number-row h2 {
    font-size: 20px;
  }

  .btn-copy-ref {
    padding: 4px 10px;
    font-size: 11px;
  }

  .track-status-pill-large {
    align-self: flex-start;
    padding: 6px 14px;
    font-size: 12px;
  }

  .track-divider {
    margin: 16px 0;
  }

  /* Meta Grid on Mobile */
  .track-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .meta-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .meta-label {
    font-size: 10px;
  }

  .meta-val {
    font-size: 12px;
    margin-top: 2px;
  }

  /* Timeline Card on Mobile */
  .track-timeline-card {
    padding: 18px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
  }

  .timeline-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .timeline-main-title {
    font-size: 16px;
  }

  .timeline-main-sub {
    font-size: 11px;
  }

  .timeline-item {
    gap: 10px;
    padding-left: 0;
  }

  .timeline-content {
    padding: 10px 12px;
  }

  /* Support Bar on Mobile */
  .track-support-bar {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: center;
    border-radius: var(--radius-md);
  }

  .support-info-text {
    text-align: center;
  }

  .support-info-text strong {
    font-size: 14px;
  }

  .support-info-text p {
    font-size: 12px;
  }

  .support-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .support-buttons .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    font-size: 13px;
  }

  .track-customer-footer {
    padding: 20px 12px;
    font-size: 11px;
    line-height: 1.6;
  }
}

/* ==========================================================================
   VERTICAL STEPPER ON PHONES (< 680px)
   Converts customer tracking stepper to a crystal-clear vertical milestone trail
   ========================================================================== */
@media (max-width: 680px) {
  .stepper-track {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 6px 0 6px 6px;
    position: relative;
  }

  .step-node {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    width: 100%;
    padding: 4px 0;
    flex: none;
  }

  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
  }

  .step-bar {
    width: 3px;
    height: 22px;
    margin: -2px 0 -2px 14px;
    flex: none;
    z-index: 1;
  }

  .step-info {
    margin-top: 4px;
  }

  .step-label {
    font-size: 13px;
    font-weight: 700;
  }

  .step-sub {
    font-size: 11px;
    margin-top: 1px;
    color: var(--text-muted);
  }
}

/* ==========================================================================
   ULTRA-COMPACT PHONES (< 440px)
   ========================================================================== */
@media (max-width: 440px) {
  .track-meta-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-text .brand-title {
    font-size: 16px;
  }

  .brand-text .brand-location {
    font-size: 10px;
  }

  .header-actions {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   LIGHT THEME INTEGRATION FOR RESPONSIVE COMPONENTS
   ========================================================================== */
[data-theme="light"] .modal-dialog {
  background: #FFFFFF !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 0 35px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .modal-header {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

[data-theme="light"] .modal-header h3 {
  color: #0F172A !important;
}

[data-theme="light"] .modal-footer {
  background: rgba(248, 250, 252, 0.98) !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .form-input-control,
[data-theme="light"] .form-field-compact input,
[data-theme="light"] .form-field-compact select,
[data-theme="light"] .form-field-compact textarea {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme="light"] .form-field-compact label {
  color: #334155 !important;
}

[data-theme="light"] .meta-item {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

[data-theme="light"] .details-summary-card {
  background: #F8FAFC !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

[data-theme="light"] .tracker-date-range-wrap {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
}

[data-theme="light"] .tracker-date-input {
  color: #0F172A !important;
  color-scheme: light;
}

[data-theme="light"] .future-ref-pill {
  background: #FEF9C3 !important;
  border-color: #FDE047 !important;
  color: #854D0E !important;
}

[data-theme="light"] .btn-export-excel {
  background: #ECFDF5 !important;
  border-color: #6EE7B7 !important;
  color: #047857 !important;
}

[data-theme="light"] .btn-export-excel:hover {
  background: #D1FAE5 !important;
  border-color: #10B981 !important;
  color: #065F46 !important;
}

[data-theme="light"] .btn-preset {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-preset:hover {
  background: #FEF9C3 !important;
  border-color: #EAB308 !important;
  color: #854D0E !important;
}


