:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --border: rgba(20, 20, 20, 0.08);
  --text: #262320;
  --muted: #8a8478;
  --muted-2: #544f47;
  --divider: #f0eee9;
  --blue: oklch(0.52 0.15 250);
  --blue-bg: oklch(0.94 0.03 250);
  --blue-text: oklch(0.45 0.15 250);
  --amber-fill: oklch(0.78 0.14 70);
  --amber-bg: oklch(0.95 0.04 70);
  --amber-text: oklch(0.5 0.14 70);
  --green-fill: oklch(0.65 0.14 145);
  --green-bg: oklch(0.94 0.05 145);
  --green-text: oklch(0.4 0.14 145);
  --red-fill: oklch(0.6 0.18 25);
  --red-bg: oklch(0.95 0.03 25);
  --red-text: oklch(0.5 0.18 25);
  --sidebar-width: 236px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  height: 100%;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(20,20,20,0.15); border-radius: 4px; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: oklch(0.42 0.15 250); }

.mono { font-family: 'IBM Plex Mono', monospace; }

@keyframes fillbar { from { width: 0; } }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
}
.sidebar-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--blue); flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.sidebar-title { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; }
.sidebar-sub { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }

.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  text-align: left; border: none; cursor: pointer; font-family: inherit;
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  background: transparent; color: var(--muted-2);
  text-decoration: none;
}
.nav-item:hover { background: rgba(20,20,20,0.04); }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 700; }
.nav-item.active:hover { background: var(--blue); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-fill); flex: none; }

.streak-card {
  margin-top: auto;
  padding-top: 16px;
}
.streak-card-inner {
  background: var(--amber-bg); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.streak-label { font-size: 11px; font-weight: 700; color: var(--amber-text); text-transform: uppercase; letter-spacing: 0.04em; }
.streak-value { font-size: 22px; font-weight: 800; font-family: 'IBM Plex Mono', monospace; }
.streak-sub { font-size: 11.5px; color: #8a7550; }

/* Main content */
.main {
  flex: 1;
  padding: 30px 36px 100px;
  position: relative;
  min-width: 0;
}

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.page-title-lg { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.page-subtitle { font-size: 13.5px; color: var(--muted); }

.btn {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 10px 16px; border: 1px solid rgba(20,20,20,0.15); background: #fff;
}
.btn:hover { background: #faf9f7; }
.btn-primary {
  border: none; background: var(--blue); color: #fff; font-weight: 700;
}
.btn-primary:hover { background: oklch(0.47 0.15 250); }
.btn:disabled, .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--blue); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
}
.card-sm { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-2-wide { grid-template-columns: 1.3fr 1fr; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
}

.stat-card {
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 26px; font-weight: 800; font-family: 'IBM Plex Mono', monospace; letter-spacing: -0.5px; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* Progress bars */
.req-bar { margin-bottom: 16px; }
.req-bar-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.req-bar-track { height: 9px; border-radius: 5px; background: var(--divider); overflow: hidden; }
.req-bar-fill { height: 100%; border-radius: 5px; animation: fillbar 0.8s ease-out; }
.req-bar-track.lg { height: 11px; border-radius: 6px; }

/* Focus rows */
.focus-row { border-left: 3px solid var(--red-fill); padding: 8px 0 8px 12px; margin-bottom: 10px; }
.focus-name { font-size: 13px; font-weight: 700; }
.focus-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Lists */
.list-row {
  display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--divider); font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.list-date { color: var(--muted); font-family: 'IBM Plex Mono', monospace; margin-right: 10px; }

/* Badges */
.badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; display: inline-block;
}
.badge-lg { font-size: 11px; padding: 3px 9px; }

/* Filter pills */
.pill {
  padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(20,20,20,0.12);
  background: #fff; color: var(--muted-2); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  text-decoration: none; display: inline-block;
}
.pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Table */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; }
.table-header, .table-row {
  display: grid; grid-template-columns: 90px 1.6fr 60px 60px 60px 60px 60px 60px; gap: 8px; align-items: center;
  min-width: 700px;
}
.table-header {
  padding: 12px 18px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.03em; border-bottom: 1px solid var(--divider);
}
.table-row { padding: 11px 18px; font-size: 12.5px; border-bottom: 1px solid var(--divider); font-family: 'IBM Plex Mono', monospace; }
.table-row:last-child { border-bottom: none; }
.table-row .flight-title { font-family: 'Plus Jakarta Sans', sans-serif; }
.table-row-bold { font-weight: 700; }
.table-row-link { color: inherit; text-decoration: none; cursor: pointer; }
.table-row-link:hover { background: var(--bg); }
.admin-table-header, .admin-table-row {
  display: grid; grid-template-columns: 2fr 90px 140px 90px 100px 100px; gap: 8px; align-items: center;
  min-width: 760px;
}
.admin-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; background: var(--green-bg); color: var(--green-text); padding: 2px 6px; border-radius: 5px; margin-left: 6px; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.detail-field-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.detail-field-value { font-size: 14px; }
.detail-field-value.mono { font-family: 'IBM Plex Mono', monospace; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }
.btn-danger { border: 1px solid var(--red-fill); color: var(--red-text); background: #fff; }
.btn-danger:hover { background: var(--red-bg); }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; margin: 0 0 16px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,18,15,0.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 18px; padding: 26px; width: 460px; max-width: 100%; max-height: 86vh; overflow-y: auto;
  position: relative;
}
.modal-card-lg { width: 560px; }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.modal-subtitle { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions > * { flex: 1; }

/* Quick Add header */
.qa-close {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border: none; background: transparent;
  color: var(--muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qa-close:hover { background: var(--bg); color: var(--text); }
.qa-header { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; padding-right: 30px; }
.qa-header-icon {
  width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--blue-bg); border: 1px solid var(--blue-bg);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
}
.qa-header .modal-title, .qa-header .modal-subtitle { margin-bottom: 0; }
.qa-header + .tab-bar { margin-top: 16px; }

/* Quick Add tabs */
.tab-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--bg); border-radius: 12px; padding: 6px; margin-bottom: 18px; }
.tab-btn {
  padding: 9px 6px; border: none; background: transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted-2); cursor: pointer; transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,0.08); font-weight: 800; }
