/* TravelCRM — Design System
   Aesthetic: Luxury travel agency — deep navy + warm gold + clean ivory
   Fonts: DM Serif Display (headings) + DM Sans (body)
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

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

:root {
  --navy:       #0f1e3c;
  --navy-light: #1a3260;
  --navy-mid:   #243d72;
  --gold:       #c9a84c;
  --gold-light: #e4c97a;
  --gold-pale:  #f7f0de;
  --ivory:      #faf8f4;
  --white:      #ffffff;
  --gray-50:    #f5f4f1;
  --gray-100:   #eae8e3;
  --gray-200:   #d4d1c9;
  --gray-400:   #9b9890;
  --gray-600:   #6b6861;
  --gray-800:   #3a3834;
  --text:       #1a1917;
  --text-muted: #6b6861;
  --danger:     #c0392b;
  --success:    #1e7e5a;
  --warning:    #d4850a;
  --info:       #1a5fa8;

  --sidebar-w:  240px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(15,30,60,.08);
  --shadow:     0 4px 16px rgba(15,30,60,.10);
  --shadow-lg:  0 12px 40px rgba(15,30,60,.14);

  --transition: .18s ease;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;

  /* Glassmorphism & SaaS Accents */
  --blur:         blur(12px);
  --navy-glass:   rgba(15,30,60,0.85);
  --white-glass:  rgba(255,255,255,0.78);
  --gold-glow:    0 0 20px rgba(201,168,76,0.3);
  --shadow-glass: 0 8px 32px 0 rgba(15,30,60,0.12);
}


html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--gold); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Layout Shell ────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand .brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--white);
  display: block;
  letter-spacing: -.3px;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

.sidebar-section {
  padding: 16px 12px 4px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 400;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 1px;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--white);
}
.nav-item.active {
  background: rgba(201,168,76,.15);
  color: var(--gold-light);
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: .75;
  flex-shrink: 0;
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--navy-mid);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-light);
  flex-shrink: 0;
}
.user-info .user-name { color: var(--white); font-size: 13px; font-weight: 500; display: block; }
.user-info .user-role { color: rgba(255,255,255,.4); font-size: 11px; display: block; }

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ivory);
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--navy);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--navy);
}
.card-body { padding: 20px 22px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0;
  transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-family: var(--font-serif); font-size: 32px; color: var(--navy); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-up    { color: var(--success); }
.stat-down  { color: var(--danger); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-light); color: var(--white); }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--gray-200);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); letter-spacing: .4px; text-transform: uppercase; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(36,61,114,.08); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody tr { transition: background var(--transition); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-navy    { background: var(--navy);       color: var(--white); }
.badge-gold    { background: var(--gold-pale);  color: #7a5a10; }
.badge-success { background: #e6f5ee;           color: #145c3e; }
.badge-danger  { background: #fdf0ef;           color: #8b2020; }
.badge-warning { background: #fef6e6;           color: #7a4d08; }
.badge-info    { background: #e6eef8;           color: #163f74; }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

/* Stage badges */
.stage-DISCOVERY    { background: #edf2ff; color: #3451b2; }
.stage-QUALIFIED    { background: #e6f5ee; color: #145c3e; }
.stage-PROPOSAL     { background: #fef6e6; color: #7a4d08; }
.stage-NEGOTIATION  { background: #fff0e6; color: #8b4513; }
.stage-BOOKING      { background: #d4f0e0; color: #0c4a2e; }
.stage-LOST         { background: #fdf0ef; color: #8b2020; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border-left: 3px solid;
  margin-bottom: 16px;
}
.alert-danger  { background: #fdf0ef; border-color: var(--danger);  color: #8b2020; }
.alert-success { background: #e6f5ee; border-color: var(--success); color: #145c3e; }
.alert-warning { background: #fef6e6; border-color: var(--warning); color: #7a4d08; }
.alert-info    { background: #e6eef8; border-color: var(--info);    color: #163f74; }

/* ── Grids ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; min-height: 500px; }
.kanban-col {
  min-width: 240px;
  max-width: 260px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-col-body { padding: 10px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { border-color: var(--navy-mid); box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card .kc-name { font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.kanban-card .kc-dest { font-size: 12px; color: var(--text-muted); }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kanban-card .kc-score { font-size: 11px; font-weight: 600; color: var(--gold); }

/* ── Utilities ───────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mb-0   { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-serif { font-family: var(--font-serif); }
.w-100 { width: 100%; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { opacity: .2; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-serif); font-size: 20px; color: var(--navy); margin-bottom: 8px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,30,60,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform .22s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-serif); font-size: 18px; color: var(--navy); }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--gray-100);
  border-radius: 50%; cursor: pointer;
  font-size: 16px; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Auth Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: stretch;
}
.auth-panel {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-visual {
  flex: 1;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 40%, #1a4d7c 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-visual-text {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 2;
  padding: 40px;
}
.auth-visual-text h2 {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.auth-visual-text p {
  font-size: 16px;
  color: rgba(255,255,255,.6);
  max-width: 380px;
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(201,168,76,.18) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(201,168,76,.10) 0%, transparent 50%);
}
.auth-logo { font-family: var(--font-serif); font-size: 28px; color: var(--navy); margin-bottom: 8px; }
.auth-sub  { font-size: 13px; color: var(--text-muted); margin-bottom: 40px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-visual { display: none; }
  .auth-panel  { width: 100%; padding: 40px 28px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .3s ease forwards; }

/* ── Mobile Excellence & Glassmorphism ───────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; } /* Replaced by bottom nav on mobile */
  .main-content { padding-bottom: 90px; }
  
  .topbar { 
    position: sticky; top: 0; z-index: 1000; 
    backdrop-filter: var(--blur); 
    background: var(--white-glass);
    border-bottom: 1px solid rgba(234,232,227,0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  }

  /* Floating Bottom Nav (Glass) */
  .mobile-nav {
    display: flex; position: fixed; bottom: 20px; left: 16px; right: 16px;
    height: 68px; background: var(--navy-glass); backdrop-filter: var(--blur);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
    z-index: 2000; justify-content: space-around; align-items: center;
    box-shadow: var(--shadow-lg);
  }
  .mobile-nav-item {
    color: rgba(255,255,255,0.5); text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 500;
  }
  .mobile-nav-item.active { color: var(--gold); }
  .mobile-nav-item svg { width: 22px; height: 22px; }

  /* Card-Based Data Stacking */
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap th, .table-wrap td, .table-wrap tr { display: block; }
  .table-wrap thead tr { position: absolute; top: -9999px; left: -9999px; }
  .table-wrap tr { 
    background: var(--white); border: 1px solid var(--gray-100); 
    border-radius: var(--radius); margin-bottom: 16px; padding: 12px;
    box-shadow: var(--shadow-sm);
  }
  .table-wrap td {
    border: none; border-bottom: 1px solid var(--gray-50); 
    position: relative; padding-left: 45%; text-align: right; min-height: 36px;
    display: flex; align-items: center; justify-content: flex-end;
  }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td:before {
    content: attr(data-label); position: absolute; left: 12px; width: 40%;
    text-align: left; font-weight: 700; font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
  }

  /* Grid & Modal Adapters */
  .grid-2, .grid-3, .grid-4, .stats-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .modal { 
    width: 100%; border-radius: 24px 24px 0 0; 
    position: fixed; bottom: 0; left: 0; right: 0; margin: 0;
    max-height: 85vh; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .modal-overlay.open .modal { transform: translateY(0); }
}

@media (min-width: 769px) { .mobile-nav { display: none; } }


@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
