/* ============================================================
   AML Travel & Tours AI Assistant — Main Stylesheet
   Bootstrap 5.3 + Custom Design System
   ============================================================ */

:root {
  /* Brand palette — mirroring amltravelandtours.com blue/gold */
  --aml-blue:       #0A3D6B;
  --aml-blue-mid:   #1565C0;
  --aml-blue-light: #1E88E5;
  --aml-gold:       #F59E0B;
  --aml-gold-dark:  #D97706;
  --aml-dark:       #0D1117;
  --aml-surface:    #F8FAFC;

  /* Sidebar */
  --sidebar-width:  260px;
  --sidebar-bg:     #0A3D6B;
  --sidebar-hover:  rgba(255,255,255,.08);
  --sidebar-active: rgba(255,255,255,.15);

  /* Chat */
  --chat-bg:        #F1F5F9;
  --bubble-user:    #1565C0;
  --bubble-ai:      #FFFFFF;
  --input-bg:       #FFFFFF;

  --radius-lg: 1rem;
  --radius-md: .625rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
}

/* Dark mode overrides */
[data-bs-theme="dark"] {
  --chat-bg:    #0D1117;
  --bubble-ai:  #1C2333;
  --input-bg:   #161B22;
  --aml-surface:#0D1117;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: .9rem;
  background: var(--aml-surface);
  color: #1E293B;
  overflow-x: hidden;
}
[data-bs-theme="dark"] body { color: #E2E8F0; }

/* ── App layout ──────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: transform .25s ease;
  z-index: 1000;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--aml-gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--aml-blue);
  flex-shrink: 0;
}

.brand-text { color: #fff; }
.brand-text .fw-bold { font-size: .95rem; letter-spacing: .01em; }

.sidebar-nav {
  padding: .75rem .5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  padding: .5rem .625rem .25rem;
  margin-top: .5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem .75rem;
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-link i { font-size: 1rem; flex-shrink: 0; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; }
.nav-link .badge { font-size: .65rem; }

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.15);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* ── Main content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-bs-theme="dark"] .page-header { border-color: rgba(255,255,255,.08); }

/* ── Stats cards ─────────────────────────────────────────── */
.stats-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
[data-bs-theme="dark"] .stats-card { background: #1C2333; }
.stats-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stats-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stats-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stats-label { font-size: .78rem; color: #6B7280; margin-top: .2rem; font-weight: 500; }

.info-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
[data-bs-theme="dark"] .info-card { background: #1C2333; }
.info-card-icon { flex-shrink: 0; width: 48px; text-align: center; }

/* ── Tables ──────────────────────────────────────────────── */
.table { font-size: .85rem; }
.table th { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6B7280; }
.table td { vertical-align: middle; }

/* ── Avatars ─────────────────────────────────────────────── */
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--aml-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-xs {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--aml-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Route badge ─────────────────────────────────────────── */
.route-badge {
  display: flex;
  align-items: center;
  font-size: .85rem;
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--aml-blue) 0%, var(--aml-blue-mid) 50%, var(--aml-blue-light) 100%);
}

.auth-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
[data-bs-theme="dark"] .auth-card { background: #1C2333; }

.auth-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--aml-blue), var(--aml-blue-light));
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  color: #fff;
  box-shadow: 0 8px 24px rgba(21,101,192,.3);
}

/* Override Bootstrap primary for brand */
.btn-primary {
  background: var(--aml-blue);
  border-color: var(--aml-blue);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--aml-blue-mid);
  border-color: var(--aml-blue-mid);
}

/* ── Dark mode toggle ────────────────────────────────────── */
[data-bs-theme="dark"] .auth-card {
  background: #161B22;
  border: 1px solid rgba(255,255,255,.08);
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .sidebar-overlay.open { display: block; }
  .main-content { padding: 1rem; }
  .stats-value { font-size: 1.4rem; }
}

/* ── Utilities ───────────────────────────────────────────── */
.x-small { font-size: .72rem; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