.tab-btn.tab-ai.active { background: var(--blue); color: #fff; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Quick Add role toggle */
.qa-role-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qa-role-btn {
  padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(20,20,20,0.15); background: var(--bg);
  color: var(--muted-2); font-family: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; transition: all .15s;
}
.qa-role-btn:hover { background: #efece6; }
.qa-role-btn.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }

/* Quick Add AI Scan launch screen */
.qa-ai-launch { text-align: center; padding: 14px 4px 4px; }
.qa-ai-launch-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 16px; background: var(--blue-bg); border: 1px solid var(--blue-bg);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
}
.qa-ai-launch-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.qa-ai-launch-sub { font-size: 12.5px; color: var(--muted); max-width: 320px; margin: 0 auto 18px; }
.qa-btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

/* Invoice category checkboxes */
.cat-check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.cat-check-row:last-child { border-bottom: none; }
.cat-check-row label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.cat-check-row input[type="number"] {
  width: 110px; padding: 6px 8px; border: 1px solid rgba(20,20,20,0.15); border-radius: 6px;
  font-family: inherit; font-size: 13px;
}
.cat-check-row input[type="number"]:disabled { background: var(--bg); color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid rgba(20,20,20,0.15); border-radius: 8px;
  font-family: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.field input.mono { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.field-row { display: grid; gap: 10px; }
.field-row-2 { grid-template-columns: 1fr 1fr; }
.field-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.qa-submit {
  width: 100%; padding: 12px; border: none; border-radius: 10px; background: var(--blue); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; margin-top: 4px;
}
.qa-submit:hover { background: oklch(0.47 0.15 250); }

.est-cost-box { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted-2); margin: 6px 0 14px; }

.dropzone {
  border: 2px dashed rgba(20,20,20,0.18); border-radius: 14px; padding: 34px 18px; text-align: center; cursor: pointer;
  background: var(--bg);
}
.dropzone.dragover { background: var(--blue-bg); border-color: var(--blue); }
.dropzone-title { font-size: 13.5px; font-weight: 700; }
.dropzone-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* FAB */
.fab {
  position: fixed; right: 38px; bottom: 30px; background: var(--blue); color: #fff; border: none;
  border-radius: 30px; padding: 15px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18); font-family: inherit; z-index: 40;
}
.fab:hover { background: oklch(0.47 0.15 250); }

/* Documents review table (upload preview) */
.review-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 14px; }
.review-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.review-table td { padding: 4px 6px; border-top: 1px solid var(--divider); }
.review-table input, .review-table select { width: 100%; padding: 5px 6px; border: 1px solid rgba(20,20,20,0.12); border-radius: 6px; font-family: inherit; font-size: 12px; background: #fff; }

.progress-track { height: 6px; background: var(--divider); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.4s; }

/* Calendar mini grid */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 10.5px; color: var(--muted); text-align: center; margin-bottom: 6px; }
.cal-cell { aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-family: 'IBM Plex Mono', monospace; }

