/* ============================================================
   TREKI TRAVELS — OPERATIONS PORTAL  |  PREMIUM DESIGN SYSTEM
   ============================================================ */

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

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #edfff5;
  --brand-100: #d5f5e5;
  --brand-200: #aeebcc;
  --brand-500: #0B7D3E;
  --brand-600: #096b34;
  --brand-700: #075929;
  --brand-900: #022d15;

  /* Semantic colors */
  --color-primary:        var(--brand-500);
  --color-primary-hover:  var(--brand-600);
  --color-primary-light:  var(--brand-50);
  --color-primary-border: var(--brand-200);
  --color-accent:  #f97316;
  --color-accent-hover: #ea6c0a;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-error:   #dc2626;
  --color-error-bg: #fef2f2;
  --color-info:    #2563eb;

  /* Surface & BG */
  --color-bg:       #f1f5f9;
  --color-surface:  #ffffff;
  --color-surface-2:#f8fafc;
  --color-surface-3:#f1f5f9;

  /* Text */
  --color-text:           #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted:     #94a3b8;
  --color-text-inverse:   #ffffff;

  /* Borders */
  --color-border:       #e2e8f0;
  --color-border-focus: var(--brand-500);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-glow: 0 0 0 4px rgba(11,125,62,.12);

  /* Animation */
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.16,1,.3,1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ============================================================
   🔑  LOGIN PAGE
   ============================================================ */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(11,125,62,.35) 0%, transparent 70%),
    linear-gradient(160deg, #020d07 0%, #041a0d 40%, #071f10 100%);
  overflow: hidden;
  position: relative;
}

/* Subtle animated grid overlay */
.login-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(11,125,62,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,125,62,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--r-2xl);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.04);
  animation: slideUpFade var(--duration-slow) var(--ease-spring) both;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.75rem;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.login-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

.login-form-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.login-form-sub {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > i:first-child {
  position: absolute;
  left: 0.875rem;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 2;
  flex-shrink: 0;
}

.input-with-icon input,
.input-with-icon select,
textarea {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input-with-icon input:focus,
.input-with-icon select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  background: white;
}

.error-msg-box {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-error-bg);
  border: 1px solid rgba(220,38,38,.2);
  color: var(--color-error);
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

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

.btn-submit {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(11,125,62,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-submit:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 20px rgba(11,125,62,.4);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 12px rgba(249,115,22,.3);
}
.btn-accent:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface-3);
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Login loading overlay */
.login-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  border-radius: var(--r-2xl);
}

.spinner-compass { color: var(--color-primary); }
.spinner-compass i { width: 44px; height: 44px; animation: spin 1.2s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.login-footer {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,.45);
}

/* ============================================================
   💻  DASHBOARD LAYOUT
   ============================================================ */

.dashboard-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

/* ── TOP NAVBAR ─────────────────────────────────────────────── */
.dash-header {
  background: white;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 var(--color-border), var(--shadow-xs);
}

.dash-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.login-logo { font-size: 1.6rem !important; letter-spacing: -0.04em; }

.logo-badge {
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-border);
  color: var(--color-primary);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-sm);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info { text-align: right; }
.user-name { font-weight: 700; font-size: 0.875rem; color: var(--color-text); line-height: 1.3; }
.user-role { font-size: 0.72rem; color: var(--color-text-muted); }

.btn-logout {
  width: auto;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  border-radius: var(--r-md);
}

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.dash-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem;
}

/* Welcome Banner */
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.welcome-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.welcome-title p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

