/* TRAILER PRO — Complete Stylesheet
   See individual component files for modular imports
   Generated from index.html style block
*/


/* ═══════════════════════════════════════════════════════
   TRAILER PRO — Design System
   Light mode, Navy header, professional SaaS
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────── */
:root {
  /* Navy header */
  --navy:      #1a2744;
  --navy-dark: #111d38;
  --navy-light:#243358;

  /* Surfaces */
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --surface2:  #f8f9fc;

  /* Borders */
  --border:    #e4e8f0;
  --border2:   #d0d7e6;

  /* Text */
  --t1:        #111827;
  --t2:        #4b5563;
  --t3:        #9ca3af;
  --t4:        #c4c9d4;

  /* Accent */
  --blue:      #2563eb;
  --blue-l:    #eff6ff;
  --blue-b:    #dbeafe;

  /* Status */
  --green:     #16a34a;
  --green-l:   #f0fdf4;
  --green-b:   #dcfce7;
  --orange:    #ea580c;
  --orange-l:  #fff7ed;
  --orange-b:  #ffedd5;
  --red:       #dc2626;
  --red-l:     #fef2f2;
  --red-b:     #fee2e2;
  --gray:      #6b7280;
  --gray-l:    #f9fafb;
  --gray-b:    #f3f4f6;

  /* Typography */
  --font:      'DM Sans', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;

  /* Sizing (P4: unified 10px base) */
  --radius:    10px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  /* Shadows (P3: subtle, not dribbble) */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.09);

  /* Spacing scale (P16) */
  --sp1: 4px;
  --sp2: 8px;
  --sp3: 12px;
  --sp4: 16px;
  --sp5: 20px;
  --sp6: 24px;

  /* Transitions (P17) */
  --ease: cubic-bezier(.25,.46,.45,.94);
  --dur:  180ms;

  /* Safe areas */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ── LOGIN / SETUP SCREENS ───────────────────────────── */
#loginScreen, #setupScreen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0f1c3a;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  /* Subtle, muted gradient — no neon */
  background-image: linear-gradient(135deg, #0f1c3a 0%, #1a2f55 100%);
}
#loginScreen.hidden, #setupScreen.hidden { display: none; }

.auth-box {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  /* Matte, not blurry */
}
.auth-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: #fff; font-size: 15px; margin-bottom: 12px; outline: none;
  transition: border-color var(--dur); font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.auth-input:focus { border-color: rgba(96,165,250,.5); background: rgba(255,255,255,.1); }
.auth-input::placeholder { color: rgba(255,255,255,.22); }
.auth-brand {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: rgba(255,255,255,.4); text-transform: uppercase; margin-bottom: 28px;
}
.auth-brand strong { color: #60a5fa; }
.auth-h1 { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: rgba(255,255,255,.5); margin-bottom: 28px; }
.auth-err {
  background: rgba(220,38,38,.15); border: 1px solid rgba(220,38,38,.3);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; color: #fca5a5; margin-bottom: 16px; display: none;
}
.auth-err.show { display: block; }
.auth-label {
  display: block; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.5); margin-bottom: 6px;
}

