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

:root {
  --bg:       #F1F5F9;
  --surface:  #FFFFFF;
  --border:   #E2E8F0;
  --border2:  #CBD5E1;
  --text:     #0F172A;
  --muted:    #64748B;
  --primary:  #2563EB;
  --primary-d:#1D4ED8;
  --danger:   #DC2626;
  --warning-bg: #FEF9C3;
  --warning-br: #FDE047;
  --success:  #059669;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,.08);
  --shadow-lg:0 12px 28px rgba(0,0,0,.14);
}


body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  height: 100dvh; /* dynamic viewport — fixes mobile browser chrome clipping */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===================== NAV ===================== */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}
.logo { font-weight: 700; font-size: 15px; cursor: default; user-select: none; }
.nav-links { display: flex; gap: 3px; }
.nav-btn {
  padding: 6px 13px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-btn:hover  { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--primary); color: #fff; }

/* ===================== VIEWS ===================== */
.view { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.view.hidden { display: none !important; }

/* ===================== CALENDAR TOOLBAR ===================== */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}
.car-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px; border: 2px solid transparent;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: opacity .15s, transform .1s; background: var(--surface);
}
.toggle-btn .dot { width: 9px; height: 9px; border-radius: 50%; }
.toggle-btn.off  { opacity: .35; }
.toggle-btn:hover { transform: translateY(-1px); }

.week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#week-label { font-weight: 600; font-size: 13px; min-width: 160px; text-align: center; }

.icon-btn {
  width: 30px; height: 30px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg); }

.btn-sm {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: background .15s;
}
.btn-sm:hover { background: var(--bg); }

/* ===================== VIEW MODE ROW ===================== */
.view-mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.view-mode-btns {
  display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.view-mode-btn {
  padding: 4px 11px; border: none; background: var(--surface);
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted);
  border-right: 1px solid var(--border); transition: background .15s, color .15s;
}
.view-mode-btn:last-child { border-right: none; }
.view-mode-btn.active { background: var(--primary); color: #fff; }
.view-mode-btn:hover:not(.active) { background: var(--bg); color: var(--text); }

/* ===================== CAR LEGEND ===================== */
.car-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 6px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.legend-dot  { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ===================== CALENDAR SCROLL ===================== */
.cal-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; }

/* Pull-to-refresh indicator */
.ptr-indicator {
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden; transition: height .2s ease;
  background: var(--surface); font-size: 13px; color: var(--muted); gap: 8px;
}
.ptr-indicator.visible { height: 44px; }
.ptr-spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#calendar-grid { min-width: 500px; }

.empty-cal {
  text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px;
}

/* ===================== TIMELINE HEADER ===================== */
.cal-header-row {
  display: flex;
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 2px solid var(--border2);
}
.cal-time-spacer {
  flex: 0 0 52px; border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.week-num-label {
  font-size: 9px; font-weight: 700; color: var(--primary);
  text-align: center; line-height: 1.3; text-transform: uppercase; letter-spacing: .03em;
}
.cal-head-cells  { flex: 1; display: grid; grid-template-columns: repeat(var(--num-days), 1fr); }

.cal-head-cell {
  padding: 6px 8px; text-align: center;
  border-right: 1px solid var(--border);
  font-size: 12px;
}
.cal-head-cell:last-child { border-right: none; }
.cal-head-cell.today { color: var(--primary); }

.head-wd  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.head-num { font-size: 18px; font-weight: 700; line-height: 1.1; }
.head-num.is-today {
  background: var(--primary); color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.head-mo { font-size: 10px; color: var(--muted); }

/* ===================== TIMELINE BODY ===================== */
.cal-body {
  display: flex;
}

.cal-time-col {
  flex: 0 0 52px;
  position: relative;
  border-right: 1px solid var(--border);
  height: 1440px; /* DAY_MINUTES × PX_PER_MIN */
}
.time-lbl {
  position: absolute;
  right: 8px;
  font-size: 10px;
  color: var(--muted);
  transform: translateY(-50%);
  white-space: nowrap;
  user-select: none;
}

.cal-days-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--num-days), 1fr);
}