.btn-sync {
  width: auto;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.sync-active i { animation: spin 1s linear infinite; }

/* ── KPI METRICS GRID ───────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease);
}

.metric-card:has(.metric-icon-wrap.primary)::before  { background: var(--color-primary); }
.metric-card:has(.metric-icon-wrap.warning)::before  { background: var(--color-warning); }
.metric-card:has(.metric-icon-wrap.accent)::before   { background: var(--color-accent); }
.metric-card:has(.metric-icon-wrap.success)::before  { background: var(--color-success); }

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.metric-card:hover::before { opacity: 1; }

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-wrap.primary { background: var(--brand-50);  color: var(--brand-500); }
.metric-icon-wrap.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.metric-icon-wrap.accent  { background: #fff7ed; color: var(--color-accent); }
.metric-icon-wrap.success { background: var(--color-success-bg); color: var(--color-success); }

.metric-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric-sub {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
  font-weight: 500;
}

/* ============================================================
   🔍  FILTERS & MANIFEST SECTION
   ============================================================ */

.manifest-section {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.manifest-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--color-surface);
}

.manifest-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.manifest-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.manifest-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.search-filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

/* Uniform filter inputs */
.manifest-header select,
.manifest-header input[type="text"],
.manifest-header input[type="date"],
.manifest-header .search-box input,
.manifest-header .input-with-icon input {
  height: 44px;
  padding: 0 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface-2);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.manifest-header select:focus,
.manifest-header input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  background: white;
}

/* Search icon inset */
.manifest-header .search-box { position: relative; }
.manifest-header .search-box input { padding-left: 2.5rem; }
.manifest-header .search-box i,
.manifest-header .input-with-icon > i:first-child {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 2;
}

.manifest-header .input-with-icon input { padding-left: 2.5rem; }
.manifest-header .input-with-icon input[type="date"] {
  font-size: 0.82rem;
  cursor: pointer;
}

/* ============================================================
   📊  DATA TABLE
   ============================================================ */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.manifest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.855rem;
}

.manifest-table th {
  background: var(--color-surface-2);
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  border-bottom: 1.5px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
}

.manifest-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text);
}

.manifest-table tbody tr {
  transition: background var(--duration-fast) var(--ease);
}

.manifest-table tbody tr:hover { background: var(--brand-50); }
.manifest-table tbody tr:last-child td { border-bottom: none; }

/* Table cell components */
.trip-td {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.seats-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-sm);
  font-size: 0.72rem;
  font-family: var(--font-heading);
}

.source-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.source-badge.direct  { background: #fff7ed; color: #c2410c; }
.source-badge.website { background: #eff6ff; color: #1e40af; }

.partner-tag-pill {
  background: var(--color-surface-3);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease);
}
.partner-tag-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.partner-tag-pill.assigned {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-600);
}

.bold-finance { font-weight: 700; font-variant-numeric: tabular-nums; }

.status-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.status-indicator.pending    { background: var(--color-warning-bg); color: var(--color-warning); }
.status-indicator.reconciled { background: var(--color-success-bg); color: var(--color-success); }

.itin-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* Action buttons */
.action-buttons-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--color-border);
  background: white;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--brand-50);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.05);
}
.btn-icon.action-edit:hover {
  background: #fff7ed;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Empty state */
.table-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--color-text-muted);
}
.table-empty-state p { font-weight: 700; font-size: 1rem; margin-top: 0.75rem; }

/* ============================================================
   🗳️  MODAL SYSTEM
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 13, 7, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn var(--duration-base) var(--ease);
}

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

.modal-content-card {
  background: white;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.04);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUpModal var(--duration-slow) var(--ease-spring) both;
}

@keyframes slideUpModal {
  from { transform: translateY(16px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-surface-2);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.btn-close-modal {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: var(--r-sm);
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.btn-close-modal:hover { color: var(--color-error); background: var(--color-error-bg); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-body .form-group { margin-bottom: 1.1rem; }
.modal-body .form-group label { display: flex; align-items: center; gap: 0.3rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-footer .btn {
  width: auto;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--r-md);
}

/* Traveler cards inside manifest modal */
.travelers-manifest-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.traveler-detail-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  background: var(--color-surface-2);
  transition: border-color var(--duration-fast) var(--ease);
}
.traveler-detail-card:hover { border-color: var(--color-primary-border); }