.auth-btn {
  width: 100%; padding: 12px; border-radius: var(--radius);
  background: var(--blue); border: none; color: #fff;
  font-size: 15px; font-weight: 600; margin-top: 4px; transition: background .15s;
}
.auth-btn:hover { background: #1d4ed8; }

/* ── HEADER ──────────────────────────────────────────── */
#appHeader {
  position: sticky; top: 0; z-index: 200;
  background: var(--navy);
  padding: calc(var(--safe-t) + 0px) 0 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 4px 16px rgba(0,0,0,.15);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 0 var(--sp5); height: 56px;
}
.header-brand {
  display: flex; flex-direction: column; min-width: 0; flex-shrink: 0;
}
.header-brand-title {
  font-size: 17px; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -.01em;
}
.header-brand-sub {
  font-size: 11px; color: rgba(255,255,255,.4); font-weight: 400; margin-top: 1px;
}
.header-status {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.status-dot {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(255,255,255,.38); letter-spacing: .01em;
}
.status-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; flex-shrink: 0; opacity: .7;
}
#dbBadge {
  font-size: 11px; color: rgba(255,255,255,.35); font-family: var(--mono);
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-new-booking {
  display: flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-new-booking:hover { background: #1d4ed8; }
.btn-more {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); border: none;
  padding: 8px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  transition: background .15s;
}
.btn-more:hover { background: rgba(255,255,255,.15); }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  padding: 6px 12px; border-radius: 24px;
  cursor: default;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 12px; font-weight: 600; color: #fff; }
.user-role { font-size: 10px; color: rgba(255,255,255,.4); }
#logoutBtn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6); padding: 7px 11px; border-radius: var(--radius);
  font-size: 12px; transition: all .15s;
}
#logoutBtn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── TAB NAV ─────────────────────────────────────────── */
.tab-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav-inner {
  display: flex; padding: 0 20px; min-width: max-content;
}
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 13px 16px; border: none; background: none;
  font-size: 13px; font-weight: 500; color: var(--t3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  position: relative;
}
.tab-btn:hover { color: var(--t2); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-btn svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.tab-btn.active svg { opacity: 1; }

/* ── MAIN LAYOUT ─────────────────────────────────────── */
#mainArea { min-height: calc(100vh - 100px); }
.tab-panel { display: none; padding: 24px 20px; }
.tab-panel.active { display: block; }

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

/* ── KPI GRID ────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.kpi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-num {
  font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--t1);
}
.kpi-label { font-size: 12px; color: var(--t3); font-weight: 500; }
.kpi-sub { font-size: 11px; color: var(--t3); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.kpi-sub.pos { color: var(--green); }
.kpi-sub.warn { color: var(--orange); }
.kpi-sub.neg { color: var(--red); }

.kpi-icon.blue  { background: var(--blue-l);   color: var(--blue); }
.kpi-icon.green { background: var(--green-l);  color: var(--green); }
.kpi-icon.orange{ background: var(--orange-l); color: var(--orange); }
.kpi-icon.red   { background: var(--red-l);    color: var(--red); }
.kpi-icon.gray  { background: var(--gray-b);   color: var(--gray); }

/* ── SECTION HEADERS ─────────────────────────────────── */
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-hd h2 {
  font-size: 15px; font-weight: 600; color: var(--t1);
}
.btn-link {
  font-size: 12px; color: var(--blue); background: none; border: none;
  font-weight: 500; transition: opacity .15s;
}
.btn-link:hover { opacity: .7; }

/* ── DASHBOARD TWO-COL ───────────────────────────────── */
.dash-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 16px;
  margin-bottom: 20px;
}

/* ── TRAILER OVERVIEW CARDS ──────────────────────────── */
.trailer-overview { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.tov-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur);
}
.tov-card:hover { box-shadow: var(--shadow); border-color: #d0d7e6; }
.tov-card-body { padding: 12px 14px 0; }
.tov-name { font-size: 14px; font-weight: 600; color: var(--t1); }
.tov-type { font-size: 11px; color: var(--t3); margin-bottom: 8px; }
.tov-img-wrap { height: 72px; background: #f3f5f8; border-radius: 10px; overflow: hidden; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.tov-img-wrap svg { width: 40px; height: 40px; color: var(--t4); }
.trailer-card-image { max-width: 160px; max-height: 62px; width: 100%; object-fit: contain; display: block; }
.tov-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-top: 1px solid var(--border); }
.tov-plate { font-size: 11px; color: var(--t3); font-family: var(--mono); }
.tov-action { padding: 8px 14px 12px; }
.tov-action .btn-sm { width: 100%; }
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; border-radius: 6px;
  padding: 2px 7px; white-space: nowrap; letter-spacing: .02em;
}
.badge.frei    { background: #dcfce7; color: #15803d; }
.badge.status-active { background: #dbeafe; color: #1d4ed8; }
.badge.fällig  { background: #fed7aa; color: #c2410c; }
.badge.status-overdue { background: #fecaca; color: #b91c1c; }
.badge.status-outage      { background: rgba(124,58,237,.13);  color: #6d28d9; font-weight: 600; }
.badge.ok      { background: var(--green-b);  color: var(--green); }
.badge.warn    { background: var(--orange-b); color: var(--orange); }
.badge.error   { background: var(--red-b);    color: var(--red); }

/* ── CURRENT BOOKINGS PANEL ──────────────────────────── */
.booking-list { display: flex; flex-direction: column; }
.booking-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.booking-row:last-child { border-bottom: none; }
.booking-row:hover { background: var(--surface2); }
.booking-row { -webkit-tap-highlight-color: transparent; }
.booking-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.booking-dot.warn { background: var(--orange); }
.booking-dot.crit { background: var(--red); }
.booking-customer { font-size: 13px; font-weight: 600; color: var(--t1); }
.booking-trailer  { font-size: 11px; color: var(--t3); }
.booking-return   { font-size: 11px; color: var(--t2); text-align: right; margin-left: auto; white-space: nowrap; }

/* ── QUICK ACTIONS ───────────────────────────────────── */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  max-width: 100%;
  overflow: hidden;
}
.qa-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; color: var(--t2); font-weight: 500;
  transition: all .15s; box-shadow: var(--shadow-sm);
  width: 100%; min-width: 0;
}
.qa-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-l); box-shadow: var(--shadow); }
.qa-btn .qa-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gray-b); display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qa-btn:hover .qa-icon { background: var(--blue-b); }
.qa-btn svg { width: 18px; height: 18px; }

