@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

/* ── Mørkt tema (standard) ────────────────────────────────── */
:root {
  --bg:        #1a1f28;
  --surface:   #212529;
  --surface2:  #2a2f3a;
  --surface3:  #333948;
  --accent:    #F2A900;
  --accent-dim:#c48a00;
  --text:      #D8D8D8;
  --text-muted:#8a8f9a;
  --text-dim:  #5a5f6a;
  --border:    #2e3340;
  --danger:    #ef4444;
  --success:   #22c55e;
  --info:      #3b82f6;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --transition:all .2s ease;
  --hover-row: rgba(255,255,255,.025);
}

/* ── Lyst tema ────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #f5f6f8;
  --surface:   #ffffff;
  --surface2:  #f0f1f4;
  --surface3:  #e4e6eb;
  --accent:    #F2A900;
  --accent-dim:#c48a00;
  --text:      #1a1f28;
  --text-muted:#6b7280;
  --text-dim:  #9da3ae;
  --border:    #e2e5ea;
  --danger:    #ef4444;
  --success:   #16a34a;
  --info:      #2563eb;
  --shadow:    0 4px 24px rgba(0,0,0,.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
  --hover-row: rgba(0,0,0,.025);
}

/* ── Auto: følger system-præference ──────────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #f5f6f8;
    --surface:   #ffffff;
    --surface2:  #f0f1f4;
    --surface3:  #e4e6eb;
    --accent:    #F2A900;
    --accent-dim:#c48a00;
    --text:      #1a1f28;
    --text-muted:#6b7280;
    --text-dim:  #9da3ae;
    --border:    #e2e5ea;
    --danger:    #ef4444;
    --success:   #16a34a;
    --info:      #2563eb;
    --shadow:    0 4px 24px rgba(0,0,0,.08);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --hover-row: rgba(0,0,0,.025);
  }
}

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Layout ───────────────────────────────────────────────── */
#app { display: flex; height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0c2835;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  transition: width .25s ease;
  z-index: 100;
}

/* ── Kollapset sidebar (kun ikoner) ───────────────────────── */
.sidebar.collapsed { width: 64px; }

/* Logo: skift fra fuldt til kompakt */
.sidebar.collapsed .sidebar-logo { padding: 14px 8px; justify-content: center; }
.sidebar.collapsed .logo-full { display: none !important; }
.sidebar.collapsed .logo-compact { display: block !important; margin: 0 auto; }

/* Nav-items: kun ikon, centreret */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-section { display: none; }
.sidebar.collapsed .nav-badge { display: none; }

