/* ═══════════════════════════════════════════════════════════════
   ATO TAXTRACK — Design System
   Palette: Copper & Slate  |  Fonts: Gambetta + Plus Jakarta Sans
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  /* Copper & Slate Palette */
  --copper-100: #F9F3EB;
  --copper-200: #F0E4D0;
  --copper-300: #D4A574;
  --copper-400: #C8924F;
  --copper-500: #B87333;
  --copper-600: #9A5E22;
  --copper-700: #7A4A18;

  --slate-100: #F5F0EB;
  --slate-200: #E8E0D8;
  --slate-300: #C4B8AC;
  --slate-400: #8A7D72;
  --slate-500: #5A5048;
  --slate-600: #3C3530;
  --slate-700: #2F2822;
  --slate-800: #1E1A16;
  --slate-900: #120F0C;

  /* Semantic tokens */
  --bg-base:        #F7F2EC;
  --bg-surface:     #FFFFFF;
  --bg-surface-2:   #FAF7F3;
  --bg-sidebar:     #1E1A16;
  --bg-sidebar-2:   #2A2420;

  --text-primary:   #1E1A16;
  --text-secondary: #5A5048;
  --text-muted:     #8A7D72;
  --text-inverse:   #F5F0EB;
  --text-inverse-2: #C4B8AC;

  --border:         #E2D9CF;
  --border-strong:  #C4B8AC;

  --accent:         #B87333;
  --accent-light:   #F0E4D0;
  --accent-hover:   #9A5E22;

  --green:          #2D7D46;
  --green-light:    #E8F5ED;
  --amber:          #B87A00;
  --amber-light:    #FFF8E6;
  --red:            #C0392B;
  --red-light:      #FDECEA;
  --blue:           #1A5276;
  --blue-light:     #EBF5FB;

  /* Spacing */
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(30,26,22,0.08), 0 1px 2px rgba(30,26,22,0.04);
  --shadow:         0 4px 12px rgba(30,26,22,0.10), 0 2px 4px rgba(30,26,22,0.06);
  --shadow-lg:      0 12px 32px rgba(30,26,22,0.14), 0 4px 8px rgba(30,26,22,0.08);
  --shadow-modal:   0 24px 64px rgba(30,26,22,0.22), 0 8px 16px rgba(30,26,22,0.12);

  /* Transitions */
  --transition:     0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: 'Gambetta', serif;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

input, select, textarea, button {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--copper-500);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-family: 'Gambetta', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-inverse);
  letter-spacing: -0.02em;
}

.brand-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-inverse-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 0.75rem 0.5rem 0.35rem;
  margin-top: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-inverse-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-inverse);
}

.nav-item.active {
  background: var(--copper-500);
  color: white;
}

.nav-item.active svg { opacity: 1; }

.nav-item svg { opacity: 0.7; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  color: var(--text-inverse);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
}

.sidebar-footer {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fy-selector label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 0.35rem;
}

.fy-selector select {
  width: 100%;
  background: var(--bg-sidebar-2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-inverse);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23C4B8AC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.ato-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(45,125,70,0.15);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,125,70,0.25);
}

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

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.menu-toggle:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.topbar-title {
  font-family: 'Gambetta', serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--copper-500);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ─── MODULES ─── */
.module {
  display: none;
  padding: 2rem 1.75rem;
  flex: 1;
  animation: fadeIn 0.22s ease;
}

.module.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.module-title {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.module-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--copper-500);
  color: white;
}
.btn-primary:hover { background: var(--copper-600); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(184,115,51,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text-primary); border-color: var(--slate-400); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #a93226; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--copper-600);
}

.card-badge-amber {
  background: var(--amber-light);
  color: var(--amber);
}

.card-badge-green {
  background: var(--green-light);
  color: var(--green);
}