/* ── DATA TABLE ──────────────────────────────────────── */
.data-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.table-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px; min-width: 200px;
}
.search-box svg { width: 15px; height: 15px; color: var(--t3); flex-shrink: 0; }
.search-box input {
  border: none; background: none; outline: none; font-size: 13px; color: var(--t1); width: 100%;
}
.search-box input::placeholder { color: var(--t3); }
.filter-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px; font-size: 13px;
  color: var(--t2); outline: none; cursor: pointer;
}
.table-spacer { flex: 1; }
table.dt { width: 100%; border-collapse: collapse; }
table.dt th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--t3);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  background: #fafbfd; white-space: nowrap;
}
table.dt td {
  padding: 14px 16px; border-bottom: 1px solid #f0f2f7;
  font-size: 13px; color: var(--t1); vertical-align: middle;
}
table.dt tbody tr:last-child td { border-bottom: none; }
table.dt tbody tr:hover { background: #f8f9fc; }
table.dt tr:last-child td { border-bottom: none; }
table.dt tbody tr { transition: background .1s; }
table.dt tbody tr:hover { background: var(--surface2); }
.dt-id { font-family: var(--mono); font-size: 11px; color: var(--blue); font-weight: 500; }
.dt-actions { display: flex; gap: 4px; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; border: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              opacity var(--dur) var(--ease);
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1e58e8; }
.btn-primary:active { background: #1d4ed8; opacity: .92; }
.btn-secondary {
  background: var(--surface); color: var(--t2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface2); color: var(--t1); }
.btn-ghost { background: transparent; color: var(--t2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--t1); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-xs { font-size: 11px; padding: 3px 8px; }
.btn-icon {
  background: none; border: none; color: var(--t3);
  padding: 5px; border-radius: var(--radius);
  transition: background var(--dur), color var(--dur);
}
.btn-icon:hover { background: var(--surface2); color: var(--t1); }
.btn-green { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; }

/* ── FORMS ───────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label.fl {
  font-size: 12px; font-weight: 500; color: var(--t2); display: block;
}
.inp {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--t1); outline: none;
  transition: border-color .15s; font-family: var(--font);
}
.inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.inp::placeholder { color: var(--t3); }
select.inp { cursor: pointer; }
textarea.inp { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--t3); }

/* ── MODALS ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(17,24,39,.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px calc(var(--safe-b) + 48px); overflow-y: auto;
  animation: fadeIn 160ms var(--ease);
}
.modal-overlay.hidden, .modal-overlay:not(.show) { display: none; }
.modal-box { animation: slideUp 180ms var(--ease); }
@keyframes fadeIn { from { opacity:0; } }
@keyframes slideUp { from { opacity:0; transform:translateY(10px); } }
.modal-box {
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 600px;
  border: 1px solid var(--border);
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--t1); }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px; background: none;
  border: none; color: var(--t3); font-size: 18px; display: flex;
  align-items: center; justify-content: center; transition: all .12s;
}
.modal-close:hover { background: var(--gray-b); color: var(--t1); }
.modal-body { padding: 20px 24px; max-height: 70vh; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--gray-b); border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.alert-box {
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px; border: 1px solid;
}
.alert-box.warn { background: var(--orange-l); border-color: var(--orange-b); color: var(--orange); }
.alert-box.error { background: var(--red-l); border-color: var(--red-b); color: var(--red); }
.alert-box.info { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue); }

/* ── GANTT CALENDAR ──────────────────────────────────── */
.gantt-wrap { overflow-x: auto; }
.gantt-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.gantt-nav { display: flex; align-items: center; gap: 4px; }
.gantt-month { font-size: 15px; font-weight: 600; color: var(--t1); padding: 0 8px; }

/* ── SETTINGS LAYOUT ─────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.settings-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; }
.settings-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius); font-size: 13px;
  color: var(--t2); cursor: pointer; transition: all .12s; border: none; background: none; width: 100%; text-align: left;
}
.settings-nav-item:hover { background: var(--surface2); color: var(--t1); }
.settings-nav-item.active { background: var(--blue-l); color: var(--blue); font-weight: 500; }
.settings-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.settings-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.settings-section-title { font-size: 16px; font-weight: 600; color: var(--t1); margin-bottom: 20px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; border-bottom: 1px solid #f0f2f7; gap: 24px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; font-weight: 500; color: var(--t1); }
.settings-row-hint { font-size: 12px; color: var(--t3); margin-top: 2px; }
.settings-row-ctrl { flex-shrink: 0; min-width: 200px; }

/* ── UPLOAD ZONE ─────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-lg);
  padding: 32px 24px; text-align: center; cursor: pointer; transition: all .2s; margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--blue); background: var(--blue-l); }
.upload-zone-icon { font-size: 32px; margin-bottom: 10px; }
.upload-zone h3 { font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.upload-zone p { font-size: 13px; color: var(--t3); }

/* ── TOAST ───────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: calc(var(--safe-b) + 20px); right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--navy); color: #fff;
  border-radius: var(--radius-lg); padding: 12px 16px;
  font-size: 13px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.1);
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── CHECKLIST ───────────────────────────────────────── */
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.check-item label { font-size: 13px; color: var(--t1); cursor: pointer; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 24px;
}
.empty-state-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: #f3f4f6; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.empty-state-icon svg { width: 24px; height: 24px; color: #d1d5db; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--t2); margin-bottom: 5px; }
.empty-state p { font-size: 13px; color: var(--t3); margin-bottom: 18px; line-height: 1.6; }

/* ── API ERROR BANNER ────────────────────────────────── */
#apiErr {
  background: var(--red-l); border-bottom: 1px solid var(--red-b);
  color: var(--red); padding: 10px 20px; font-size: 13px; text-align: center;
  display: none;
}
#apiErr.show { display: block; }

/* ── PHOTO UPLOAD AREA ───────────────────────────────── */
.photo-upload-area {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; font-size: 12px;
  color: var(--t3); transition: all .15s; position: relative;
}
.photo-upload-area:hover { border-color: var(--blue); color: var(--t2); }

/* ── MISC ────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.text-meta { font-size: 12px; color: var(--t3); }
.text-mono { font-family: var(--mono); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.ml-auto { margin-left: auto; }
.nowrap { white-space: nowrap; }
.card-section { padding: 20px; }
.conflict-warn { display:none; }
.conflict-warn.show { display:block; }

/* ── FOOTER ──────────────────────────────────────────── */
#appFooter {
  margin-top: 40px; padding: 16px 20px calc(var(--safe-b) + 16px);
  border-top: 1px solid var(--border); background: var(--surface);
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
}
.footer-meta { font-size: 11px; color: var(--t3); }
.footer-meta strong { color: var(--t2); }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .trailer-overview { grid-template-columns: repeat(3,1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
}
@media (max-width: 768px) {
  .tab-panel { padding: 16px 14px; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .kpi-num { font-size: 22px; }
  .kpi-card { padding: 12px; }
  .trailer-overview { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; gap: 2px; white-space: nowrap; scrollbar-width:none; }
  .settings-nav::-webkit-scrollbar { display:none; }
  .settings-nav-item { white-space: nowrap; flex-shrink: 0; }
  .form-grid { grid-template-columns: 1fr; }
  table.dt { font-size: 12px; }
  table.dt th, table.dt td { padding: 10px 12px; }
  /* P8: mobile header simplified */
  .header-status { display: none; }
  .user-info { display: none; }
  .header-brand-sub { display: none; }
  .header-inner { gap: 10px; padding: 0 14px; }
  .btn-more span { display: none; }
  .header-inner { height: 52px; }
  /* Tab nav tighter on mobile */
  .tab-btn { padding: 11px 12px; font-size: 12px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .qa-grid { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
  .btn-new-booking span { display: none; }
  .btn-more span { display: none; }
}

/* ── SVG INLINE DEFAULTS ─────────────────────────────── */
svg { display: block; }

/* ── User badge (from old include) ── */
.user-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--t2);
}
.api-err {
  background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2);
  border-radius: var(--radius); padding: 9px 14px;
  font-size: 13px; color: var(--red); margin-bottom: 12px; display: none;
}
.api-err.show { display: block; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════
   GANTT / RESOURCE PLANNER
   ═══════════════════════════════════════════════════════ */
.gantt-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gantt-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: default;
}

/* Header: label col + day cols */
.gantt-header {
  display: flex;
  border-bottom: 2px solid var(--border2);
  position: sticky; top: 0; z-index: 10;
  background: #fafbfd;
}
.gantt-row-label {
  flex: 0 0 140px; min-width: 140px;
  padding: 8px 12px;
  font-size: 12px; font-weight: 600; color: var(--t2);
  border-right: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-row-label.header {
  font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em;
  background: #fafbfd;
}
.gantt-days {
  flex: 1; display: flex;
}
.gantt-day-col {
  flex: 1; min-width: 44px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.gantt-day-col:last-child { border-right: none; }
.gantt-day-col.weekend { background: #fafbfd; }
.gantt-day-col.today   { background: #eff6ff; }
.gantt-day-hdr {
  padding: 6px 2px;
  font-size: 11px; color: var(--t3); font-weight: 500; line-height: 1.4;
}
.gantt-day-hdr.today-lbl { color: var(--blue); font-weight: 700; }

/* Body rows */
.gantt-body-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}
.gantt-body-row:last-child { border-bottom: none; }
.gantt-body-row:hover { background: #fafbfd; }
.gantt-cells {
  flex: 1;
  display: flex;
  position: relative;   /* for absolute bars */
}
.gantt-cell {
  flex: 1; min-width: 44px;
  border-right: 1px solid #f0f2f7;
  min-height: 40px;
}
.gantt-cell:last-child { border-right: none; }
.gantt-cell.weekend { background: #fafbfd; }
.gantt-cell.today   { background: #f0f7ff; }

/* Now-line */
.gantt-now-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: #ef4444;
  z-index: 4; pointer-events: none;
  box-shadow: 0 0 4px rgba(239,68,68,.4);
}

/* Booking bars */
.gantt-bar {
  position: absolute; top: 5px; bottom: 5px;
  border-radius: 5px;
  padding: 0 6px;
  font-size: 11px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 3; cursor: pointer;
  display: flex; align-items: center;
  transition: opacity .12s, filter .12s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.gantt-bar:hover { opacity: .88; filter: brightness(1.05); }
.gantt-bar.reserved { background: #2563eb; }
.gantt-bar.reserved   { background: #2563eb; }
.gantt-bar.active   { background: #16a34a; }
.gantt-bar.active     { background: #16a34a; }
.gantt-bar.returned   { background: #9ca3af; }
.gantt-bar.cancelled  { background: #d1d5db; color: var(--t2); text-decoration: line-through; }
.gantt-bar.ausfall    { background: #f59e0b; }
.gantt-bar.overdue    { background: #dc2626; }

/* Empty state inside gantt */
.gantt-empty {
  padding: 32px; text-align: center;
  font-size: 13px; color: var(--t3);
  border-left: 1px solid var(--border);
  flex: 1;
}

/* View toggle buttons */
.gantt-view-btn { font-size: 12px; padding: 5px 10px; }
.gantt-view-btn.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ── Operational dashboard additions ────────────────────── */
.action-item {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.action-item:last-child { border-bottom: none; }
.action-item.red  { color: var(--red); }
.action-item.orange { color: var(--orange); }
.action-item.warn { color: var(--orange); }
.action-item[onclick]:hover { background: var(--surface2); }

/* ── Mobile: bigger touch targets ─────────────────────────── */
@media (max-width: 600px) {
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn-sm { min-height: 36px; }
  .tov-action .btn { min-height: 38px; font-size: 14px; }
  .booking-row { padding: 14px 16px; min-height: 60px; }
  .qa-btn { min-height: 64px; }
  .qa-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .modal-box { border-radius: 0; position: fixed; bottom:0; left:0; right:0; max-width:100% !important; margin:0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .form-grid { grid-template-columns: 1fr; }
  .inp { min-height: 44px; font-size: 16px; }  /* 16px prevents iOS zoom */
  select.inp { min-height: 44px; font-size: 16px; }
}

/* ── Status badge classes (semantic) ────────────────────── */
.badge.status-free          { background: rgba(34,197,94,.12);   color: #16a34a; }
.badge.status-reserved      { background: rgba(59,130,246,.12);  color: #2563eb; }
.badge.status-reserved-soon { background: rgba(99,102,241,.15);  color: #4f46e5; }
.badge.status-active        { background: rgba(59,130,246,.15);  color: #1d4ed8; }
.badge.status-due-soon      { background: rgba(245,158,11,.15);  color: #b45309; }
.badge.status-overdue       { background: rgba(239,68,68,.15);   color: #dc2626; }
.badge.status-returned      { background: rgba(156,163,175,.12); color: #6b7280; }
.badge.status-cancelled     { background: rgba(156,163,175,.12); color: #9ca3af; text-decoration:line-through; }
.badge.status-outage      { background: rgba(124,58,237,.13);  color: #6d28d9; font-weight: 600; }

/* ── Touch & Performance ────────────────────────────────── */
.btn, .qa-btn, .tab-btn, .tov-card, .booking-row, .action-item {
  touch-action: manipulation;  /* eliminates 300ms tap delay on iOS */
}
* { -webkit-tap-highlight-color: transparent; }

/* ── Smooth state transitions (no flicker) ──────────────── */
.btn        { transition: background .12s ease, opacity .12s ease, box-shadow .12s ease; }
.tov-card   { transition: box-shadow .15s ease, transform .1s ease; }
.tov-card:hover  { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.booking-row:active { background: var(--surface2); }

/* ── qa-btn span text ──────────────────────────────────── */
.qa-btn span { display: block; font-size: 12px; margin-top: 4px; font-weight: 500; }

/* ── Status chips — final definitive colors ─────────────── */
.badge.status-free          { background: #dcfce7; color: #15803d; font-weight: 600; }
.badge.status-reserved      { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.badge.status-reserved-soon { background: #ede9fe; color: #6d28d9; font-weight: 600; }
.badge.status-active        { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.badge.status-due-soon      { background: #fef3c7; color: #92400e; font-weight: 600; }
.badge.status-overdue       { background: #fee2e2; color: #991b1b; font-weight: 600; }
.badge.status-returned      { background: #f3f4f6; color: #6b7280; }
.badge.status-cancelled     { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.badge.status-outage      { background: rgba(124,58,237,.13);  color: #6d28d9; font-weight: 600; }

/* ── KPI cards: larger numbers ──────────────────────────── */
.kpi-num { font-size: clamp(22px, 4vw, 32px); font-weight: 700; line-height: 1; }

/* ── Dashboard action items: hover state ────────────────── */
.action-item { cursor: pointer; user-select: none; }
.action-item:hover { background: var(--surface2); }
.action-item.red    { border-left: 3px solid #ef4444; padding-left: 13px; }
.action-item.orange { border-left: 3px solid #f59e0b; padding-left: 13px; }

/* ── Modal: loading state ───────────────────────────────── */
.btn[disabled], .btn.loading {
  opacity: .55; pointer-events: none; cursor: not-allowed;
}
.btn.loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite;
  margin-left: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal close on backdrop (visual cue) ───────────────── */
.modal-overlay { cursor: pointer; }
.modal-box     { cursor: default; }

/* ── Toast: nicer ───────────────────────────────────────── */
.toast {
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  border-radius: 10px; padding: 10px 16px;
  font-size: 14px; font-weight: 500;
  animation: toast-in .2s ease, toast-out .2s ease 3.2s forwards;
}
@keyframes toast-in  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform:translateY(-4px); } }

/* ── Empty states: more breathing room ─────────────────── */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--t2); margin: 12px 0 6px; }
.empty-state p  { font-size: 13px; color: var(--t3); }
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto 4px; opacity: .35; }
.empty-state-icon svg { width: 48px; height: 48px; }

/* ── Calendar: today highlight ──────────────────────────── */
.gantt-today-col { background: rgba(59,130,246,.04); }
.gantt-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #3b82f6; opacity: .7; pointer-events: none;
}

/* ── Scrollbar thin ────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Print: hide nav ───────────────────────────────────── */
@media print {
  #appHeader, #toast-container, .btn-new-booking, .tab-nav { display: none !important; }
  .tab-panel { display: block !important; }
}

/* ── Rollenbasierte Sichtbarkeit ─────────────────────────────── */
/* Standard: alle sichtbar (vor Login) */
.admin-only { }

/* Nach Login als Staff: admin-only komplett ausblenden */
body.role-staff .admin-only { display: none !important; }

/* tab-btn ist inline-flex — beim Einblenden wiederherstellen */
body.role-admin .tab-btn.admin-only,
body.role-admin .settings-nav-item.admin-only { display: inline-flex !important; }