/* ===================== DAY COLUMN ===================== */
.day-col {
  position: relative;
  border-right: 1px solid var(--border);
  cursor: crosshair;
  overflow: hidden;
}
.day-col:last-child { border-right: none; }
.day-col.past { background: #FAFAFA; cursor: default; }

.hour-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}
.half-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px dashed #EEF2F7;
  pointer-events: none;
}

.now-line {
  position: absolute; left: 0; right: 0;
  border-top: 2px solid #EF4444;
  pointer-events: none;
  z-index: 5;
}
.now-line::before {
  content: '';
  position: absolute; left: -4px; top: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444;
}

.click-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #CBD5E1;
  pointer-events: none; opacity: 0;
  transition: opacity .15s;
  z-index: 1;
}
.day-col:not(.past):hover .click-hint { opacity: 1; }

/* ===================== BOOKING BLOCK ===================== */
.booking-block {
  position: absolute;
  border-radius: 4px;
  padding: 2px 4px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: filter .1s, box-shadow .1s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.booking-block:hover:not(.completed) {
  filter: brightness(1.08);
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  z-index: 4;
}
.booking-block.completed {
  cursor: pointer;
  opacity: 0.85;
}
.booking-block.span-open {
  border-bottom: 2px dashed rgba(255,255,255,.55);
  border-radius: 4px 4px 0 0;
}
.booking-block.span-closed {
  border-top: 2px dashed rgba(255,255,255,.55);
  border-radius: 0 0 4px 4px;
}
.booking-block.span-open.span-closed {
  border-radius: 0;
}
.bb-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-time { font-size: 10px; opacity: .9; white-space: nowrap; }
.bb-dur  { font-size: 10px; opacity: .75; white-space: nowrap; font-weight: 600; }
.bb-car  { font-size: 10px; opacity: .8; font-style: italic; white-space: nowrap; }

/* ===================== MONTH VIEW ===================== */
.month-grid {
  display: grid;
  grid-template-columns: 36px repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.month-head {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border2);
  background: var(--surface);
}
.month-week-num {
  padding: 4px 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.month-week-num.head {
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--border2);
}
.month-cell {
  min-height: 100px;
  padding: 4px 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  overflow: hidden;
}
.month-cell:hover:not(.other-month) { background: #F8FAFC; }
.month-cell.other-month { background: #FAFAFA; color: var(--muted); cursor: default; }
.month-cell.past { opacity: .7; }
.month-cell.today { background: #EFF6FF; }

.month-day-num {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
}
.month-day-num.is-today {
  background: var(--primary); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.month-events { display: flex; flex-direction: column; gap: 2px; }
.month-event {
  border-radius: 3px; padding: 1px 5px;
  font-size: 11px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.month-more { font-size: 10px; color: var(--muted); padding-left: 2px; }

/* ===================== FORM CARD ===================== */
.form-card {
  max-width: 600px; margin: 28px auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.form-card h2  { font-size: 19px; margin-bottom: 18px; }
.form-card h3  { font-size: 14px; margin: 14px 0 10px; color: var(--muted); }
.form-card hr  { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color .15s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field input[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
.field input[readonly]     { background: var(--bg); cursor: default; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.dt-wrap { display: flex; gap: 6px; }
.dt-wrap .dt-date { flex: 3; min-width: 0; }
.dt-wrap .dt-time { flex: 2; min-width: 0; }

.info-box {
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: 6px; padding: 9px 13px; margin-bottom: 12px;
  font-size: 13px;
}

/* ===================== BUTTONS ===================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 18px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover    { background: var(--primary-d); }
.btn-primary:disabled { background: #93C5FD; cursor: not-allowed; opacity: 0.7; }

.btn-secondary {
  padding: 8px 18px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
  padding: 8px 18px; border: none; border-radius: 6px;
  background: var(--danger); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-danger:hover { background: #B91C1C; }

.btn-icon {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); cursor: pointer; font-size: 12px; transition: background .15s;
}
.btn-icon:hover        { background: var(--bg); }
.btn-icon.danger       { color: var(--danger); }
.btn-icon.danger:hover { background: #FEF2F2; border-color: #FECACA; }

/* ===================== MESSAGES ===================== */
.error-msg {
  color: var(--danger); font-size: 13px; margin-top: 8px;
  padding: 8px 11px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 6px;
}
.error-msg.hidden { display: none; }

.warning-box {
  background: var(--warning-bg); border: 1px solid var(--warning-br);
  border-radius: 6px; padding: 8px 11px; font-size: 12px; color: #78350F; margin-top: 5px;
}
.warning-box.hidden { display: none; }

.muted    { color: var(--muted); font-size: 12px; font-weight: 400; }
.required { color: var(--danger); }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; display: flex; align-items: center;
  justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 26px; width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 17px; margin-bottom: 14px; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 26px; height: 26px; border: none;
  background: var(--bg); border-radius: 50%;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap;
}

.car-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 13px; border-radius: 20px;
  font-weight: 700; font-size: 14px; color: #fff; margin-bottom: 4px;
}

.car-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.car-select-btn {
  display: inline-flex; align-items: center;
  padding: 7px 16px; border-radius: 20px; border: 3px solid transparent;
  cursor: pointer; font-size: 13px; font-weight: 700; color: #fff;
  transition: box-shadow .15s, transform .1s, border-color .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.car-select-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.car-select-btn.selected {
  border-color: rgba(255,255,255,.8);
  box-shadow: 0 0 0 3px rgba(0,0,0,.25);
  transform: translateY(-1px);
}
.car-select-btn.occupied {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.car-select-btn:disabled {
  pointer-events: none;
}

/* ===================== LOG ===================== */
.log-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-wrap: wrap; gap: 10px; flex-shrink: 0;
}
.log-toolbar h2 { font-size: 17px; }
.log-filters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.log-filters select {
  padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: var(--surface);
}

#log-table-wrap { overflow: auto; padding: 14px 20px; flex: 1; }

#log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#log-table th {
  text-align: left; padding: 7px 11px;
  background: var(--bg); border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
}
#log-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
#log-table tr:hover td { background: var(--bg); }
.log-details { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-yellow { background: #FEF9C3; color: #78350F; }
.badge-purple { background: #EDE9FE; color: #4C1D95; }

/* ===================== ADMIN TABS ===================== */
#admin-panel {
  display: flex; flex-direction: column; flex: 1; overflow: hidden;
}
.admin-tabs, .mb-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  overflow-x: auto;
}
.admin-tab, .mb-tab {
  padding: 11px 18px; border: none; background: none;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.admin-tab:hover, .mb-tab:hover { color: var(--text); }
.admin-tab.active, .mb-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.admin-tab-content, .mb-tab-content { flex: 1; overflow: auto; overscroll-behavior: contain; }
.back-btn { margin-bottom: 12px; }

/* Brugerens navn i toppen */
.nav-user-badge {
  font-size: 13px; font-weight: 600; color: var(--primary);
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  margin-left: 4px;
}
@media (max-width: 640px) { .nav-user-badge { display: none; } }

/* Eksport-menu gruppeoverskrift */
.export-menu-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 12px 3px; font-weight: 600;
}
.export-menu-label:first-child { padding-top: 6px; }

/* Komplet regnskab — fremhævet panel */
.regnskab-panel {
  margin: 18px 20px 40px; padding: 18px 20px;
  background: var(--surface);
  border: 2px solid var(--primary); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.regnskab-panel-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.regnskab-panel-head h2 { font-size: 17px; }
.regnskab-panel-head select {
  flex: 1; min-width: 160px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); font-size: 14px;
}

/* Indstillinger-fanen */
.settings-wrap { padding: 18px 20px 60px; max-width: 900px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
}
.settings-card h2 { margin: 0 0 4px; font-size: 16px; }
.settings-card .muted { font-size: 12px; margin: 0 0 12px; }
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}
.settings-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.settings-grid label input, .settings-grid label select {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 14px; background: var(--bg); color: var(--text);
}
.settings-grid label.settings-check {
  flex-direction: row; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text); align-self: center;
}
.settings-grid label.settings-check input { width: auto; padding: 0; }
.settings-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  position: sticky; bottom: 0; background: var(--bg);
  padding: 12px 0; border-top: 1px solid var(--border);
}

/* PRØVEVERSION-vandmærke */
#trial-watermark {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; overflow: hidden;
  font-size: 12vw; font-weight: 900; letter-spacing: .05em;
  color: rgb(220, 38, 38); opacity: 0.13;
  transform: rotate(-30deg); text-transform: uppercase;
  white-space: nowrap; user-select: none;
}


/* ===================== FIELD NOTE ===================== */
.field-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ===================== REMEMBER ME ===================== */
.remember-row { margin: -4px 0 14px; }
.remember-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.remember-label input[type="checkbox"] { width: auto; margin: 0; }

/* ===================== ADMIN TABLE WRAPS ===================== */
#ab-table-wrap, #ad-table-wrap { overflow: auto; padding: 14px 20px; }
#ab-table, #ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#ab-table th, #ad-table th {
  text-align: left; padding: 7px 11px;
  background: var(--bg); border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
}
#ab-table td, #ad-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
#ab-table tr:hover td, #ad-table tr:hover td { background: var(--bg); }

/* ===================== ADMIN ===================== */
.admin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; overflow: auto; }
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }

.admin-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; padding: 7px 11px;
  background: var(--bg); border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
}
.admin-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:hover td { background: var(--bg); }
#mbr-table-wrap { overflow: auto; padding: 14px 20px; }
.admin-table .mbr-inp {
  padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; font-family: inherit; background: var(--surface);
  min-width: 0;
}
.admin-table .mbr-inp:focus { border-color: var(--primary); outline: none; }
.admin-table td:has(.mbr-inp) { padding: 4px 6px; }

.car-admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.car-admin-row:last-of-type { border-bottom: none; }
.car-info { display: flex; align-items: center; gap: 10px; }
.car-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.car-info strong { font-size: 14px; }
.car-actions { display: flex; gap: 4px; }

.booking-admin-row { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.booking-admin-row:last-of-type { border-bottom: none; }

/* ===================== HELP VIEW ===================== */
#view-help { background: var(--bg); }
.help-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.help-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.help-hero {
  text-align: center;
  padding: 44px 20px 36px;
}
.help-hero-icon { font-size: 40px; margin-bottom: 12px; }
.help-hero h1  { font-size: 22px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.help-hero p   { color: var(--muted); font-size: 14px; }

.help-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.help-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.help-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; font-weight: 700;
}
.help-section-header h2 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.help-lead { font-size: 13px; color: var(--muted); }

.help-steps { display: flex; flex-direction: column; gap: 10px; }
.help-step {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.5;
}
.help-step-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

.help-tip {
  margin-top: 14px;
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--muted);
}

.help-cars-section { padding-bottom: 22px; }
.help-cars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.help-car {
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 600px) {
  .help-hero { padding: 28px 10px 24px; }
  .help-hero h1 { font-size: 18px; }
  .help-content { padding: 0 12px 48px; }
  .help-section { padding: 16px 15px 14px; }
}

/* ===================== TOAST ===================== */
#toast-container {
  position: fixed; bottom: max(20px, env(safe-area-inset-bottom, 20px)); right: 20px;
  z-index: 500; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 11px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 500; color: #fff; box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease; max-width: 300px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===================== DETAIL MODAL ===================== */
.dm-row { margin-bottom: 9px; }
.dm-row label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; }
.dm-row span  { font-size: 14px; }