/* Toggle-knap: kun ikon centreret */
.sidebar.collapsed .sidebar-toggle { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-toggle .toggle-icon { transform: rotate(180deg); }

/* User-box: kun avatar, ingen tekst/logout */
.sidebar.collapsed .sidebar-footer { padding: 8px; }
.sidebar.collapsed .user-box {
  padding: 6px;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}
.sidebar.collapsed .user-box-info { display: none; }
.sidebar.collapsed .btn-logout {
  width: 30px; height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toggle-knappens normale styling (begge tilstande) */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.sidebar-toggle .toggle-icon { transition: transform .25s ease; flex-shrink: 0; }

.sidebar-logo {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo .logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #000;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-weight: 700; font-size: 16px; color: #fff;
  letter-spacing: -.3px;
}

.sidebar-logo .logo-sub {
  font-size: 10px; color: rgba(255,255,255,.5); letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: rgba(255,255,255,.55);
  font-weight: 500;
  font-size: 13.5px;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: rgba(242,169,0,.12);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Log ud boks — redesignet */
.user-box {
  background: #1d3955;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #000;
  flex-shrink: 0;
}

.user-box-info { flex: 1; min-width: 0; }

.user-name {
  font-weight: 600; font-size: 12.5px;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  text-decoration: none;
}
.user-name:hover { color: var(--accent); }

.user-role { font-size: 10.5px; color: rgba(255,255,255,.45); margin-top: 1px; }

.btn-logout {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.btn-logout svg { width: 15px; height: 15px; }

/* Bagudkompatibilitet */
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.user-info:hover { background: rgba(255,255,255,.06); }

/* ── Main content ─────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Portal-notifikations-klokke i topbar ───────────────── */
.topbar-notif { position: relative; margin-left: 6px; }
.notif-bell {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.notif-bell:hover { background: var(--surface2); color: var(--accent); border-color: var(--accent); }
.notif-bell svg { width: 20px; height: 20px; transform-origin: 50% 15%; }

/* Klokke-ringeanimation: ryster 0,5s, pause 0,5s — gentages (1s loop) */
@keyframes notif-shake {
  0%   { transform: rotate(0); }
  5%   { transform: rotate(-18deg); }
  10%  { transform: rotate(16deg); }
  15%  { transform: rotate(-14deg); }
  20%  { transform: rotate(12deg); }
  25%  { transform: rotate(-10deg); }
  30%  { transform: rotate(8deg); }
  35%  { transform: rotate(-6deg); }
  40%  { transform: rotate(4deg); }
  45%  { transform: rotate(-2deg); }
  50%  { transform: rotate(0); }
  /* 50%→100% = ro (0,5s pause) */
  100% { transform: rotate(0); }
}
.notif-bell.has-notif svg {
  animation: notif-shake 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .notif-bell.has-notif svg { animation: none; }
}
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  border: 2px solid var(--surface);
  pointer-events: none;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 100;
  padding: 8px 0;
}
.notif-dropdown[hidden] { display: none; }
.notif-head {
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}
.notif-empty {
  padding: 18px 14px;
  color: var(--text);
  opacity: .6;
  text-align: center;
  font-size: 13px;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, padding-left .15s;
  position: relative;
}
.notif-item::after {
  content: '›';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 18px;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.notif-item:hover { background: var(--surface2); padding-left: 18px; }
.notif-item:hover::after { opacity: 1; transform: translateY(-50%) translateX(-2px); }
.notif-item:last-of-type { border-bottom: none; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item-sub   { font-size: 12px; color: var(--text); opacity: .7; margin-top: 2px; }
.notif-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notif-foot a,
.notif-foot-btn {
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.notif-foot a:hover,
.notif-foot-btn:hover { text-decoration: underline; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-dim); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); }

.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 15px; font-weight: 600; }
.card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Stat cards ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
}
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-icon  { position: absolute; right: 16px; top: 16px; opacity: .15; }
.stat-icon svg { width: 40px; height: 40px; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

/* Fade for afhentede bookinger — opacity på <tr> er buggy, vi sætter på <td> */
tr.row-picked-up {
  background: rgba(108,117,125,.10) !important;
}
tr.row-picked-up > td {
  opacity: .5 !important;
  filter: grayscale(.7) !important;
}
tr.row-picked-up > td:first-child {
  border-left: 3px solid var(--accent) !important;
}
tr.row-picked-up > td * {
  color: var(--text-muted) !important;
}
tr.row-cancelled > td {
  opacity: .5 !important;
  text-decoration: line-through;
  text-decoration-color: rgba(108,117,125,.5);
}

table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--hover-row); }

.td-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Inline-status-dropdown i bookings-tabellen — ligner et badge men er klikbart */
.status-inline-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 3px 22px 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  /* Lille caret/pil i højre side så det fremstår klart som dropdown */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  transition: filter .12s, transform .08s;
}
.status-inline-select:hover { filter: brightness(1.15); }
.status-inline-select:focus { box-shadow: 0 0 0 2px rgba(242,169,0,.35); }
.status-inline-select:active { transform: scale(.97); }
.status-inline-select:disabled { cursor: not-allowed; opacity: .6; }
/* Options inde i dropdown bruger normal baggrund (ikke gennemsigtig farve) */
.status-inline-select option {
  background: var(--surface);
  color: var(--text);
}

.priority-urgent { background: rgba(239,68,68,.15); color: #ef4444; }
.priority-high   { background: rgba(242,169,0,.15);  color: #F2A900; }
.priority-normal { background: rgba(59,130,246,.15); color: #3b82f6; }
.priority-low    { background: rgba(107,114,128,.15);color: #6b7280; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .3px;
}

input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242,169,0,.1);
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; border: none; background: none; flex-shrink: 0; }

select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 80px; }

/* ── Search bar ───────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.search-wrap input { padding-left: 34px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 960px; }

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

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 4px;
  transition: var(--transition);
  display: flex;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── Toast ────────────────────────────────────────────────── */
#toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideInRight .25s ease;
  display: flex; align-items: center; gap: 8px;
  min-width: 250px;
  max-width: 360px;
}