.traveler-detail-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 0.5rem;
  font-size: 0.9rem;
}

.traveler-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}
.traveler-meta-row span strong { color: var(--color-text); }

.medical-warning-block {
  margin-top: 0.75rem;
  background: var(--color-error-bg);
  border: 1px solid rgba(220,38,38,.2);
  color: var(--color-error);
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ============================================================
   💎  ACCORDION SYSTEM
   ============================================================ */

.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

/* ── DATE ACCORDION CARD ────────────────────────────────────── */
.accordion-card {
  background: white;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition:
    box-shadow var(--duration-base) var(--ease),
    border-color var(--duration-base) var(--ease);
}

.accordion-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-border);
}

.accordion-card.active {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--color-primary-border);
}

.accordion-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-2);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease);
  border-bottom: 1.5px solid transparent;
  gap: 0.75rem;
}

.accordion-header:hover { background: var(--brand-50); }
.accordion-card.active .accordion-header {
  background: var(--brand-50);
  border-bottom-color: var(--color-primary-border);
}

.accordion-date-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.accordion-date-group i {
  color: var(--color-primary);
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.accordion-date-group span {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.accordion-header-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.accordion-header-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.accordion-header-badge.warning {
  background: var(--color-warning-bg);
  border-color: rgba(217,119,6,.25);
  color: #92400e;
}

/* ── DAY MANIFEST DOWNLOAD BUTTON ──────────────────────────────── */
.day-manifest-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.22rem 0.6rem;
  border-radius: var(--r-sm);
  background: var(--color-primary);
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  box-shadow: 0 1px 4px rgba(11,125,62,.25);
  letter-spacing: 0.01em;
}
.day-manifest-download-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(11,125,62,.35);
}
.day-manifest-download-btn:active { transform: scale(.96); }

@media (max-width: 480px) {
  .day-manifest-download-btn span { display: none; }
  .day-manifest-download-btn { padding: 0.25rem 0.4rem; }
}

.accordion-chevron {
  color: var(--color-text-muted);
  transition: transform var(--duration-base) var(--ease), color var(--duration-base) var(--ease);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.accordion-card.active .accordion-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.accordion-panel {
  display: none;
  background: white;
}
.accordion-card.active .accordion-panel { display: block; }

/* ── MONTH ACCORDION CARD ───────────────────────────────────── */
.month-accordion-card {
  background: white;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition:
    box-shadow var(--duration-base) var(--ease),
    border-color var(--duration-base) var(--ease);
}
.month-accordion-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-border);
}
.month-accordion-card.active {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-md);
}

.month-accordion-header {
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--brand-50) 100%);
  cursor: pointer;
  user-select: none;
  border-bottom: 1.5px solid transparent;
  transition: background var(--duration-fast) var(--ease);
  gap: 0.75rem;
}
.month-accordion-header:hover { background: var(--brand-50); }
.month-accordion-card.active .month-accordion-header {
  border-bottom-color: var(--color-primary-border);
  background: var(--brand-50);
}

.month-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.month-title-group i  { color: var(--color-accent); width: 20px; height: 20px; }
.month-title-group span {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.month-header-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-header-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.month-accordion-chevron {
  color: var(--color-text-muted);
  transition: transform var(--duration-base) var(--ease), color var(--duration-base) var(--ease);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.month-accordion-card.active .month-accordion-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.month-accordion-panel {
  display: none;
  padding: 1.25rem;
  background: var(--color-surface-2);
}
.month-accordion-card.active .month-accordion-panel {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* ── DAILY FINANCIAL SUMMARY TILES ─────────────────────────── */
.daily-summary-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
}

.summary-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: white;
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.summary-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 0 2px 2px 0;
}
.summary-tile.primary::before { background: var(--color-primary); }
.summary-tile.success::before { background: var(--color-success); }
.summary-tile.warning::before { background: var(--color-warning); }
.summary-tile.accent::before  { background: var(--color-accent); }

.summary-tile-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.07em;
  padding-left: 0.25rem;
}

