/* ============================================================
   EVENTRAX — Lead the Experience
   Premium CRM Design System
   Brand: Charcoal (#1C1C1E), Silver/Gray (#888), Red Accent (#D42B2B), White
   Font: Inter + Outfit (Google Fonts)
   ============================================================ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand Palette */
  --brand-dark:     #111114;
  --brand-charcoal: #1C1C1E;
  --brand-gray-800: #2D2D30;
  --brand-gray-700: #3A3A3C;
  --brand-gray-600: #6B7280;
  --brand-gray-500: #8A8F9A;
  --brand-gray-300: #D1D5DB;
  --brand-gray-100: #F3F4F6;
  --brand-gray-50:  #F9FAFB;
  --brand-red:      #D42B2B;
  --brand-red-h:    #B71C1C;
  --brand-red-soft: rgba(212,43,43,0.08);
  --brand-red-glow: rgba(212,43,43,0.2);
  --brand-white:    #FFFFFF;
  --brand-silver:   #888888;

  /* Layout */
  --sidebar-w:   264px;
  --header-h:    64px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   20px;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.14);
  --shadow-xl:   0 24px 64px rgba(0,0,0,0.20);

  /* Transitions */
  --t-fast:   all 0.15s ease;
  --t-base:   all 0.22s ease;
  --t-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F0F2F7;
  color: var(--brand-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Outfit font for headings */
h1, h2, h3, .page-title, .modal-title, .sidebar-link, .stat-value, .aed-amount {
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-charcoal);
  position: relative;
  overflow: hidden;
}

/* Geometric background pattern */
#login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Red glow orbs */
#login-page .glow-orb-1 {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,43,43,0.18) 0%, transparent 65%);
  top: -120px; right: -80px;
  pointer-events: none;
}
#login-page .glow-orb-2 {
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,43,43,0.10) 0%, transparent 65%);
  bottom: -80px; left: -60px;
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 52px 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.1);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo img {
  height: 52px;
  object-fit: contain;
}
.login-logo-divider {
  width: 40px;
  height: 2px;
  background: var(--brand-red);
  margin: 14px auto 0;
  border-radius: 1px;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
  text-align: center;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13.5px;
  color: var(--brand-gray-500);
  text-align: center;
  margin-bottom: 32px;
}

#login-error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-card .form-group { margin-bottom: 20px; }
.login-card label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--brand-gray-600);
  margin-bottom: 7px;
  display: block;
}
.login-card input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--t-base);
  outline: none;
  background: #FAFAFA;
  color: var(--brand-dark);
}
.login-card input:focus {
  border-color: var(--brand-red);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}
.login-card input::placeholder { color: #C4C9D4; }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--brand-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t-base);
  margin-top: 8px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-login:hover {
  background: var(--brand-red-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212,43,43,0.32);
}
.btn-login:active { transform: translateY(0); }

.login-hint {
  font-size: 11.5px;
  color: #9CA3AF;
  text-align: center;
  margin-top: 18px;
}

/* ============================================================
   MAIN APP LAYOUT
   ============================================================ */
#main-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #F0F2F7;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-charcoal);
  color: #E5E7EB;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  border-right: 1px solid rgba(255,255,255,0.05);
}

