/* ===== COMBATICA FLIGHT EXPENSE TRACKER ===== */
/* Dark theme with gold accent (#F6C502) */

:root {
  --gold: #F6C502;
  --gold-dim: #F6C50233;
  --gold-glow: #F6C50255;
  --bg: #0A0A0B;
  --surface-1: #141416;
  --surface-2: #1C1C1F;
  --surface-3: #242428;
  --surface-4: #2C2C31;
  --border: #2A2A2E;
  --border-light: #3A3A3E;
  --text: #F0F0F0;
  --text-dim: #999;
  --text-muted: #666;
  --danger: #EF4444;
  --danger-dim: #EF444433;
  --success: #22C55E;
  --success-dim: #22C55E33;
  --info: #3B82F6;
  --info-dim: #3B82F633;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 240px;
  --header-h: 64px;
  --transition: 200ms ease;
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; outline: none; transition: border-color var(--transition); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { resize: vertical; min-height: 80px; }
img { max-width: 100%; display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  transition: opacity 0.4s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
#loading-screen .loader-logo { height: 48px; opacity: 0.9; }
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== LOGIN ===== */
#login-screen {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px; padding: 24px;
}
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 400px; width: 100%;
  animation: loginPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes loginPop { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.login-card .logo { height: 40px; margin: 0 auto 24px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.login-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 32px; }
.google-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #333; font-weight: 600; font-size: 15px;
  padding: 12px 32px; border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}
.google-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.google-btn:active { transform: scale(0.97); }
.google-btn svg { width: 20px; height: 20px; }

/* ===== PENDING SCREEN ===== */
#pending-screen {
  position: fixed; inset: 0; z-index: 9997;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center;
}
#pending-screen .pending-icon { font-size: 48px; margin-bottom: 8px; }
#pending-screen h2 { font-size: 22px; }
#pending-screen p { color: var(--text-dim); max-width: 400px; font-size: 14px; }
.pending-signout {
  margin-top: 16px; color: var(--text-dim); font-size: 13px;
  text-decoration: underline; cursor: pointer;
}
.pending-signout:hover { color: var(--text); }

/* ===== APP LAYOUT ===== */
#app { display: none; height: 100dvh; }
#app.visible { display: flex; }

/* ===== SIDEBAR (Desktop) ===== */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  height: 100dvh;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-logo {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; position: relative; gap: 8px;
}
.sidebar-logo img { height: 32px; transition: opacity 0.2s; }
.sidebar-logo .logo-edit-hint {
  display: none; font-size: 11px; color: var(--gold);
  font-weight: 600; white-space: nowrap; cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
  transition: background 0.2s;
}
.sidebar-logo.editable:hover .logo-edit-hint { display: inline; }
.sidebar-logo .logo-edit-hint:hover { background: var(--gold-dim); }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); transform: translateX(4px); }
.nav-item:hover svg { transform: scale(1.1); }
.nav-item.active {
  color: var(--gold); background: var(--gold-dim);
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform var(--transition); }
.sidebar-user {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: 11px; color: var(--text-dim); text-transform: capitalize; }

/* ===== MAIN AREA ===== */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.header {
  height: var(--header-h); min-height: var(--header-h);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-title { font-size: 18px; font-weight: 700; }
.header-subtitle { font-size: 13px; color: var(--text-dim); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius); background: var(--surface-2);
  transition: background var(--transition);
}
.header-user-btn:hover { background: var(--surface-3); }
.header-user-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.header-user-btn .name { font-size: 13px; font-weight: 500; }

/* ===== CONTENT ===== */
.content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