/* ═══════════════════════════════════════════════
   KPI GRID (Dashboard)
═══════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover { box-shadow: var(--shadow); }

.kpi-card.kpi-primary {
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-700) 100%);
  border-color: var(--slate-600);
}

.kpi-card.kpi-primary .kpi-data .kpi-value { color: white; font-size: 1.8rem; }
.kpi-card.kpi-primary .kpi-data .kpi-label { color: var(--slate-300); }
.kpi-card.kpi-primary .kpi-icon { color: var(--copper-300); }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--copper-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-green { background: var(--green-light); color: var(--green); }
.kpi-icon-amber { background: var(--amber-light); color: var(--amber); }
.kpi-icon-copper { background: var(--accent-light); color: var(--copper-500); }

.kpi-data { flex: 1; }

.kpi-value {
  display: block;
  font-family: 'Gambetta', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.2rem;
}

.kpi-threshold { width: 100%; }

.threshold-track {
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.threshold-fill {
  height: 100%;
  background: var(--copper-400);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.threshold-fill.complete { background: var(--green); }

.threshold-label {
  font-size: 0.7rem;
  color: var(--slate-300);
}

/* ═══════════════════════════════════════════════
   SECTION ROW (2-col layout)
═══════════════════════════════════════════════ */
.section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════
   COMPLIANCE CARD
═══════════════════════════════════════════════ */
.compliance-card { margin-bottom: 0; }

.compliance-list {
  padding: 0.5rem 0;
}

.compliance-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.compliance-item:last-child { border-bottom: none; }
.compliance-item:hover { background: var(--bg-surface-2); }

.chk-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}

.chk-icon.pending {
  border: 2px solid var(--border-strong);
  background: transparent;
}

.chk-icon.pass {
  background: var(--green);
  border: 2px solid var(--green);
}

.chk-icon.pass::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 6px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.chk-icon.fail {
  background: var(--red);
  border: 2px solid var(--red);
}

.chk-icon.fail::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.chk-content { flex: 1; }

.chk-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chk-desc {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.chk-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: var(--slate-200);
  color: var(--text-muted);
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}

.compliance-item.pass .chk-status {
  background: var(--green-light);
  color: var(--green);
}

.compliance-item.fail .chk-status {
  background: var(--red-light);
  color: var(--red);
}

/* ═══════════════════════════════════════════════
   ACTIVITY CARD
═══════════════════════════════════════════════ */
.activity-card { margin-bottom: 0; }

.activity-list { padding: 0.5rem 0; max-height: 340px; overflow-y: auto; }

.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.activity-empty svg { opacity: 0.35; }
.activity-empty p { font-size: 0.85rem; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-surface-2); }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.trip { background: var(--copper-500); }
.activity-dot.expense { background: var(--amber); }
.activity-dot.vehicle { background: var(--green); }

.activity-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong { color: var(--text-primary); font-weight: 600; }

.activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   EXPENSE BREAKDOWN
═══════════════════════════════════════════════ */
.expense-breakdown {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.breakdown-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1rem 0;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.breakdown-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  width: 160px;
  flex-shrink: 0;
}

.breakdown-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--copper-400);
  transition: width 0.5s ease;
}

.breakdown-amount {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 80px;
  text-align: right;
}

/* ═══════════════════════════════════════════════
   STATS BAR
═══════════════════════════════════════════════ */
.stats-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 100px;
  padding: 0.25rem 0.5rem;
}

.stat-value {
  font-family: 'Gambetta', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   INFO BANNER
═══════════════════════════════════════════════ */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--blue-light);
  border: 1px solid rgba(26,82,118,0.2);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: var(--blue);
  line-height: 1.5;
}

.info-banner svg { flex-shrink: 0; margin-top: 1px; }

/* ═══════════════════════════════════════════════
   COMPLIANCE PILL
═══════════════════════════════════════════════ */
.compliance-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid rgba(184,122,0,0.2);
}

.compliance-pill.compliant {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(45,125,70,0.2);
}

.compliance-pill.non-compliant {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(192,57,43,0.2);
}

/* ═══════════════════════════════════════════════
   TABLE STYLES
═══════════════════════════════════════════════ */
.table-card { margin-bottom: 0; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-box svg { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  width: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }

.table-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-filters select {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238A7D72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}

.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
}

.data-table thead tr {
  background: var(--bg-surface-2);
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--bg-surface-2); }

.col-actions { width: 80px; text-align: center; }

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.table-empty svg { opacity: 0.3; }
.table-empty p { font-size: 0.9rem; }

/* Table action buttons */
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}

.action-btn:hover { background: var(--bg-base); color: var(--text-primary); }
.action-btn.delete:hover { background: var(--red-light); color: var(--red); }

