/* ═══════════════════════════════════════════════════════════════════════════
   TCP CALCULATOR — Stylesheet
   Aesthetic: Aviation instrument panel — dark, precise, amber accents
   Fonts: Syne (display) + DM Mono (numbers)
════════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:          #0b0f1a;
  --surface:     #131928;
  --surface-2:   #1a2235;
  --surface-3:   #202d43;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);

  --amber:       #f5a623;
  --amber-dim:   #b37a19;
  --amber-glow:  rgba(245,166,35,0.12);
  --blue:        #3b82f6;
  --blue-dim:    rgba(59,130,246,0.15);
  --green:       #10b981;
  --green-dim:   rgba(16,185,129,0.15);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.15);
  --yellow:      #f59e0b;
  --yellow-dim:  rgba(245,158,11,0.15);

  --text:        #e8eaf0;
  --text-2:      #8b93a8;
  --text-3:      #5c6478;

  --radius:      8px;
  --radius-sm:   4px;
  --radius-lg:   14px;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --nav-h: 60px;
}

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

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

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: #ffc155; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.9rem;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(11,15,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.navbar-brand a {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text); font-weight: 800; font-size: 1.2rem;
}
.brand-icon { color: var(--amber); font-size: 1.3rem; }
.brand-text em { color: var(--amber); font-style: normal; }

.navbar-links {
  display: flex; gap: 0.25rem; list-style: none; flex: 1;
}
.navbar-links a {
  color: var(--text-2); font-size: 0.85rem; font-weight: 500;
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.navbar-links a:hover, .navbar-links a.active {
  color: var(--text); background: var(--surface-2);
}
.navbar-links a.active { color: var(--amber); }
.admin-link { color: var(--amber) !important; }

.navbar-user {
  display: flex; align-items: center; gap: 0.5rem; margin-left: auto;
}
.user-badge {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-2); font-size: 0.85rem;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--amber-glow); border: 1px solid var(--amber-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; color: var(--amber);
}
.user-name { font-weight: 500; }

.btn-logout {
  background: none; border: 1px solid var(--border-2);
  color: var(--text-3); padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.8rem; transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }

/* ─── Main content ───────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.page-sub   { color: var(--text-2); font-size: 0.9rem; margin-top: 0.2rem; }
.accent     { color: var(--amber); }

.header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--amber); color: #0b0f1a;
  border: none; padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.btn-primary:hover { background: #ffc155; color: #0b0f1a; }
.btn-primary.btn-full { width: 100%; justify-content: center; padding: 0.75rem; font-size: 0.95rem; }

.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2); padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); font-weight: 500; font-size: 0.85rem;
  cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center;
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-2); color: var(--text); }

.btn-primary.small, .btn-secondary.small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.btn-icon {
  background: none; border: none; cursor: pointer; padding: 0.3rem;
  font-size: 1rem; opacity: 0.7; transition: opacity 0.15s;
}
.btn-icon:hover { opacity: 1; }
.btn-icon.btn-danger:hover { filter: saturate(2); }

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; font-size: 0.88rem; font-weight: 500;
}
.alert-error   { background: var(--red-dim);    border-left: 3px solid var(--red);    color: #fca5a5; }
.alert-success { background: var(--green-dim);  border-left: 3px solid var(--green);  color: #6ee7b7; }
.alert-warn    { background: var(--yellow-dim); border-left: 3px solid var(--yellow); color: #fde68a; }
.alert a       { color: inherit; text-decoration: underline; }

/* ─── Stats grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.stat-label { font-size: 0.75rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); color: var(--amber); line-height: 1; }
.stat-value.small { font-size: 1rem; }
.stat-value.mono  { font-family: var(--font-mono); }

/* ─── Quick actions ──────────────────────────────────────────────────────────── */
.quick-actions { margin-bottom: 2rem; }
.quick-actions h2, .history-section h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); margin-bottom: 0.75rem; font-weight: 600;
}
.action-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.action-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  color: var(--text); transition: all 0.15s;
}
.action-card:hover { background: var(--surface-2); border-color: var(--amber-dim); color: var(--text); transform: translateY(-1px); }
.action-icon  { font-size: 1.5rem; }
.action-title { font-weight: 700; font-size: 0.9rem; }
.action-sub   { font-size: 0.78rem; color: var(--text-2); }