/* ===================== EXPORT DROPDOWN ===================== */
.export-wrap { position: relative; }
.export-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 200;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px; overflow: hidden;
}
.export-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 14px; border: none; background: none;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.export-menu button:hover { background: var(--bg); }

/* ===================== EDIT BAR ===================== */
.edit-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px; background: #EFF6FF; border-bottom: 1px solid #BFDBFE;
  flex-shrink: 0;
}
.sel-count { font-size: 13px; font-weight: 600; color: #1E40AF; }
.btn-danger { background: #EF4444 !important; color: #fff !important; border-color: #EF4444 !important; }
.btn-danger:hover:not(:disabled) { background: #DC2626 !important; }
.btn-danger:disabled { background: #FCA5A5 !important; opacity: .7; }

/* ===================== EDIT MODE TABLE ===================== */
tr.row-selected td { background: #DBEAFE !important; }
.row-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
.btn-icon {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 7px; font-size: 11px; cursor: pointer; color: var(--primary);
  transition: background .15s; white-space: nowrap;
}
.btn-icon:hover { background: var(--bg); }
th.check-col, td.check-col { width: 32px; padding: 6px 4px !important; }
th.act-col,  td.act-col  { width: 50px; padding: 6px 4px !important; }

/* ===================== TRASH ===================== */
.trash-section { margin-bottom: 24px; }
.trash-section-header {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.trash-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; font-size: 13px;
}
.trash-item-label { flex: 1; min-width: 0; overflow: hidden; }
.trash-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.trash-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.trash-empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 15px; }

/* ===================== MIT REGNSKAB ===================== */
.field-hint { font-size: 11px; color: var(--muted); font-weight: 400; }

.regnskab-member-row, .regnskab-filter-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.regnskab-member-row label, .regnskab-filter-row label { white-space: nowrap; font-weight: 500; font-size: 13px; }
.regnskab-filter-row input[type="date"] { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.rsk-summary-box {
  display: flex; gap: 32px; padding: 16px 20px;
  background: var(--surface, #f8f9fa); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; margin-bottom: 4px; flex-wrap: wrap;
}
.rsk-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rsk-stat-val { font-size: 1.6rem; font-weight: 700; color: var(--primary, #2563eb); }
.rsk-stat-lbl { font-size: 0.78rem; color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===================== HELP TABS ===================== */
#view-help { display: flex; flex-direction: column; }
.help-tabs {
  display: flex; gap: 2px; padding: 8px 12px 0;
  background: var(--surface, #fff); border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0; flex-wrap: wrap;
}
.help-tab-btn {
  padding: 7px 14px; border: 1px solid transparent; background: transparent;
  color: var(--muted, #6b7280); cursor: pointer; border-radius: 6px 6px 0 0;
  font-size: 0.85rem; font-weight: 500; white-space: nowrap;
}
.help-tab-btn.active {
  background: var(--bg, white); color: var(--primary, #2563eb);
  border-color: var(--border, #e5e7eb); border-bottom-color: var(--bg, white);
}
.help-tab-btn:hover:not(.active) { background: var(--hover, #f3f4f6); }
.help-tab-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.help-tab-content.hidden { display: none !important; }

/* ===================== MISC ===================== */
.hidden { display: none !important; }

@media (max-width: 600px) {
  .topnav      { padding: 0 10px; }
  .cal-toolbar { padding: 8px 10px; }
  .form-card   { margin: 12px; padding: 18px; }
  .field-row   { flex-direction: column; }
  #week-label  { min-width: 100px; font-size: 11px; }

}

/* ===================== PIN ===================== */
.pin-lock-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.92);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pin-lock-overlay.hidden { display: none; }

.pin-lock-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 36px 28px 28px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.pin-lock-welcome {
  font-size: 17px;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.4;
}

.pin-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0;
}

.pin-digit {
  width: 54px;
  height: 64px;
  font-size: 28px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.pin-digit::-webkit-outer-spin-button,
.pin-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.pin-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: var(--surface);
}

.pin-lock-other-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 6px;
  padding: 4px 8px;
}