/* Trip type badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.type-badge.business {
  background: var(--green-light);
  color: var(--green);
}

.type-badge.private {
  background: var(--slate-200);
  color: var(--slate-500);
}

/* Category badge */
.cat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--copper-600);
}

/* ═══════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  padding: 1.25rem 1.5rem;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-group-full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--copper-400);
  box-shadow: 0 0 0 3px rgba(184,115,51,0.12);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.form-group textarea { resize: vertical; min-height: 70px; }

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238A7D72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.field-error {
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 500;
  min-height: 1rem;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.required-star { color: var(--red); }

.input-prefix, .input-suffix {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-prefix:focus-within,
.input-suffix:focus-within {
  border-color: var(--copper-400);
  box-shadow: 0 0 0 3px rgba(184,115,51,0.12);
}

.input-prefix span, .input-suffix span {
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.input-suffix span {
  border-right: none;
  border-left: 1px solid var(--border);
}

.input-prefix input, .input-suffix input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
}

.radio-group {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.radio-label input[type="radio"] { display: none; }

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--copper-500);
  background: var(--copper-500);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-actions {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════
   DISTANCE PREVIEW
═══════════════════════════════════════════════ */
.distance-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-light);
  border: 1px solid rgba(45,125,70,0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--green);
}

/* ═══════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,26,22,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlayIn 0.2s ease;
}

.modal-overlay.open { display: flex; }

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

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm { max-width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
}

.modal-close:hover { background: var(--bg-base); color: var(--text-primary); }

.modal-ato-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-light);
  border-bottom: 1px solid rgba(45,125,70,0.15);
  padding: 0.65rem 1.5rem;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 500;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   VEHICLE GRID
═══════════════════════════════════════════════ */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.vehicle-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
}

.vehicle-empty svg { opacity: 0.3; }

.vehicle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
  position: relative;
}

.vehicle-card:hover { box-shadow: var(--shadow); }

.vehicle-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.vehicle-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--copper-500);
}

.vehicle-actions { display: flex; gap: 0.25rem; }

.vehicle-name {
  font-family: 'Gambetta', serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.vehicle-rego {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.vehicle-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.vehicle-detail-item { display: flex; flex-direction: column; gap: 0.1rem; }

.vehicle-detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vehicle-detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   TAX SUMMARY
═══════════════════════════════════════════════ */
.tax-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tax-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.tax-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tax-card-value {
  font-family: 'Gambetta', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tax-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.tax-card.highlight {
  background: linear-gradient(135deg, var(--copper-500), var(--copper-600));
  border-color: var(--copper-600);
}

.tax-card.highlight .tax-card-label,
.tax-card.highlight .tax-card-value,
.tax-card.highlight .tax-card-sub { color: white; }

.tax-card.highlight .tax-card-label { opacity: 0.8; }
.tax-card.highlight .tax-card-sub { opacity: 0.75; }

/* ATO Schedule */
.ato-schedule {
  padding: 1.5rem;
}

.ato-schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.ato-schedule-row:last-child { border-bottom: none; }

.ato-schedule-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex: 1;
}

.ato-schedule-label strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.ato-schedule-amount {
  font-family: 'Gambetta', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  min-width: 100px;
}

.ato-schedule-amount.deductible { color: var(--green); }

/* ═══════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  align-items: start;
}

.settings-card { overflow: visible; }

.settings-actions {
  padding: 0.5rem 0;
}

.settings-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.settings-action-item:last-child { border-bottom: none; }

.settings-action-item > div strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.settings-action-item > div p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.danger-zone { background: var(--red-light); }
.danger-zone > div strong { color: var(--red); }

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--slate-800);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--amber); }

.toast-icon { font-size: 1rem; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .tax-summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .section-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }

  .menu-toggle { display: flex; }

  .module { padding: 1.25rem 1rem; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

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

  .form-grid, .form-grid-2 { grid-template-columns: 1fr; }

  .stats-bar { gap: 0; }
  .stat-item { min-width: 80px; }

  .topbar { padding: 0 1rem; }

  .module-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .tax-summary-grid { grid-template-columns: 1fr; }
  .header-actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
}

/* ═══════════════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .header-actions, .table-toolbar,
  .btn, .action-btn, .modal-overlay { display: none !important; }

  .main-content { margin-left: 0; }
  .module { display: block !important; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}