/* ===== ROLE BADGE ===== */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.role-badge.pilot { background: var(--gold-dim); color: var(--gold); }
.role-badge.business { background: var(--info-dim); color: var(--info); }
.role-badge.economy { background: var(--surface-3); color: var(--text-dim); }

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex; padding: 2px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.status-badge.approved { background: var(--success-dim); color: var(--success); }
.status-badge.pending { background: #F59E0B33; color: #F59E0B; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: all var(--transition);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { box-shadow: 0 0 20px var(--gold-glow); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover { background: var(--surface-4); }
.btn-danger { background: var(--danger-dim); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { color: var(--text-dim); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-disabled, .btn:disabled { opacity: 0.35; pointer-events: none; cursor: not-allowed; }

/* ===== VIEW AS ===== */
.view-as-section {
  margin-top: auto; padding: 12px;
  border-top: 1px solid var(--border);
}
.view-as-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px; padding: 0 8px;
}
.view-as-options { display: flex; gap: 4px; }
.view-as-btn {
  flex: 1; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: 12px;
  cursor: pointer; transition: all var(--transition); text-align: center;
}
.view-as-btn:hover { border-color: var(--gold-dim); color: var(--text); }
.view-as-btn.active { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600; }
.view-as-banner {
  background: linear-gradient(135deg, #5B21B6, #7C3AED);
  color: #fff; padding: 10px 16px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 14px;
}
.view-as-badge {
  font-size: 10px; background: var(--gold); color: #000;
  padding: 2px 8px; border-radius: 99px; font-weight: 700;
  margin-left: auto; text-transform: uppercase; letter-spacing: 0.5px;
}
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-label { font-size: 11px; color: var(--text-muted); padding: 4px 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-card .label { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 20px; font-weight: 700; }
.stat-card .value.gold { color: var(--gold); }

/* ===== TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tbody tr {
  transition: all var(--transition);
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.table-wrap { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.95) translateY(10px); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-dim);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== TAGS / CHIPS ===== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  user-select: none;
}
.chip:hover { border-color: var(--text-muted); }
.chip.selected { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); animation: chipPop 0.2s ease; }
@keyframes chipPop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ===== EXPENSE CARDS (Desktop) ===== */
.expenses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.expense-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.expense-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); border-color: var(--border-light); }
.expense-card .receipt-thumb {
  width: 100%; height: 140px; object-fit: cover;
  background: var(--surface-2);
}
.expense-card .receipt-thumb.pdf { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 13px; }
.expense-card-body { padding: 14px; }
.expense-card .amount { font-size: 18px; font-weight: 700; }
.expense-card .date { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.expense-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.expense-card .tags .tag { font-size: 11px; padding: 2px 8px; background: var(--surface-3); border-radius: 99px; color: var(--text-dim); }
.expense-card .payment { font-size: 12px; color: var(--text-dim); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.expense-card-user { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.expense-card-user img { width: 24px; height: 24px; border-radius: 50%; }
.expense-list-row:hover td { background: var(--surface-2); }
.expense-list-row .tag { font-size: 11px; padding: 2px 8px; background: var(--surface-3); border-radius: 99px; color: var(--text-dim); display: inline-block; }
.expense-card-user .name { font-size: 12px; color: var(--text-dim); }

/* ===== RECEIPT VIEWER ===== */
.receipt-viewer {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.rv-close {
  position: fixed; top: 16px; right: 16px; z-index: 1101;
  width: 40px; height: 40px; background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; cursor: pointer;
}
.rv-close:hover { background: rgba(255,255,255,0.25); }
.rv-container {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.rv-container img {
  max-width: 90vw; max-height: 85vh;
  border-radius: var(--radius);
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
.rv-hint {
  position: fixed; bottom: 24px;
  color: rgba(255,255,255,0.4); font-size: 13px;
  pointer-events: none;
}

/* ===== FLIGHT LIST ===== */
.flight-row { cursor: pointer; }
.flight-row .flight-name { font-weight: 600; }
.flight-row .flight-country { color: var(--text-dim); }
.flight-row .flight-dates { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.flight-row .flight-badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-dim); }
.flight-row .flight-badge.archived { background: var(--danger-dim); color: var(--danger); }

/* ===== USER LIST ===== */
.user-row img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-row .user-info { display: flex; align-items: center; gap: 12px; }
.user-actions { display: flex; gap: 8px; }

/* ===== COMPANY CARDS ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cc-card {
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  position: relative; overflow: hidden;
  min-height: 160px; display: flex; flex-direction: column; justify-content: space-between;
}
.cc-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--gold-dim); opacity: 0.3; }
.cc-card .cc-type { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.cc-card .cc-number { font-size: 22px; font-weight: 700; letter-spacing: 3px; margin-top: 20px; }
.cc-card .cc-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.cc-card .cc-network { position: absolute; top: 20px; right: 20px; font-size: 24px; }
.cc-card .cc-delete { position: absolute; bottom: 16px; right: 16px; }

/* ===== REPORT VIEW ===== */
.report-section { margin-bottom: 32px; }
.report-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.report-section h3 img { width: 28px; height: 28px; border-radius: 50%; }
.report-traveler { margin-bottom: 24px; }

/* ===== PARTICIPANT CHIPS ===== */
.participant-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.participant-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px;
}
.participant-chip img { width: 24px; height: 24px; border-radius: 50%; }
.participant-chip .remove { cursor: pointer; color: var(--text-muted); margin-left: 4px; }
.participant-chip .remove:hover { color: var(--danger); }

/* ===== OCR OVERLAY ===== */
.ocr-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
}
.ocr-overlay .ocr-text { color: var(--text-dim); font-size: 15px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
}
.empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); font-size: 14px; max-width: 300px; }

/* ===== SEARCH ===== */
.search-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px 8px 36px;
  width: 100%; max-width: 300px; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%23666' stroke-width='2' fill='none'/%3E%3Cline x1='16' y1='16' x2='21' y2='21' stroke='%23666' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}

/* ===== CONFIRM DIALOG ===== */
.confirm-body { text-align: center; padding: 32px 24px; }
.confirm-body .icon { font-size: 40px; margin-bottom: 16px; }
.confirm-body h3 { font-size: 18px; margin-bottom: 8px; }
.confirm-body p { color: var(--text-dim); font-size: 14px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 24px;
  font-size: 14px; font-weight: 500; z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* ===== MOBILE WIZARD ===== */
.wizard {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  max-width: 100vw;
}
.wizard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.wizard-header h2 { font-size: 16px; font-weight: 700; }
.wizard-steps {
  display: flex; gap: 4px; padding: 12px 20px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.wizard-step {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--surface-3); transition: background 0.3s ease;
}
.wizard-step.active { background: #FFFFFF; }
.wizard-step.done { background: var(--gold); }
.wizard-body { flex: 1; overflow-y: auto; padding: 24px 16px; -webkit-overflow-scrolling: touch; overflow-x: hidden; width: 100%; box-sizing: border-box; }
.wizard-body input, .wizard-body select, .wizard-body textarea { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; min-width: 0 !important; }
.wizard-body input[type="date"] { -webkit-appearance: none; appearance: none; width: 100% !important; max-width: calc(100vw - 32px) !important; box-sizing: border-box !important; font-size: 22px; text-align: center; padding: 14px !important; min-height: 56px; line-height: 1.4; color-scheme: dark; }
.wizard-body input[type="date"]::-webkit-date-and-time-value { text-align: center; padding: 0; }
.wizard-body input[type="date"]:invalid::-webkit-datetime-edit { color: var(--text-muted); }
.wizard-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-1); display: flex; gap: 12px; }
.wizard-footer .btn { flex: 1; }

/* ===== FAB (Mobile) ===== */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  width: 56px; height: 56px;
  background: var(--gold); color: #000;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--gold-glow);
  transition: all var(--transition);
}
.fab:hover { transform: scale(1.1); box-shadow: 0 8px 32px var(--gold-glow); }
.fab:active { transform: scale(0.9); }
.fab svg { width: 24px; height: 24px; }
.fab.open svg { transform: rotate(45deg); transition: transform 0.2s; }

/* FAB Menu */
.fab-menu {
  position: fixed; bottom: 92px; right: 24px; z-index: 99;
  display: none; flex-direction: column; gap: 8px; align-items: flex-end;
}
.fab-menu.open { display: flex; }
.fab-option {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: fabOptionIn 0.2s ease-out both;
}
.fab-option:nth-child(1) { animation-delay: 0.05s; }
.fab-option:nth-child(2) { animation-delay: 0s; }
.fab-option svg { width: 18px; height: 18px; }
@keyframes fabOptionIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Batch progress bar */
.batch-bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}
.batch-bar-inner {
  display: flex; align-items: center; gap: 12px;
}
.batch-bar-track {
  flex: 1; height: 6px; background: var(--surface-3);
  border-radius: 3px; overflow: hidden;
}
.batch-bar-fill {
  height: 100%; background: var(--gold);
  border-radius: 3px; transition: width 0.4s ease;
}
.batch-bar-label {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  white-space: nowrap;
}

/* ===== VIEW AS (Pilot Role Preview) ===== */
.view-as-section {
  margin-top: auto; padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.view-as-label, .dropdown-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; padding: 0 8px; margin-bottom: 8px;
}
.dropdown-label { padding: 8px 12px 4px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.view-as-options {
  display: flex; gap: 4px;
}
.view-as-btn {
  flex: 1; padding: 6px 8px; font-size: 12px; font-weight: 600;
  border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); cursor: pointer;
  transition: all var(--transition); text-align: center;
}
.view-as-btn:hover { background: var(--surface-3); color: var(--text); }
.view-as-btn.active {
  background: var(--gold); color: #000;
  border-color: var(--gold);
}
.view-as-banner {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 14px;
}
.view-as-badge {
  font-size: 10px; background: var(--gold); color: #000;
  padding: 2px 8px; border-radius: 99px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-left: auto;
}

/* ===== LOGO UPLOAD ===== */
.logo-upload-preview {
  background: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface-2) 0% 50%) 50%/16px 16px;
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; align-items: center; justify-content: center;
  min-height: 80px; margin-bottom: 16px;
}
.logo-upload-preview img { max-height: 48px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fadeSlideUp 0.3s ease both; }
.stagger-1 { animation-delay: 30ms; }
.stagger-2 { animation-delay: 60ms; }
.stagger-3 { animation-delay: 90ms; }
.stagger-4 { animation-delay: 120ms; }
.stagger-5 { animation-delay: 150ms; }
.stagger-6 { animation-delay: 180ms; }
.stagger-7 { animation-delay: 210ms; }
.stagger-8 { animation-delay: 240ms; }
.stagger-9 { animation-delay: 270ms; }
.stagger-10 { animation-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 500; overflow: hidden;
  animation: fadeSlideUp 0.2s ease;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-size: 14px;
  transition: background var(--transition);
  width: 100%;
}
.user-dropdown-item:hover { background: var(--surface-3); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item svg { width: 16px; height: 16px; }

/* ===== RECEIPT UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px; text-align: center;
  cursor: pointer; transition: all var(--transition);
}
.upload-area:hover { border-color: var(--gold); background: var(--gold-dim); }
.upload-area svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 12px; }
.upload-area p { color: var(--text-dim); font-size: 14px; }
.upload-area .preview-img { max-height: 200px; margin: 0 auto; border-radius: var(--radius-sm); }

/* ===== MOBILE FLIGHT LIST ===== */
.flight-card-mobile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all var(--transition);
}
.flight-card-mobile:active { transform: scale(0.97); }
.flight-card-mobile .fc-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.flight-card-mobile .fc-country { color: var(--text-dim); font-size: 13px; }
.flight-card-mobile .fc-dates { color: var(--text-dim); font-size: 12px; margin-top: 8px; }
.flight-card-mobile .fc-participants { display: flex; margin-top: 8px; }
.flight-card-mobile .fc-participants img { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface-1); margin-left: -8px; }
.flight-card-mobile .fc-participants img:first-child { margin-left: 0; }