.summary-tile-value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  padding-left: 0.25rem;
  letter-spacing: -0.02em;
}

.summary-tile-value.primary { color: var(--color-primary); }
.summary-tile-value.warning { color: #c2410c; }
.summary-tile-value.success { color: #16a34a; }

/* ── TAB SWITCH ─────────────────────────────────────────────── */
.manifest-tabs-wrapper {
  display: flex;
  background: var(--color-surface-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease);
  white-space: nowrap;
  width: auto;
  letter-spacing: -0.01em;
}
.tab-btn:hover { color: var(--color-text); background: rgba(0,0,0,.04); }
.tab-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.tab-btn.active:hover { background: var(--color-primary-hover); }

/* ============================================================
   🖨️  PRINT
   ============================================================ */

@media print {
  body { background: white; color: black; }
  .dash-header, .welcome-banner, .metrics-grid,
  .manifest-header, .action-buttons-wrap, .btn,
  .modal-backdrop, .btn-icon { display: none !important; }
  .dash-content { padding: 0 !important; max-width: 100% !important; }
  .manifest-section { border: none !important; box-shadow: none !important; }
  .manifest-table th { background: #e5e7eb !important; }
}

/* ============================================================
   📱  RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Large Tablet (≤1200px) ── */
@media (max-width: 1200px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .search-filter-controls { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  .dash-content { padding: 1.25rem 1rem 4rem; }

  .welcome-title h1 { font-size: 1.4rem; }

  .daily-summary-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .month-accordion-header,
  .accordion-header {
    flex-wrap: wrap;
  }
  .accordion-header-info,
  .month-header-info {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  /* Header */
  .dash-header-inner {
    height: auto;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .logo-group { flex: 1; }

  .user-profile {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
    padding-top: 0.6rem;
  }
  .user-info { text-align: left; }
  .btn-logout { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

  /* Content */
  .dash-content { padding: 1rem 0.875rem 4rem; }

  /* Welcome */
  .welcome-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .btn-sync { width: 100%; }

  /* KPI Grid → 2 columns on mobile */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .metric-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
    border-radius: var(--r-lg);
  }
  .metric-icon-wrap { width: 40px; height: 40px; border-radius: var(--r-md); }
  .metric-value { font-size: 1.35rem; }

  /* Filter controls */
  .search-filter-controls { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .search-filter-controls > *:first-child { grid-column: 1 / -1; }

  /* Title bar */
  .manifest-title-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .manifest-tabs-wrapper { width: 100%; justify-content: center; }
  .tab-btn { flex: 1; padding: 0.45rem 0.5rem; font-size: 0.78rem; }

  /* Manifest section header */
  .manifest-header { padding: 1rem; }

  /* Accordion adjustments */
  .accordion-container { padding: 0.75rem; gap: 0.75rem; }

  .month-accordion-header {
    padding: 0.875rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .month-header-info {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
  }
  .month-title-group span { font-size: 0.95rem; }

  .accordion-header {
    padding: 0.875rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .accordion-header-info {
    width: 100%;
    justify-content: flex-start;
    gap: 0.4rem;
  }
  .accordion-date-group span { font-size: 0.9rem; }

  .month-accordion-panel { padding: 0.75rem; }
  .accordion-panel { padding: 0; }

  /* Summary tiles: 2 col on mobile */
  .daily-summary-dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
  }
  .summary-tile { padding: 0.6rem 0.75rem; }
  .summary-tile-value { font-size: 1rem; }

  /* ─── TABLE → CARD CONVERSION ─── */
  .manifest-table,
  .manifest-table thead,
  .manifest-table tbody,
  .manifest-table th,
  .manifest-table td,
  .manifest-table tr { display: block; }

  .manifest-table thead {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .manifest-table tbody tr {
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    background: white;
    margin: 0 0 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration-base) var(--ease),
                transform var(--duration-base) var(--ease);
  }
  .manifest-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  .manifest-table tbody tr:last-child { margin-bottom: 0; }

  .manifest-table td {
    border: none;
    border-bottom: 1px dashed var(--color-border);
    padding: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    text-align: right;
  }
  .manifest-table td:last-child {
    border-bottom: none;
    padding-top: 0.6rem;
    justify-content: flex-end;
  }
  .manifest-table td::before {
    content: attr(data-label);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-align: left;
    flex-shrink: 0;
    padding-right: 0.5rem;
  }

  .action-buttons-wrap { width: 100%; justify-content: flex-end; }
  .partner-tag-pill { max-width: 100%; }

  /* Modal full-screen on mobile */
  .modal-backdrop { padding: 0.75rem; align-items: flex-end; }
  .modal-content-card {
    max-height: 97vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-width: 100%;
  }

  .traveler-meta-row { grid-template-columns: 1fr; gap: 0.4rem; }

  /* Modal footer stack on mobile */
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .modal-footer > * { width: 100%; }
  .modal-footer > div { display: flex; gap: 0.5rem; }
  .modal-footer > div > * { flex: 1; }
}

/* ── Small Mobile (≤480px) ── */
@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .metric-value { font-size: 1.15rem; }
  .metric-label { font-size: 0.65rem; }
  .metric-icon-wrap { width: 36px; height: 36px; }

  .search-filter-controls { grid-template-columns: 1fr; }
  .search-filter-controls > *:first-child { grid-column: auto; }

  .daily-summary-dashboard { grid-template-columns: 1fr; }

  .welcome-title h1 { font-size: 1.25rem; }
}

/* ============================================================
   ✨  TOAST NOTIFICATION
   ============================================================ */

#toastNotification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  pointer-events: none;
}

/* Toast itself rendered by JS — ensure it looks good */
.toast-inner {
  background: var(--color-text);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn var(--duration-base) var(--ease-spring);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  #toastNotification { right: 1rem; left: 1rem; bottom: 1.25rem; }
}

/* ============================================================
   📱  MOBILE SIDEBAR DRAWER
   ============================================================ */

/* Visibility utilities */
.desktop-only { display: flex; }
.mobile-only  { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: flex !important; }
}

/* Hamburger button */
.hamburger-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--color-border);
  background: white;
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.hamburger-btn:hover {
  background: var(--brand-50);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Overlay backdrop */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 13, 7, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease);
}
.mobile-drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* Sidebar drawer panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100dvh;
  height: 100vh;
  background: white;
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-spring);
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
}
.mobile-drawer.open {
  transform: translateX(0);
}

/* Drawer header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--color-border);
  background: white;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.drawer-close-btn:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* Drawer user block */
.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--brand-50) 0%, white 100%);
}