/* Gantt */
.gantt-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.gantt-label { width: 170px; font-size: 12.5px; font-weight: 600; flex: none; }
.gantt-track { flex: 1; height: 22px; background: var(--divider); border-radius: 6px; position: relative; }
.gantt-fill { position: absolute; top: 0; height: 100%; border-radius: 6px; }
.gantt-range { width: 150px; font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; text-align: right; flex: none; }

/* Column chart */
.col-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.col-chart-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.col-chart-value { font-size: 10.5px; font-family: 'IBM Plex Mono', monospace; color: var(--muted); }
.col-chart-bar { width: 100%; border-radius: 5px 5px 0 0; background: var(--blue); }
.col-chart-month { font-size: 10px; color: var(--muted); }

/* Category bars */
.cat-bar { margin-bottom: 12px; }
.cat-bar-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.cat-bar-track { height: 7px; border-radius: 4px; background: var(--divider); overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 4px; background: var(--blue); }

/* Milestones */
.milestone-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.milestone-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.milestone-title { font-size: 13px; flex: 1; }
.milestone-date { font-size: 11.5px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }

/* Documents log */
.doc-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.doc-row:last-child { border-bottom: none; }

.settings-section { margin-bottom: 24px; }
.settings-section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.link-quiet { font-size: 12.5px; font-weight: 600; color: var(--text); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }

/* Auth pages (signup/login) */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 380px; max-width: 100%; }
.auth-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-family: 'IBM Plex Mono', monospace; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
.auth-error { background: var(--red-bg); color: var(--red-text); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.auth-success { background: var(--green-bg); color: var(--green-text); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-footer a { font-weight: 700; }

/* Onboarding wizard */
.step-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--divider); }
.step-dot.active { background: var(--blue); }
.role-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid rgba(20,20,20,0.15); border-radius: 8px; margin-bottom: 10px; cursor: pointer; font-size: 13.5px; }
.role-option:hover { background: #faf9f7; }
.onboarding-feedback { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.onboarding-feedback-warn { color: var(--amber-text, #a15c00); }

/* Unverified-framework warning banner */
.framework-warning { background: var(--amber-bg); color: var(--amber-text); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 8px; }

/* Sidebar user menu */
.user-menu { margin-top: 10px; padding: 12px 14px; }
.user-email { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.user-logout { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }

/* ==========================================================================
   Responsive: hamburger menu + off-canvas sidebar, and small-screen fixes
   for otherwise-fixed multi-column layouts. Desktop (>860px) is unchanged.
   ========================================================================== */

.hamburger-btn, .mobile-topbar-brand, .sidebar-close-btn, .sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  .app-shell { display: block; }

  /* Sidebar becomes an off-canvas panel, slid in from the left. */
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 70;
    width: min(84vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,0.18); }
  .sidebar-close-btn {
    display: flex; align-items: center; justify-content: center; margin-left: auto;
    width: 30px; height: 30px; border: none; background: transparent; color: var(--muted);
    border-radius: 8px; cursor: pointer; flex: none;
  }
  .sidebar-close-btn:hover { background: var(--bg); color: var(--text); }
  .sidebar-brand { align-items: flex-start; }

  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(20,18,15,0.45); z-index: 65;
  }
  .sidebar-backdrop.open { display: block; }

  /* Fixed top bar carrying the hamburger + brand, since the sidebar (which
     normally shows the logo/brand) is hidden by default on mobile. */
  .hamburger-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 5px; left: 12px; z-index: 55;
    width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  .mobile-topbar-brand {
    display: flex; align-items: center; position: sticky; top: 0; z-index: 30; min-height: 46px;
    background: var(--bg); padding: 0 16px 0 60px; font-weight: 800; font-size: 15px;
    border-bottom: 1px solid var(--border);
  }

  .main { padding: 16px 16px 90px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-header > div:last-child { display: flex; flex-wrap: wrap; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .field-row-2, .field-row-3 { grid-template-columns: 1fr; }
  .qa-role-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .tab-bar { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .modal-card { padding: 18px; }
  .fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 13px; }

  .gantt-row { flex-wrap: wrap; gap: 6px 14px; }
  .gantt-label { width: 100%; }
  .gantt-track { flex: 1 1 auto; min-width: 140px; }
  .gantt-range { width: auto; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .field-row-2, .field-row-3, .qa-role-row { grid-template-columns: 1fr; }
  .tab-bar { grid-template-columns: repeat(2, 1fr); }
}