/* ===== MOBILE EXPENSE LIST ===== */
.expense-item-mobile {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.expense-item-mobile .receipt-mini { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.expense-item-mobile .ei-body { flex: 1; min-width: 0; }
.expense-item-mobile .ei-amount { font-size: 16px; font-weight: 700; }
.expense-item-mobile .ei-date { font-size: 12px; color: var(--text-dim); }
.expense-item-mobile .ei-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.expense-item-mobile .ei-tags .tag { font-size: 10px; padding: 1px 6px; background: var(--surface-3); border-radius: 99px; color: var(--text-dim); }
.expense-item-mobile .ei-user { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.expense-item-mobile .ei-user img { width: 18px; height: 18px; border-radius: 50%; }
.expense-item-mobile .ei-user span { font-size: 11px; color: var(--text-dim); }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  height: 56px; min-height: 56px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center; justify-content: space-between;
}
.mobile-header .logo { height: 28px; cursor: pointer; }
.mobile-header-right { display: flex; align-items: center; gap: 8px; }
.mobile-header-right img { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }

.mobile-greeting {
  display: none;
  padding: 16px 20px 8px;
  font-size: 14px; color: var(--text-dim);
}
.mobile-greeting strong { color: var(--text); }

.mobile-back {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 0; margin-bottom: 16px;
}
.mobile-back:hover { color: var(--text); }
.mobile-back svg { width: 18px; height: 18px; }

/* ===== PDF BADGE ===== */
.pdf-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}

/* ===== ARCHIVE TOGGLE ===== */
.archive-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  user-select: none;
}
.archive-toggle input { accent-color: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 899px) {
  .sidebar { display: none; }
  .header { display: none; }
  .mobile-header { display: flex; }
  .mobile-greeting { display: block; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .expenses-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; }
  .form-row { flex-direction: column; gap: 0; }
  input[type="date"] { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .wizard-body { padding: 20px 16px; }
  .wizard-body .form-group input,
  .wizard-body .form-group select,
  .wizard-body .form-group textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
  #app.visible { flex-direction: column; }
  .main-area { min-height: 0; }
}

@media (min-width: 900px) {
  .mobile-only { display: none !important; }
  .fab { display: none; }
}
@media (max-width: 899px) {
  .desktop-only { display: none !important; }
}

/* ===== USER SELECTOR (Manager expense on behalf) ===== */
.user-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.user-selector-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 6px; border-radius: 99px;
  background: var(--surface-3); border: 2px solid transparent;
  cursor: pointer; font-size: 13px; transition: all var(--transition);
}
.user-selector-item:hover { border-color: var(--border-light); }
.user-selector-item.selected { border-color: var(--gold); background: var(--gold-dim); }
.user-selector-item img { width: 24px; height: 24px; border-radius: 50%; }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.text-gold { color: var(--gold); }

/* ===== SKELETON LOADING ===== */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-30 { width: 30%; }
.skeleton-text.lg { height: 22px; }
.skeleton-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.skeleton-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skeleton-rect { border-radius: var(--radius); }
.skeleton-stat {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.skeleton-expense-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 899px) {
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
  .skeleton-expense-grid { grid-template-columns: 1fr; }
}
.text-dim { color: var(--text-dim); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