.toast-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: #22c55e; }
.toast-error   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #ef4444; }
.toast-info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.3); color: #3b82f6; }

/* ── Login page ───────────────────────────────────────────── */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  z-index: 10;
}

.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(242,169,0,.07) 0%, transparent 60%);
  pointer-events: none;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-box .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

/* ── Kanban ───────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}

.kanban-col {
  flex-shrink: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
}

.kanban-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 0;
}

.kanban-header-name { font-size: 13px; font-weight: 700; }
.kanban-count {
  background: rgba(0,0,0,.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.kanban-cards {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.kanban-card-plate { font-size: 14px; font-weight: 700; letter-spacing: .5px; color: var(--accent); }
.kanban-card-customer { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kanban-card-info { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

.kanban-cards.drag-over { border-color: var(--accent); background: rgba(242,169,0,.05); }
.kanban-card.dragging { opacity: .4; }

/* ── Calendar ─────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cal-day {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  min-height: 80px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.cal-day:hover { border-color: var(--accent); }
.cal-day.today { border-color: var(--accent); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day.other-month { opacity: .35; }
.cal-day.selected { background: rgba(242,169,0,.08); border-color: var(--accent); }
.cal-day.holiday {
  background: repeating-linear-gradient(45deg, rgba(220,53,69,.06), rgba(220,53,69,.06) 6px, transparent 6px, transparent 12px);
  border-color: rgba(220,53,69,.3);
}
.cal-day.holiday .cal-day-num { color: #dc3545; }
.cal-holiday {
  font-size: 10px;
  color: #dc3545;
  font-weight: 600;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-day-num { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal-event {
  font-size: 10px;
  background: var(--accent);
  color: #000;
  border-radius: 3px;
  padding: 1px 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.cal-more {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.cal-more:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
  text-decoration: underline;
}

/* ── Drag-and-drop i kalenderen ─────────────────────────── */
.cal-event[draggable="true"] { cursor: grab; }
.cal-event[draggable="true"]:active { cursor: grabbing; }
.cal-event.dragging {
  opacity: .4;
  transform: scale(.96);
}
.cal-day.drag-over {
  background: rgba(242,169,0,.18);
  border-color: var(--accent);
  border-style: dashed;
  box-shadow: inset 0 0 0 2px rgba(242,169,0,.35);
}
/* Mens en booking trækkes: gør "lukket dag" let synlig som ikke-target */
.cal-day.holiday.drag-over {
  background: repeating-linear-gradient(45deg, rgba(242,169,0,.18), rgba(242,169,0,.18) 6px, transparent 6px, transparent 12px);
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Separator ────────────────────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Status dot ───────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Color preview ────────────────────────────────────────── */
.color-preview {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid rgba(255,255,255,.1);
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-header p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Settings page ────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Main-tabs i Indstillinger (Værksted / Drift / Kunde-portal) */
.set-main-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.set-main-tab {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.set-main-tab:hover { background: rgba(242,169,0,.08); }
.set-main-tab.active {
  background: var(--accent);
  color: #1a1a1a;
}

/* Layout: sidebar med sub-tabs + indhold */
.set-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.set-sidebar {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  position: sticky;
  top: 16px;
}
.set-sub-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-sub-tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.set-sub-tab:hover { background: var(--surface2); }
.set-sub-tab.active {
  background: rgba(242,169,0,.15);
  color: var(--accent);
  font-weight: 700;
}
.set-content { flex: 1; min-width: 0; }
.set-content .settings-grid { grid-template-columns: 1fr; }

/* Mobile: layout som ovenfra/nedad (sidebar over indhold) */
@media (max-width: 900px) {
  .set-body { flex-direction: column; }
  .set-sidebar { width: 100%; position: static; }
  .set-sub-group { flex-direction: row; flex-wrap: wrap; }
  .set-sub-tab { flex: 1; min-width: 120px; text-align: center; }
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.tab {
  flex: 1; text-align: center; padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text-muted);
  transition: var(--transition);
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab:hover:not(.active) { color: var(--text); }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle-wrap {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface3);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s ease;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-wrap input:checked + .toggle-slider { background: var(--success); border-color: var(--success); }
.toggle-wrap input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-wrap.disabled .toggle-slider { cursor: not-allowed; opacity: .45; }

/* ── Module list ─────────────────────────────────────────── */
.module-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.module-item:last-child { border-bottom: none; }

.module-icon {
  width: 38px; height: 38px;
  background: var(--surface2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.module-icon.active-icon { background: rgba(242,169,0,.12); color: var(--accent); }

.module-info { flex: 1; min-width: 0; }
.module-name { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.module-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.module-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.lock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  color: var(--accent);
  background: rgba(242,169,0,.1);
  border: 1px solid rgba(242,169,0,.2);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: .3px;
}
.lock-badge svg { width: 10px; height: 10px; }

.modules-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 0 8px;
  margin-top: 8px;
}

/* ── Theme selector ──────────────────────────────────────── */
.theme-selector { display: flex; gap: 8px; }

.theme-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); }
.theme-btn.active { border-color: var(--accent); background: rgba(242,169,0,.1); color: var(--accent); font-weight: 600; }

/* ── Low stock badge ──────────────────────────────────────── */
.low-stock { color: var(--danger); }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp   { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes slideInRight { from { transform: translateX(24px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }

.spin { animation: spin .8s linear infinite; }

/* ── Loading ──────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  gap: 10px;
}
.loading svg { animation: spin .8s linear infinite; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; transition: left .25s ease; }
  .sidebar.open { left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Mobil medarbejdervisning ─────────────────────────────── */
.mobile-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--sidebar-bg);
  border-bottom: 2px solid var(--accent);
  height: 56px;
  flex-shrink: 0;
  gap: 12px;
}

.mobile-back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 80px;
}

.mobile-logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 5px;
  color: var(--accent);
  flex: 1;
  text-align: center;
}

.mobile-timer-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--border);
  transition: background .3s, border-color .3s;
  flex-shrink: 0;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mobile-timer-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(34,197,94,.08);
  border-bottom: 1px solid rgba(34,197,94,.25);
  flex-shrink: 0;
}