/* ─── History ────────────────────────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 0.4rem; }
.history-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 1rem;
  display: flex; align-items: center; gap: 1rem; color: var(--text);
  transition: background 0.15s;
}
.history-item:hover { background: var(--surface-2); color: var(--text); }
.history-date  { font-weight: 600; min-width: 80px; }
.history-count { color: var(--text-2); font-size: 0.85rem; }
.history-arrow { margin-left: auto; color: var(--amber); }

/* ─── Month nav ──────────────────────────────────────────────────────────────── */
.month-nav {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 1rem;
}
.month-btn    { font-size: 0.85rem; color: var(--text-2); transition: color 0.15s; }
.month-btn:hover { color: var(--amber); }
.month-current { flex: 1; text-align: center; font-weight: 700; color: var(--text); }

/* ─── Summary bar ────────────────────────────────────────────────────────────── */
.summary-bar {
  display: flex; flex-wrap: wrap; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.summary-item { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.summary-item span { font-size: 0.72rem; color: var(--text-2); text-transform: uppercase; }
.summary-item strong { font-family: var(--font-mono); font-size: 1.05rem; color: var(--amber); }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.duties-table, .report-table {
  width: 100%; border-collapse: collapse; font-size: 0.87rem;
}
.duties-table th, .report-table th {
  background: var(--surface-2); color: var(--text-2);
  padding: 0.6rem 0.8rem; text-align: left;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-2);
}
.duties-table td, .report-table td {
  padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.duties-table tr:last-child td, .report-table tbody tr:last-child td { border-bottom: none; }
.duties-table tr:hover td, .report-table tbody tr:hover td { background: var(--surface-2); }
.row-zero td { opacity: 0.45; }
.row-inactive td { opacity: 0.5; }

.report-table tfoot .total-row td {
  background: var(--surface-2); border-top: 2px solid var(--amber-dim);
  font-weight: 700; padding: 0.85rem 0.8rem;
}
.total-label  { color: var(--text-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.total-amount { color: var(--amber); font-size: 1.2rem; }
.col-amount   { text-align: right; }
.amount-pos   { color: var(--green); }

.report-table.compact td { padding: 0.45rem 0.7rem; font-size: 0.82rem; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.5rem;
  border-radius: 3px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
}
.badge-firma       { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-calzo       { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge-imaginaria  { background: rgba(245,158,11,0.15); color: #fde68a; }
.badge-formacion   { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.badge-libre       { background: rgba(156,163,175,0.1); color: #9ca3af; }
.badge-otro        { background: rgba(156,163,175,0.1); color: #9ca3af; }
.badge-admin       { background: var(--amber-glow); color: var(--amber); }
.badge-user        { background: var(--blue-dim);   color: #93c5fd; }
.badge-system      { background: var(--blue-dim); color: #93c5fd; font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 3px; }
.badge-custom      { background: var(--green-dim); color: #6ee7b7; font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 3px; }

.haul { font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.4rem; border-radius: 3px; }
.haul-short { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.haul-long  { background: rgba(99,102,241,0.15); color: #c4b5fd; }
.haul-mixed { background: rgba(245,158,11,0.12); color: #fde68a; }

.type-badge {
  display: inline-block; padding: 0.2rem 0.5rem;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 3px; font-size: 0.72rem; font-weight: 500;
}
.type-fixed_monthly      { background: rgba(99,102,241,0.15); color: #c4b5fd; }
.type-per_flight_hour    { background: var(--green-dim); color: #6ee7b7; }
.type-per_sector         { background: var(--blue-dim); color: #93c5fd; }
.type-per_duty           { background: rgba(245,166,35,0.12); color: #fcd34d; }
.type-night_supplement   { background: rgba(139,92,246,0.12); color: #c4b5fd; }
.type-weekend_supplement { background: rgba(236,72,153,0.12); color: #f9a8d4; }
.type-overtime           { background: var(--red-dim); color: #fca5a5; }
.type-standby            { background: var(--yellow-dim); color: #fde68a; }
.type-training           { background: rgba(168,85,247,0.12); color: #d8b4fe; }

.overnight-tag { font-size: 0.65rem; background: var(--amber-glow); color: var(--amber); padding: 0.1rem 0.3rem; border-radius: 3px; margin-left: 0.25rem; }
.cond-tag { display: inline-block; background: var(--surface-3); border-radius: 3px; padding: 0.1rem 0.35rem; font-size: 0.7rem; margin: 0.1rem; color: var(--text-2); }
.active-badge { color: var(--green); font-weight: 700; font-size: 0.85rem; }
.status-on  { color: var(--green); font-weight: 600; font-size: 0.82rem; }
.status-off { color: var(--red);   font-weight: 600; font-size: 0.82rem; }
.airline-code { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); margin-right: 0.5rem; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.form-card.flat { padding: 1rem; }

.form-section { margin-top: 1.5rem; }
.section-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin-bottom: 1rem; font-weight: 600; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.col-span-2 { grid-column: span 2; }

.field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.field-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.field-group input,
.field-group select,
.field-group textarea {
  background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--text); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
  transition: border-color 0.15s; width: 100%;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus { outline: none; border-color: var(--amber); }
.field-group input:disabled { opacity: 0.5; cursor: not-allowed; }
.field-hint { font-size: 0.75rem; color: var(--text-3); }
.field-check { flex-direction: row; align-items: center; }
.check-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text); cursor: pointer; font-weight: normal; text-transform: none; letter-spacing: 0; }
.check-label input[type="checkbox"] { width: auto; }

.computed-field {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.8rem;
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--amber);
}

.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; }

.inline-admin-form { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.inline-admin-form input, .inline-admin-form select { flex: 1; }

.concept-form .form-grid { margin-bottom: 1rem; }

/* ─── Report card ────────────────────────────────────────────────────────────── */
.report-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1.5rem; overflow-x: auto;
}
.report-card h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); margin-bottom: 1rem; font-weight: 600;
}
.conv-note { font-size: 0.82rem; color: #fde68a; margin-bottom: 1rem; background: var(--yellow-dim); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border-left: 3px solid var(--yellow); }
.conv-note-small { font-size: 0.78rem; color: var(--text-3); margin-top: 0.4rem; }
.report-disclaimer { font-size: 0.78rem; color: var(--text-3); margin-top: 1rem; padding: 0.75rem; background: var(--surface-2); border-radius: var(--radius-sm); line-height: 1.5; }

/* ─── Report metrics ─────────────────────────────────────────────────────────── */
.report-metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.metric-label { font-size: 0.7rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--amber); }

/* ─── Toggle switch ──────────────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--surface-3); border-radius: 20px; transition: 0.2s; }
.toggle-slider::before { content:''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: var(--text-3); border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--green-dim); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--green); }

/* ─── Rate input ─────────────────────────────────────────────────────────────── */
.rate-input {
  width: 90px; background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--amber); font-family: var(--font-mono); font-size: 0.85rem;
  padding: 0.3rem 0.5rem; border-radius: var(--radius-sm); text-align: right;
}
.rate-input:focus { outline: none; border-color: var(--amber); }

/* ─── Conventions grid ───────────────────────────────────────────────────────── */
.conventions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.conv-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.15s;
}
.conv-card.conv-active { border-color: var(--green); box-shadow: 0 0 0 1px rgba(16,185,129,0.2); }
.conv-card.conv-new { border-style: dashed; border-color: var(--border-2); }
.conv-header { display: flex; justify-content: space-between; align-items: flex-start; }
.conv-header h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; }
.conv-meta { font-size: 0.78rem; color: var(--text-2); }
.conv-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; flex-wrap: wrap; }

/* ─── Day display ────────────────────────────────────────────────────────────── */
.col-date { display: flex; flex-direction: column; gap: 0.1rem; }
.day-name { font-size: 0.72rem; color: var(--text-2); text-transform: uppercase; }
.day-date { font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; }

/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius-lg);
}
.empty-icon { font-size: 3rem; }

/* ─── Login ──────────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at 20% 50%, rgba(245,166,35,0.05) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.05) 0%, transparent 60%),
              var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-icon  { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.login-brand h1 { font-size: 2rem; font-weight: 800; }
.login-brand h1 em { color: var(--amber); font-style: normal; }
.login-brand p { color: var(--text-2); font-size: 0.85rem; margin-top: 0.3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-help { text-align: center; font-size: 0.78rem; color: var(--text-3); margin-top: 1.25rem; }

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.mono  { font-family: var(--font-mono); }
.small { font-size: 0.82rem; }
.muted { color: var(--text-2); }
.actions-cell { white-space: nowrap; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border); padding: 1.5rem;
  text-align: center; color: var(--text-3); font-size: 0.78rem;
}

/* ─── Error page ─────────────────────────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-card { text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--amber); font-family: var(--font-mono); line-height: 1; display: block; margin-bottom: 0.5rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-links, .navbar-user { display: none; }
  .navbar.open .navbar-links  { display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border-2); padding: 1rem; z-index: 99; }
  .navbar.open .navbar-user   { display: flex; position: absolute; top: calc(var(--nav-h) + 200px); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border-2); padding: 1rem; z-index: 99; }
  .nav-toggle   { display: block; margin-left: auto; }
  .form-grid    { grid-template-columns: 1fr; }
  .col-span-2   { grid-column: span 1; }
  .page-header  { flex-direction: column; }
  .header-actions { width: 100%; }
  .col-dest, .col-notes { display: none; }
}

@media (max-width: 480px) {
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .main-content  { padding: 1rem 1rem 3rem; }
  .report-card   { padding: 1rem; }
  .form-card     { padding: 1rem; }
}

/* ─── Subscription badges ────────────────────────────────────────────────────── */
.sub-badge {
  display: inline-block; padding: 0.2rem 0.55rem;
  border-radius: 3px; font-size: 0.75rem; font-weight: 600;
}
.sub-active  { background: var(--green-dim); color: #6ee7b7; }
.sub-expired { background: var(--red-dim);   color: #fca5a5; }
.sub-none    { background: var(--surface-3); color: var(--text-3); }
.sub-admin   { background: var(--amber-glow); color: var(--amber); }

.sub-cell { line-height: 1.6; }
.status-warn { color: var(--yellow); font-weight: 600; font-size: 0.82rem; }
.row-expired td { opacity: 0.6; background: rgba(239,68,68,0.03); }

/* ─── Subscription form (in admin) ──────────────────────────────────────────── */
.subrow td { background: var(--surface-2) !important; padding: 0.75rem 1rem !important; }
.subrow-label { font-size: 0.8rem; color: var(--text-2); margin-right: 0.75rem; white-space: nowrap; }
.sub-form-wrapper { padding: 0.5rem 0; }
.sub-form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem; margin: 0.75rem 0;
}
.sub-form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn-danger-sm {
  background: var(--red-dim); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3);
  padding: 0.3rem 0.7rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-danger-sm:hover { background: var(--red); color: white; }

/* ─── Expired page ───────────────────────────────────────────────────────────── */
.expired-card {
  border-color: rgba(239,68,68,0.3) !important;
  box-shadow: 0 0 40px rgba(239,68,68,0.08) !important;
}
.expired-body { text-align: center; padding: 1rem 0 1.5rem; }
.expired-title { font-size: 1.2rem; font-weight: 800; color: #fca5a5; margin-bottom: 0.75rem; }
.expired-msg { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }
.expired-user { margin-top: 1rem; font-size: 0.85rem; color: var(--text-3); }
.expired-actions { display: flex; flex-direction: column; gap: 0.5rem; }

/* ─── Documents module ───────────────────────────────────────────────────────── */
.doc-search-bar { margin-bottom: 1rem; }
.doc-search-bar input {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border-2);
  color: var(--text); padding: 0.65rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.doc-search-bar input:focus { outline: none; border-color: var(--amber); }

.doc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.doc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s;
}
.doc-card:hover { border-color: var(--border-2); }
.doc-card-top { display: flex; align-items: center; justify-content: space-between; }
.doc-airline-code {
  font-family: var(--font-mono); font-weight: 800; font-size: 1.3rem;
  color: var(--amber); letter-spacing: 0.05em;
}
.doc-airline-name { font-weight: 700; font-size: 0.95rem; }
.doc-filename { font-size: 0.78rem; color: var(--text-2); word-break: break-all; }
.doc-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-3); }
.doc-linked { font-size: 0.78rem; color: var(--green); }
.doc-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

/* AI status badges */
.ai-badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 3px; font-size: 0.72rem; font-weight: 600;
}
.ai-pending    { background: var(--surface-3); color: var(--text-2); }
.ai-processing { background: var(--blue-dim); color: #93c5fd; }
.ai-done       { background: var(--green-dim); color: #6ee7b7; }
.ai-failed     { background: var(--red-dim); color: #fca5a5; }
.ai-skipped    { background: var(--surface-3); color: var(--text-3); }

.ai-status-big {
  display: inline-block; padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 700; white-space: nowrap;
}

/* AI card */
.ai-card { }
.ai-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ai-card-header h2 { margin-bottom: 0; }

/* Processing animation */
.processing-anim { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem; }
.processing-dots { display: flex; gap: 0.4rem; }
.processing-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber); animation: dotPulse 1.2s infinite;
}
.processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.processing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,80%,100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.extracted-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.extracted-count { font-size: 0.9rem; }

/* Import section */
.import-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.import-form { }

.re-extract { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.danger-zone { display: flex; justify-content: flex-end; margin-top: 0.75rem; }

/* Doc info bar */
.doc-info-bar {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
}
.doc-info-item { display: flex; flex-direction: column; gap: 0.15rem; }
.doc-info-item span { font-size: 0.72rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-info-item strong { font-size: 0.88rem; }
.doc-code-big { font-family: var(--font-mono); color: var(--amber); font-size: 1.4rem; }

/* Upload form */
.airline-search-wrap { position: relative; }
.airline-dropdown {
  display: none; position: absolute; z-index: 50;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); max-height: 280px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dropdown-group { padding: 0.4rem 0.75rem; font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface-3); }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.75rem; cursor: pointer; transition: background 0.1s; }
.dropdown-item:hover { background: var(--surface-3); }
.item-code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--amber); min-width: 35px; }
.item-name { font-size: 0.86rem; }
.dropdown-empty { padding: 0.75rem; text-align: center; color: var(--text-3); font-size: 0.85rem; }

.airline-preview {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--amber-glow); border: 1px solid var(--amber-dim);
  border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; margin-top: 0.5rem;
}
.preview-code { font-family: var(--font-mono); font-weight: 800; color: var(--amber); font-size: 1.1rem; }
.preview-name { font-weight: 600; flex: 1; }

.file-drop-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--surface);
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--amber); background: var(--amber-glow);
}
.file-drop-zone.has-file { border-color: var(--green); background: var(--green-dim); }
.drop-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.file-browse-link { color: var(--amber); cursor: pointer; text-decoration: underline; }
.file-info {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; margin-top: 0.5rem;
}
.file-icon { font-size: 1.3rem; }
.file-name { font-weight: 600; flex: 1; word-break: break-all; }
.file-size { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); }

/* ─── Subscription info card (profile) ──────────────────────────────────────── */
.sub-info-card {
  display: flex; align-items: flex-start; gap: 1.25rem;
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; margin-top: 1.25rem;
}
.sub-info-card.sub-active  { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.05); }
.sub-info-card.sub-expired { border-color: rgba(239,68,68,0.35);  background: rgba(239,68,68,0.05); }
.sub-info-card.sub-none    { border-color: var(--border-2);       background: var(--surface); }
.sub-info-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }
.sub-info-body h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2); font-weight: 600; margin-bottom: 0.4rem; }
.sub-info-body p  { font-size: 0.9rem; color: var(--text); margin-bottom: 0.2rem; }
.sub-days  { font-family: var(--font-mono); color: var(--green); font-weight: 700; }
.sub-warn  { color: #fde68a; font-size: 0.85rem; }
.sub-since { font-size: 0.78rem; color: var(--text-3); margin-top: 0.25rem; }