.drawer-avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--r-lg);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-drawer-user .user-name { font-size: 0.925rem; }
.mobile-drawer-user .user-role { font-size: 0.72rem; margin-top: 0.1rem; }

/* Nav items */
.mobile-drawer-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--r-md);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  user-select: none;
}
.drawer-nav-item:hover {
  background: var(--brand-50);
  color: var(--color-primary);
}
.drawer-nav-item.active {
  background: var(--brand-50);
  color: var(--color-primary);
  font-weight: 700;
}
.drawer-nav-item i { flex-shrink: 0; }

/* Drawer footer with logout */
.mobile-drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.btn-logout-drawer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: var(--color-error-bg);
  border: 1.5px solid rgba(220,38,38,.2);
  color: var(--color-error);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  font-family: var(--font-body);
}
.btn-logout-drawer:hover {
  background: #fecaca;
  border-color: var(--color-error);
  transform: translateY(-1px);
}

/* ============================================================
   📱  MOBILE COMPRESSION FIXES
   ============================================================ */

@media (max-width: 768px) {

  /* Header: single row, no wrapping */
  .dash-header-inner {
    height: 56px;
    padding: 0 1rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  /* Content breathing room */
  .dash-content {
    padding: 1.25rem 0.875rem 5rem;
  }

  /* Welcome section */
  .welcome-banner {
    margin-bottom: 1.25rem;
    gap: 0.75rem;
  }
  .welcome-title h1 {
    font-size: 1.3rem;
    letter-spacing: -0.025em;
  }
  .welcome-title p {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  /* Action buttons in welcome row — stack vertically, full width */
  .welcome-banner > div:last-child {
    flex-direction: column;
    width: 100%;
  }
  .welcome-banner > div:last-child > * {
    width: 100%;
  }

  /* KPI grid: 2 col on mobile, proper spacing */
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .metric-card {
    padding: 0.875rem;
    gap: 0.65rem;
    border-radius: var(--r-lg);
    flex-direction: row;
    align-items: center;
  }
  .metric-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    flex-shrink: 0;
  }
  .metric-icon-wrap svg { width: 18px; height: 18px; }
  .metric-value { font-size: 1.3rem; }
  .metric-label { font-size: 0.65rem; }
  .metric-sub   { font-size: 0.62rem; }

  /* Manifest section */
  .manifest-section { border-radius: var(--r-lg); }
  .manifest-header  { padding: 0.875rem 1rem; gap: 0.75rem; }

  /* Title bar — title on top, tabs below */
  .manifest-title-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .manifest-title h2 { font-size: 1rem; }

  .manifest-tabs-wrapper {
    width: 100%;
    border-radius: var(--r-lg);
  }
  .tab-btn {
    flex: 1;
    padding: 0.45rem 0.4rem;
    font-size: 0.8rem;
    gap: 3px;
  }

  /* Filter controls */
  .search-filter-controls {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .manifest-header select,
  .manifest-header input {
    height: 42px;
    font-size: 0.85rem;
  }

  /* Accordion */
  .accordion-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  .month-accordion-header,
  .accordion-header {
    padding: 0.875rem 1rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .month-title-group span,
  .accordion-date-group span {
    font-size: 0.9rem;
  }
  .month-header-info,
  .accordion-header-info {
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    flex: 1;
  }
  .accordion-header-badge,
  .month-header-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  /* Summary tiles */
  .month-accordion-panel { padding: 0.75rem; }
  .daily-summary-dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.65rem;
    margin-bottom: 0.875rem;
  }
  .summary-tile { padding: 0.55rem 0.75rem; }
  .summary-tile-label { font-size: 0.62rem; }
  .summary-tile-value { font-size: 1rem; }

  /* Table card rows on mobile */
  .manifest-table tbody tr {
    border-radius: var(--r-md);
    padding: 0.875rem;
    margin-bottom: 0.65rem;
  }
  .manifest-table td {
    font-size: 0.84rem;
    padding: 0.45rem 0;
  }
  .manifest-table td::before {
    font-size: 0.62rem;
  }

  /* Modal bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-content-card {
    max-height: 94vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-width: 100%;
    width: 100%;
  }
  .modal-header { padding: 1rem 1.25rem; }
  .modal-body   { padding: 1.25rem; }
  .modal-footer {
    padding: 0.875rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .modal-footer .btn { width: 100%; font-size: 0.875rem; }
  .modal-footer > div {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }
  .modal-footer > div > .btn { flex: 1; }

  .traveler-meta-row { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ── Very small phones (≤400px) ── */
@media (max-width: 400px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .metric-card { padding: 0.75rem; gap: 0.5rem; }
  .metric-icon-wrap { width: 34px; height: 34px; }
  .metric-value { font-size: 1.1rem; }
  .welcome-title h1 { font-size: 1.15rem; }
  .daily-summary-dashboard { grid-template-columns: 1fr; }
}