.mobile-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.mobile-section { margin-bottom: 24px; }

.mobile-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.mobile-booking-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, opacity .1s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-booking-card:active { opacity: .75; border-color: var(--accent); }

.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.mobile-card-plate {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.mobile-card-car  { font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.mobile-card-desc { font-size: 13px; color: var(--text); line-height: 1.5; }

.mobile-select {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.mobile-timer-display {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.mobile-btn-lg {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.mobile-btn-lg:active { opacity: .8; }
.mobile-btn-start { background: var(--accent); color: #000; }
.mobile-btn-stop  { background: var(--danger);  color: #fff; }

/* Fast fane-bar — mappe-design */
.mobile-tab-bar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 12px 10px 0;
  gap: 5px;
  background: var(--sidebar-bg);
  border-bottom: 3px solid var(--accent);
}

.mobile-tab-btn {
  flex: 1;
  padding: 12px 6px 11px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0.5;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-tab-btn.mtab-active {
  background: var(--surface);
  border-color: var(--accent);
  border-bottom-color: var(--surface);
  opacity: 1;
  font-weight: 700;
  padding-top: 14px;   /* aktiv fane er lidt højere */
}

.mtab-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(242, 169, 0, 0.12);
  padding: 2px 10px;
  border-radius: 20px;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

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