/* Subtle gradient overlay on sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(212,43,43,0.06) 0%, transparent 100%);
  pointer-events: none;
}

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.sidebar-logo img {
  height: 36px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}
.sidebar-tagline {
  font-size: 8.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-top: 5px;
  font-family: 'Outfit', sans-serif;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 16px 10px 6px;
  font-family: 'Outfit', sans-serif;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.52);
  transition: var(--t-base);
  margin-bottom: 2px;
  text-decoration: none;
  user-select: none;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.88);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(212,43,43,0.22) 0%, rgba(212,43,43,0.08) 100%);
  color: #fff;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 3px;
  background: var(--brand-red);
  border-radius: 0 3px 3px 0;
}

.sidebar-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.8;
}
.sidebar-link.active .nav-icon { opacity: 1; }

.sidebar-link .nav-badge {
  margin-left: auto;
  background: var(--brand-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  animation: pulseBadge 2s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand-red) 0%, #B71C1C 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212,43,43,0.4);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #F3F4F6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,0.3);
  margin-top: 1px;
}
.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 13px;
  padding: 6px;
  transition: var(--t-fast);
  border-radius: 6px;
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--brand-red); background: rgba(212,43,43,0.12); }

/* Hamburger toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--brand-charcoal);
  color: #fff;
  border: none;
  border-radius: 9px;
  width: 40px; height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  overflow-y: auto;
  min-height: 100vh;
  background: #F0F2F7;
}

.page { display: none; }
.page.active { display: block; animation: pageIn 0.2s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 0;
  flex-wrap: wrap;
  gap: 14px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--brand-gray-500);
  margin-top: 3px;
}
.page-body { padding: 22px 32px 36px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--t-fast);
}

/* ── Stat Cards ── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--t-base);
  cursor: pointer;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,0,0,0.07);
}
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  margin-bottom: 16px;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 12px;
  color: var(--brand-gray-500);
  font-weight: 500;
  margin-top: 5px;
  letter-spacing: 0.2px;
}
.stat-stripe {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sc-color, var(--brand-red));
  opacity: 0.7;
}

/* AED Big Cards */
.aed-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--t-base);
}
.aed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.aed-card.green-card .aed-icon { background: rgba(5,150,105,0.1); color: #059669; }
.aed-icon {
  width: 52px; height: 52px;
  background: rgba(212,43,43,0.09);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: var(--brand-red);
}
.aed-label {
  font-size: 12px;
  color: var(--brand-gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.aed-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.5px;
  margin-top: 3px;
  line-height: 1.1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: var(--t-base);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--brand-red);
  color: #fff;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212,43,43,0.25);
}
.btn-primary:hover {
  background: var(--brand-red-h);
  box-shadow: 0 4px 16px rgba(212,43,43,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #F4F4F6;
  color: #374151;
  padding: 8px 15px;
  font-size: 13px;
  border: 1px solid #E5E7EB;
}
.btn-secondary:hover { background: #EAECF0; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--brand-gray-600);
  padding: 7px 13px;
  font-size: 12px;
  border: 1px solid #E5E7EB;
}
.btn-ghost:hover { background: #F9FAFB; border-color: #D1D5DB; }

.btn-danger {
  background: #FEF2F2;
  color: #B91C1C;
  padding: 7px 13px;
  font-size: 12px;
  border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-success {
  background: #ECFDF5;
  color: #065f46;
  padding: 7px 13px;
  font-size: 12px;
  border: 1px solid #A7F3D0;
}
.btn-success:hover { background: #D1FAE5; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-gray-600);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 7px;
  display: block;
}
.form-group label .required { color: var(--brand-red); margin-left: 2px; }

input[type="text"], input[type="email"], input[type="number"],
input[type="date"], input[type="password"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: var(--brand-dark);
  background: #fff;
  outline: none;
  transition: var(--t-base);
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}
input::placeholder, textarea::placeholder { color: #C4C9D4; }
textarea { resize: vertical; min-height: 82px; line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}
.input-search {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 15px;
  padding-left: 36px !important;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead tr { border-bottom: 2px solid #F0F2F5; }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  white-space: nowrap;
  background: #FAFBFC;
  font-family: 'Outfit', sans-serif;
}
td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--brand-dark);
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}
tbody tr { transition: var(--t-fast); }
tbody tr:hover td { background: #F7F9FF; }
tbody tr:last-child td { border-bottom: none; }

.urgent-row td  { background: #FFF5F5 !important; }
.urgent-row:hover td { background: #FEE2E2 !important; }
.overdue-row td { background: #FFFBEB !important; }
.overdue-row:hover td { background: #FEF3C7 !important; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.status-new        { background: #EFF6FF; color: #1D4ED8; }
.status-quot-pending { background: #FEF3C7; color: #92400E; }
.status-quot-sent  { background: #EDE9FE; color: #5B21B6; }
.status-follow     { background: #FFF7ED; color: #C2410C; }
.status-confirmed  { background: #ECFDF5; color: #065F46; }
.status-lost       { background: #FEF2F2; color: #991B1B; }
.status-cancelled  { background: #F3F4F6; color: #4B5563; }
.status-completed  { background: #F0FDF4; color: #166534; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay:not(.hidden) { animation: overlayIn .18s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  max-width: 640px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalUp .22s cubic-bezier(0.34, 1.40, 0.64, 1);
}
@keyframes modalUp { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-lg { max-width: 820px; }
.modal-sm { max-width: 440px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F0F2F5;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.2px;
}
.modal-close {
  background: #F4F4F6;
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-gray-600);
  font-size: 13px;
  transition: var(--t-fast);
}
.modal-close:hover { background: #FEE2E2; color: var(--brand-red); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #F0F2F5;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9999;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  animation: toastIn .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  backdrop-filter: blur(8px);
}
@keyframes toastIn { from { transform: translateX(20px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { background: #1A1A1D; color: #fff; border-left: 4px solid #10B981; }
.toast-error   { background: #1A1A1D; color: #fff; border-left: 4px solid var(--brand-red); }

/* ============================================================
   SEARCH DROPDOWN
   ============================================================ */
.dropdown-wrap { position: relative; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 300;
  max-height: 240px;
  overflow-y: auto;
}
.search-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #F9FAFB;
  transition: var(--t-fast);
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: #FFF5F5; color: var(--brand-red); }

/* ============================================================
   ALERT BANNERS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 700; font-size: 14px; }
.alert-sub { font-size: 12.5px; margin-top: 3px; opacity: 0.85; }
.alert-red   { background: #FFF5F5; border: 1px solid #FED7D7; color: #C53030; }
.alert-amber { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-gray-600);
  cursor: pointer;
  transition: var(--t-fast);
}
.filter-chip:hover { border-color: var(--brand-red); color: var(--brand-red); background: #FFF5F5; }
.filter-chip.active { border-color: var(--brand-red); color: var(--brand-red); background: #FFF5F5; font-weight: 600; }

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-gray-500);
  cursor: pointer;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: var(--t-fast);
  margin: 18px 32px 0;
  border: 1px solid transparent;
}
.back-link:hover { color: var(--brand-red); background: #FFF5F5; border-color: #FEE2E2; }

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Outfit', sans-serif;
}
.section-title .dot {
  width: 4px; height: 20px;
  background: var(--brand-red);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   CONTACT CARD
   ============================================================ */
.contact-card {
  background: #FAFBFC;
  border: 1.5px solid #ECEEF2;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: var(--t-fast);
}
.contact-card:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); }
.contact-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-charcoal), var(--brand-gray-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--brand-gray-500);
}
.empty-state i { font-size: 38px; color: #D1D5DB; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; }

/* ============================================================
   PRINT STYLES — ENQUIRY
   ============================================================ */
.print-header { display: none; }

@media print {
  .sidebar, .sidebar-toggle, .sidebar-overlay,
  .page-header .btn-primary, .page-header .btn-ghost,
  .filter-bar, .modal-overlay, .toast,
  .back-link, .no-print,
  #urgent-badge { display: none !important; }

  body { background: #fff !important; font-size: 12pt; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 12pt !important; }
  .card {
    box-shadow: none !important;
    border: 1pt solid #ddd !important;
    break-inside: avoid;
  }
  .print-header { display: block !important; }

  #page-enquiry-detail { display: block !important; }
  .print-show { display: block !important; }

  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; page-break-after: auto; }
  thead { display: table-header-group; }

  .btn-print { display: none !important; }
}

/* Print header shown only in print */
.print-header {
  text-align: center;
  padding: 24pt 0 14pt;
  border-bottom: 2pt solid #E5E7EB;
  margin-bottom: 24pt;
}
.print-header img { height: 44pt; display: block; margin: 0 auto; }
.print-header h2 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 18pt;
  font-weight: 700;
  margin-top: 10pt;
  color: #111;
}
.print-header p { font-size: 9.5pt; color: #666; margin-top: 4pt; }
.print-header .print-ref {
  display: inline-block;
  margin-top: 8pt;
  padding: 3pt 10pt;
  background: #F3F4F6;
  border-radius: 4pt;
  font-size: 9pt;
  color: #374151;
  font-weight: 600;
}

/* Print button */
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-charcoal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t-base);
  font-family: 'Inter', sans-serif;
}
.btn-print:hover { background: var(--brand-gray-800); transform: translateY(-1px); }

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1200px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px)  {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ============================================================
   FLEX UTILITIES
   ============================================================ */
.flex           { display: flex; }
.flex-1         { flex: 1; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.mb-5 { margin-bottom: 24px; }
.mb-6 { margin-bottom: 28px; }
.relative { position: relative; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Typography */
.text-sm       { font-size: 12.5px; }
.text-xs       { font-size: 11.5px; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.text-gray     { color: var(--brand-gray-500); }
.text-red      { color: var(--brand-red); }
.text-green    { color: #065F46; }
.text-dark     { color: var(--brand-dark); }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider { height: 1px; background: #F0F2F5; margin: 20px 0; }

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-gray-600);
  user-select: none;
}
.checkbox-wrap input[type="checkbox"] {
  width: 16px; height: 16px;
  border-radius: 4px;
  accent-color: var(--brand-red);
  cursor: pointer;
}

/* Status dot */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
  .page-header  { padding: 16px 16px 0; }
  .page-body    { padding: 14px 16px 28px; }
  .back-link    { margin: 12px 16px 0; }
  .filter-bar   { padding: 12px 14px; }
  .card         { padding: 16px; }
  .modal        { padding: 20px; border-radius: var(--radius); }
  .modal-lg     { max-width: 100%; max-height: 96vh; }
  th, td        { padding: 10px 12px; }
  .grid-2       { grid-template-columns: 1fr !important; }
  .login-card   { padding: 36px 24px; border-radius: 18px; }
  .page-title   { font-size: 20px; }
}

@media (max-width: 480px) {
  html { font-size: 13px; }
  .page-title  { font-size: 18px; }
  .stat-value  { font-size: 26px; }
  .aed-amount  { font-size: 20px; }
  .sidebar-toggle { top: 12px; left: 12px; }
  .toast { bottom: 16px; right: 16px; max-width: calc(100vw - 32px); }
  .modal { padding: 18px; }
  .login-card { padding: 28px 18px; margin: 12px; max-width: 100%; }
}

/* ============================================================
   PRINT ENQUIRY DETAIL
   ============================================================ */
.print-detail-section {
  margin-bottom: 18pt;
}
.print-detail-section h4 {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1pt;
  color: #888;
  margin-bottom: 8pt;
  padding-bottom: 4pt;
  border-bottom: 1pt solid #eee;
}
.print-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4pt 0;
  font-size: 10pt;
  border-bottom: 0.5pt solid #f5f5f5;
}
.print-detail-label { color: #666; }
.print-detail-value { font-weight: 600; color: #111; }
