:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8f8f8;
  --ink: #171717;
  --muted: #666a70;
  --line: #e1e3e6;
  --brand: #e50918;
  --brand-dark: #b9000c;
  --header: #242424;
  --success: #167c43;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
.brandbar { background: var(--header); border-bottom: 3px solid var(--brand); }
.brandwrap { max-width: 860px; margin: 0 auto; padding: 10px 18px; position: relative; display:flex; align-items:center; justify-content:center; min-height:92px; }
.brandlogo { width: min(100%, 650px); max-height: 105px; object-fit: contain; display:block; }
.testbadge { position:absolute; right:18px; top:16px; background:#fff; color:var(--danger); border:1px solid #ddd; font-size:.72rem; font-weight:800; letter-spacing:.1em; padding:5px 8px; border-radius:999px; }
.shell { width: min(100% - 28px, 720px); margin: 28px auto 40px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); padding:26px; }
.hero { padding:32px; }
.eyebrow { color:var(--brand); font-weight:800; text-transform:uppercase; letter-spacing:.08em; font-size:.78rem; margin-bottom:7px; }
h1 { font-size:clamp(2rem, 8vw, 3.1rem); line-height:1; margin:0 0 12px; letter-spacing:-.035em; }
h2 { margin:0; font-size:1.1rem; }
p { margin:0 0 18px; }
.vehicle-meta { color:var(--muted); font-size:1rem; margin-bottom:0; }
.reg-form { margin-top:28px; }
label { display:block; font-weight:750; margin:0 0 8px; }
label span { color:var(--brand); }
input, select, textarea {
  width:100%; border:1px solid #cfd2d6; border-radius:12px; background:#fff; color:var(--ink); font:inherit; font-size:1rem; padding:14px 15px; outline:none; transition:border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color:var(--brand); box-shadow:0 0 0 4px rgba(229,9,24,.11); }
textarea { resize:vertical; min-height:110px; }
.reg-row { display:grid; grid-template-columns:1fr auto; gap:10px; }
.reg-row input { text-transform:uppercase; font-weight:850; letter-spacing:.08em; font-size:1.15rem; }
.btn {
  appearance:none; border:0; border-radius:12px; background:var(--brand); color:#fff; font:inherit; font-weight:800; padding:14px 19px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; min-height:50px; transition:transform .08s, background .15s;
}
.btn:hover { background:var(--brand-dark); }
.btn:active { transform:translateY(1px); }
.btn.secondary { background:#272727; }
.btn.ghost { width:100%; background:#fff; color:#242424; border:1px dashed #b9bdc2; margin:2px 0 18px; }
.btn.ghost:hover { background:#f6f6f6; }
.submit-btn { width:100%; min-height:58px; font-size:1.08rem; }
.helper, .privacy-note, .muted { color:var(--muted); font-size:.9rem; }
.helper { margin-top:18px; margin-bottom:0; }
.field-error { color:var(--danger); font-weight:700; margin:10px 0 0; }
.vehicle-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; border-bottom:1px solid var(--line); padding-bottom:20px; margin-bottom:22px; }
.change-vehicle, .textlink { color:#333; font-weight:750; text-decoration:underline; text-underline-offset:3px; }
.field-block { margin-bottom:22px; }
.fault-list { display:grid; gap:16px; margin-bottom:16px; }
.fault-card { background:var(--surface-soft); border:1px solid var(--line); border-radius:15px; padding:18px; display:grid; gap:10px; }
.fault-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:2px; }
.remove-fault { border:0; background:transparent; color:var(--danger); font-weight:750; cursor:pointer; padding:5px; }
.upload-label { margin-top:4px; margin-bottom:0; }
.upload-label small { font-weight:500; color:var(--muted); }
input[type=file] { background:#fff; padding:10px; }
.privacy-note { text-align:center; margin:13px 0 0; }
.success-card { text-align:center; padding:40px 26px; }
.success-icon { width:64px; height:64px; margin:0 auto 18px; border-radius:50%; display:grid; place-items:center; background:#e9f7ef; color:var(--success); font-size:2rem; font-weight:900; }
.success-card h1 { font-size:2.2rem; }
.success-card .btn { width:100%; margin-top:8px; }
.success-card .textlink { display:inline-block; margin-top:18px; }
.notice { background:#fff6e7; border:1px solid #f0d08e; padding:12px; border-radius:10px; text-align:left; }
.facts { margin:24px 0; display:grid; gap:12px; }
.facts div { display:grid; grid-template-columns:120px 1fr; gap:14px; border-bottom:1px solid var(--line); padding-bottom:10px; }
.facts dt { color:var(--muted); }
.facts dd { margin:0; font-weight:700; }
.status { display:inline-flex; padding:5px 9px; border-radius:999px; font-size:.82rem; font-weight:800; }
.status.open { background:#fff0f0; color:var(--danger); }
.report-items { display:grid; gap:14px; }
.report-item { border:1px solid var(--line); border-radius:14px; padding:16px; }
.report-item p { margin:10px 0 0; }

.hero-topline { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:7px; }
.hero-topline .eyebrow { margin-bottom:0; }
.vehicle-count { flex:0 0 auto; background:#f2f3f5; border:1px solid var(--line); color:#555b61; font-size:.78rem; font-weight:800; padding:6px 9px; border-radius:999px; }
.vehicle-picker { position:relative; }
.vehicle-dropdown {
  position:absolute;
  z-index:30;
  left:0;
  right:0;
  top:calc(100% + 8px);
  max-height:360px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #cfd2d6;
  border-radius:14px;
  box-shadow:0 18px 42px rgba(0,0,0,.16);
  padding:7px;
}
.vehicle-dropdown[hidden] { display:none; }
.vehicle-option {
  width:100%;
  border:0;
  border-bottom:1px solid #eceef0;
  background:#fff;
  color:var(--ink);
  text-align:left;
  padding:12px 13px;
  cursor:pointer;
  border-radius:9px;
  display:block;
}
.vehicle-option:last-of-type { border-bottom:0; }
.vehicle-option:hover,
.vehicle-option:focus { background:#f7f7f8; outline:none; }
.vehicle-option[hidden] { display:none; }
.vehicle-option-main { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.vehicle-option-main strong { font-size:1.02rem; letter-spacing:.06em; }
.internal-number { color:var(--brand); font-size:.82rem; font-weight:800; white-space:nowrap; }
.vehicle-option-meta { display:block; margin-top:3px; color:var(--muted); font-size:.83rem; }
.vehicle-empty { padding:18px 14px; color:var(--muted); text-align:center; font-weight:650; }

.footer { text-align:center; color:#777; font-size:.82rem; padding:0 20px 28px; }
@media (max-width: 560px) {
  .brandwrap { min-height:76px; padding:8px 14px; }
  .brandlogo { max-height:86px; }
  .testbadge { top:10px; right:10px; font-size:.64rem; }
  .shell { width:min(100% - 18px, 720px); margin-top:16px; }
  .card, .hero { padding:20px; border-radius:15px; }
  .reg-row { grid-template-columns:1fr; }
  .reg-row .btn { width:100%; }
  .vehicle-dropdown { max-height:52vh; }
  .vehicle-option { padding:13px 12px; }
  .vehicle-option-main { align-items:flex-start; }
  .vehicle-head { align-items:flex-start; }
  .change-vehicle { font-size:.9rem; white-space:nowrap; }
  .facts div { grid-template-columns:1fr; gap:2px; }
}

/* v3 – status, kvittens och mottagarbehörighet */
.status.workshop { background:#fff4db; color:#8a5a00; }
.status.resolved { background:#e8f7ee; color:var(--success); }
.report-heading-row { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.report-heading-row .status { flex:0 0 auto; margin-top:4px; }
.receipt-card { max-width:620px; margin-inline:auto; }
.receipt-intro { color:var(--muted); }
.receipt-facts { margin:22px 0; text-align:left; display:grid; gap:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.receipt-facts div { display:grid; grid-template-columns:125px 1fr; gap:12px; padding:12px 14px; background:#fff; border-bottom:1px solid var(--line); }
.receipt-facts div:last-child { border-bottom:0; }
.receipt-facts dt { color:var(--muted); }
.receipt-facts dd { margin:0; font-weight:750; }
.receipt-note { color:var(--muted); font-size:.9rem; margin-top:8px; }
.admin-banner { margin:0 0 14px; border:1px solid #d9dce0; border-radius:14px; background:#fff; box-shadow:var(--shadow); padding:13px 16px; display:flex; align-items:center; justify-content:space-between; gap:18px; }
.admin-banner > div { display:flex; flex-direction:column; gap:2px; }
.admin-label { color:var(--brand); text-transform:uppercase; letter-spacing:.07em; font-size:.7rem; font-weight:850; }
.admin-mail { color:var(--muted); font-size:.86rem; }
.flash-success { margin:0 0 14px; padding:13px 16px; border:1px solid #b9dfc8; border-radius:12px; background:#ecf8f1; color:#116b39; font-weight:750; }
.status-admin-card { margin-top:16px; }
.status-admin-card > h2 { font-size:1.55rem; margin:0 0 8px; }
.status-actions { display:grid; gap:14px; margin-top:20px; }
.status-action { border:1px solid var(--line); border-radius:14px; padding:16px; background:var(--surface-soft); }
.status-action label { margin-top:10px; }
.status-action label:first-of-type { margin-top:0; }
.status-action label small { color:var(--muted); font-weight:500; }
.status-action textarea, .status-action input { background:#fff; }
.status-btn { width:100%; margin-top:12px; }
.open-btn { background:#4b5158; }
.open-btn:hover { background:#353a40; }
.workshop-btn { background:#b57400; }
.workshop-btn:hover { background:#925e00; }
.resolved-btn { background:var(--success); }
.resolved-btn:hover { background:#0f6334; }
.history-block { margin-top:26px; padding-top:22px; border-top:1px solid var(--line); }
.history-block > h2 { font-size:1.3rem; margin-bottom:14px; }
.timeline { display:grid; gap:0; }
.timeline-item { position:relative; display:grid; grid-template-columns:18px 1fr; gap:10px; padding-bottom:17px; }
.timeline-item:not(:last-child)::before { content:""; position:absolute; left:6px; top:14px; bottom:0; width:2px; background:#e0e3e6; }
.timeline-dot { width:13px; height:13px; border-radius:50%; background:var(--brand); margin-top:4px; position:relative; z-index:1; }
.timeline-item p { margin:3px 0 0; }
.history-detail { color:#6a4d0a; font-size:.9rem; }
.history-comment { margin-top:7px !important; background:#f5f6f7; border-radius:9px; padding:9px 10px; font-size:.92rem; }
.readonly-note { text-align:center; color:var(--muted); font-size:.88rem; margin:14px 0 0; }

@media (max-width: 560px) {
  .report-heading-row { flex-direction:column; gap:10px; }
  .report-heading-row .status { margin-top:0; }
  .receipt-facts div { grid-template-columns:1fr; gap:2px; }
  .admin-banner { align-items:flex-start; flex-direction:column; gap:4px; }
}


/* v4 – förenklad mottagarvy */
.quick-admin-card { margin-top:16px; }
.quick-status-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.quick-status-head h2 { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:1.25rem; }
.quick-actions { display:grid; gap:12px; }
.action-disclosure, .comment-disclosure, .history-disclosure { border:0; }
.action-disclosure > summary,
.comment-disclosure > summary,
.history-disclosure > summary { list-style:none; cursor:pointer; }
.action-disclosure > summary::-webkit-details-marker,
.comment-disclosure > summary::-webkit-details-marker,
.history-disclosure > summary::-webkit-details-marker { display:none; }

.action-button {
  width:100%;
  min-height:56px;
  border:0;
  border-radius:12px;
  font:inherit;
  font-weight:850;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  cursor:pointer;
  text-decoration:none;
}
.workshop-action { background:#fff1d6; color:#7a4f00; border:1px solid #e7c77e; }
.workshop-action:hover { background:#ffe8b7; }
.quick-form { display:grid; gap:8px; }
.quick-form .action-button { margin:0; }
.compact-form {
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-soft);
  padding:14px;
  display:grid;
  gap:10px;
}
.compact-form label { margin:0; }
.compact-form input, .compact-form textarea { background:#fff; }
.compact-form textarea, .comment-disclosure textarea { min-height:78px; }

.comment-disclosure { margin:2px 0 0; }
.comment-disclosure > summary {
  color:#555b61;
  font-size:.86rem;
  font-weight:700;
  padding:4px 1px;
}
.comment-disclosure[open] > summary { margin-bottom:7px; }

.current-booking, .resolved-summary {
  border-radius:12px;
  padding:14px 16px;
  margin-bottom:12px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 14px;
}
.current-booking { background:#fff5df; border:1px solid #ead29d; color:#6e4a03; }
.resolved-summary { background:#eaf8ef; border:1px solid #b9dfc8; color:#116b39; }
.current-booking strong, .resolved-summary strong { font-size:1rem; }
.current-booking span, .resolved-summary span { font-size:.92rem; }

.secondary-action {
  display:block;
  text-align:center;
  color:#4d5359;
  font-weight:750;
  text-decoration:underline;
  text-underline-offset:3px;
  padding:6px;
}
.reopen-form { text-align:center; }
.link-button {
  appearance:none;
  border:0;
  background:transparent;
  color:#555b61;
  font:inherit;
  font-size:.9rem;
  font-weight:750;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
  padding:7px 10px;
}
.link-button:hover { color:#222; }

.history-disclosure {
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
.history-disclosure > summary {
  font-weight:800;
  color:#383d42;
  padding:4px 0;
}
.history-disclosure[open] > summary { margin-bottom:14px; }
.compact-timeline { margin-top:4px; }
.personal-link-note {
  margin:18px 0 0;
  color:#8a8f94;
  font-size:.78rem;
  text-align:center;
}
.flash-success { padding:10px 14px; font-size:.9rem; }

/* Gamla admin-banner visas inte i v4 */
.admin-banner { display:none; }

@media (max-width:560px) {
  .quick-admin-card { padding:18px; }
  .quick-status-head { margin-bottom:14px; }
  .quick-status-head h2 { font-size:1.12rem; }
  .action-button { min-height:54px; }
}


/* v6 – historik alltid stängd vid sidladdning, öppnas endast aktivt */
.history-toggle {
  appearance:none;
  border:0;
  background:transparent;
  color:#383d42;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  padding:4px 0;
  text-align:left;
}
.history-toggle:hover { text-decoration:underline; text-underline-offset:3px; }
.history-panel { margin-top:14px; }
.history-panel[hidden] { display:none !important; }

/* v8 – egen svensk verkstadskalender */
.svdt { position:relative; }
.svdt-trigger {
  width:100%;
  min-height:52px;
  border:1px solid #cfd2d6;
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  padding:13px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  text-align:left;
}
.svdt-trigger:hover { border-color:#b7bbc0; }
.svdt-trigger:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 4px rgba(229,9,24,.11); }
.svdt-trigger.is-invalid { border-color:var(--brand); box-shadow:0 0 0 3px rgba(229,9,24,.09); }
.svdt-calendar-icon { flex:0 0 auto; color:#686d73; font-size:1.05rem; }
.svdt-panel {
  margin-top:9px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:13px;
  box-shadow:0 12px 30px rgba(0,0,0,.09);
}
.svdt-panel[hidden] { display:none !important; }
.svdt-calendar-head {
  display:grid;
  grid-template-columns:42px 1fr 42px;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
.svdt-calendar-head strong { text-align:center; font-size:1rem; text-transform:capitalize; }
.svdt-nav {
  appearance:none;
  border:0;
  border-radius:9px;
  background:#f4f5f6;
  color:#333;
  font:inherit;
  font-size:1.35rem;
  line-height:1;
  min-height:38px;
  cursor:pointer;
}
.svdt-nav:hover { background:#e9ebed; }
.svdt-weekdays, .svdt-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
.svdt-weekdays { margin-bottom:5px; }
.svdt-weekdays span {
  text-align:center;
  color:#62676d;
  font-size:.76rem;
  font-weight:750;
  padding:4px 0;
}
.svdt-weekdays .red-day { color:var(--brand); }
.svdt-empty { min-height:40px; }
.svdt-day {
  appearance:none;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#171717;
  font:inherit;
  font-size:.9rem;
  min-height:40px;
  cursor:pointer;
  font-variant-numeric:tabular-nums;
}
.svdt-day:hover { background:#f3f4f5; }
.svdt-day.is-red-day { color:var(--brand); font-weight:800; }
.svdt-day.is-today { border-color:#aeb3b8; }
.svdt-day.is-selected { background:#1976d2; color:#fff; font-weight:850; border-color:#1976d2; }
.svdt-day.is-selected.is-red-day { color:#fff; }
.svdt-time-row {
  display:grid;
  grid-template-columns:auto minmax(130px, 180px);
  align-items:center;
  justify-content:start;
  gap:12px;
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--line);
}
.svdt-time-row label { margin:0; }
.svdt-time-row input[type=time] { padding:10px 12px; }
.svdt-holiday {
  margin-top:10px;
  border-radius:9px;
  background:#fff0f0;
  color:var(--danger);
  font-size:.84rem;
  font-weight:750;
  padding:8px 10px;
}
.svdt-holiday[hidden], .svdt-error[hidden] { display:none !important; }
.svdt-error { margin:9px 0 0; color:var(--danger); font-size:.84rem; font-weight:750; }
.svdt-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:13px; }
.svdt-cancel, .svdt-done {
  appearance:none;
  border:0;
  border-radius:10px;
  min-height:44px;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.svdt-cancel { background:#eef0f2; color:#333; }
.svdt-done { background:#272727; color:#fff; }
.svdt-legend { margin:10px 0 0; color:#73787e; font-size:.76rem; text-align:center; }

/* v8 – historiklänken ska se ut som resten av gränssnittet, inte som standardknapp */
.history-toggle {
  appearance:none;
  -webkit-appearance:none;
  border:0 !important;
  outline:0;
  background:transparent !important;
  box-shadow:none !important;
  color:#383d42;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  padding:4px 0;
  text-align:left;
  text-decoration:none;
}
.history-toggle::after { content:' ▾'; }
.history-toggle[aria-expanded="true"]::after { content:' ▴'; }
.history-toggle:hover { text-decoration:underline; text-underline-offset:3px; }

@media (max-width:560px) {
  .svdt-panel { padding:11px; }
  .svdt-weekdays, .svdt-grid { gap:2px; }
  .svdt-day { min-height:42px; font-size:.88rem; }
  .svdt-time-row { grid-template-columns:1fr; gap:6px; }
  .svdt-time-row input[type=time] { max-width:none; }
}

/* v9 – desktop använder skärmbredden, mobil behåller enkel kolumn */
@media (min-width: 900px) {
  .shell:has(.admin-desktop-grid) {
    width: min(calc(100% - 44px), 1440px);
    margin-top: 24px;
  }

  .shell:has(.admin-desktop-grid) .flash-success {
    max-width: 100%;
  }

  .admin-desktop-grid {
    display: grid;
    grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr);
    gap: 22px;
    align-items: start;
  }

  .admin-desktop-grid .report-view-card,
  .admin-desktop-grid .quick-admin-card {
    margin-top: 0;
    min-width: 0;
  }

  .admin-desktop-grid .quick-admin-card {
    position: sticky;
    top: 18px;
  }

  .admin-desktop-grid .svdt-panel {
    max-width: none;
  }
}

@media (min-width: 1250px) {
  .brandwrap {
    max-width: 1440px;
  }
}

@media (max-width: 899px) {
  .admin-desktop-grid {
    display: block;
  }
  .admin-desktop-grid .quick-admin-card {
    margin-top: 16px;
  }
}

/* v10 – färdig desktopvy: använder hela skärmen och låter kalendern ligga ovanpå istället för att göra sidan längre */
@media (min-width: 900px) {
  body.admin-view {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.admin-view .brandbar {
    min-height: 0;
  }

  body.admin-view .brandwrap {
    max-width: 1500px;
    min-height: 68px;
    padding: 5px 18px;
  }

  body.admin-view .brandlogo {
    width: min(100%, 520px);
    max-height: 66px;
  }

  body.admin-view .testbadge {
    top: 10px;
  }

  body.admin-view .shell:has(.admin-desktop-grid) {
    width: min(calc(100% - 28px), 1500px);
    min-height: 0;
    height: auto;
    margin: 12px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
  }

  body.admin-view .flash-success {
    flex: 0 0 auto;
    margin: 0;
    padding: 9px 13px;
  }

  body.admin-view .admin-desktop-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(340px, .78fr) minmax(560px, 1.22fr);
    gap: 14px;
    align-items: start;
  }

  body.admin-view .admin-desktop-grid .report-view-card,
  body.admin-view .admin-desktop-grid .quick-admin-card {
    min-width: 0;
    max-height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    margin: 0;
  }

  body.admin-view .admin-desktop-grid .quick-admin-card {
    position: static;
  }

  body.admin-view .card {
    padding: 18px;
    border-radius: 14px;
  }

  body.admin-view .report-heading-row {
    padding-bottom: 0;
  }

  body.admin-view h1 {
    font-size: clamp(2.25rem, 3.1vw, 3rem);
    margin-bottom: 8px;
  }

  body.admin-view .facts {
    margin: 16px 0;
    gap: 8px;
  }

  body.admin-view .facts div {
    padding-bottom: 7px;
  }

  body.admin-view .report-items {
    gap: 10px;
  }

  body.admin-view .report-item {
    padding: 13px;
  }

  body.admin-view .report-item p {
    margin-top: 7px;
    margin-bottom: 0;
  }

  body.admin-view .quick-status-head {
    margin-bottom: 10px;
  }

  body.admin-view .current-booking,
  body.admin-view .resolved-summary {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  body.admin-view .quick-actions {
    gap: 8px;
  }

  body.admin-view .action-button {
    min-height: 46px;
  }

  body.admin-view .compact-form {
    margin-top: 7px;
    padding: 11px;
    gap: 8px;
  }

  body.admin-view .compact-form input,
  body.admin-view .compact-form textarea {
    padding: 10px 12px;
  }

  body.admin-view .history-disclosure {
    margin-top: 11px;
    padding-top: 10px;
  }

  body.admin-view .footer {
    display: none;
  }

  /* Kalendern är en overlay/modal på dator. Den ökar aldrig sidans höjd. */
  body.admin-view.svdt-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(18, 18, 18, .30);
    backdrop-filter: blur(1px);
  }

  body.admin-view .svdt-panel {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, calc(100vw - 40px));
    max-height: calc(100vh - 34px);
    max-height: calc(100dvh - 34px);
    overflow: auto;
    margin: 0;
    padding: 14px;
    box-shadow: 0 24px 70px rgba(0,0,0,.30);
  }

  body.admin-view .svdt-calendar-head {
    margin-bottom: 5px;
  }

  body.admin-view .svdt-weekdays {
    margin-bottom: 2px;
  }

  body.admin-view .svdt-day,
  body.admin-view .svdt-empty {
    min-height: 34px;
  }

  body.admin-view .svdt-time-row {
    margin-top: 9px;
    padding-top: 9px;
  }

  body.admin-view .svdt-actions {
    margin-top: 9px;
  }

  body.admin-view .svdt-legend {
    margin-top: 7px;
  }
}

/* Automatisk kompaktning på lägre datorskärmar. */
@media (min-width: 900px) and (max-height: 850px) {
  body.admin-view .brandwrap {
    min-height: 56px;
    padding-block: 3px;
  }
  body.admin-view .brandlogo { max-height: 54px; width: min(100%, 450px); }
  body.admin-view .shell:has(.admin-desktop-grid) { margin-block: 8px; gap: 7px; }
  body.admin-view .card { padding: 14px; }
  body.admin-view h1 { font-size: 2.2rem; }
  body.admin-view .eyebrow { font-size: .70rem; margin-bottom: 4px; }
  body.admin-view .vehicle-meta { font-size: .9rem; }
  body.admin-view .facts { margin: 11px 0; gap: 5px; }
  body.admin-view .facts div { padding-bottom: 5px; }
  body.admin-view .report-item { padding: 10px; }
  body.admin-view .current-booking, body.admin-view .resolved-summary { padding: 8px 10px; }
  body.admin-view .action-button { min-height: 42px; }
  body.admin-view .compact-form { padding: 9px; }
  body.admin-view .history-disclosure { margin-top: 8px; padding-top: 8px; }
}

@media (min-width: 900px) and (max-height: 720px) {
  body.admin-view { font-size: 14px; }
  body.admin-view .brandwrap { min-height: 48px; }
  body.admin-view .brandlogo { max-height: 46px; width: min(100%, 390px); }
  body.admin-view .shell:has(.admin-desktop-grid) { margin-block: 5px; }
  body.admin-view .card { padding: 11px; }
  body.admin-view h1 { font-size: 1.95rem; margin-bottom: 5px; }
  body.admin-view .facts { margin: 8px 0; }
  body.admin-view .report-item { padding: 8px; }
  body.admin-view .action-button { min-height: 38px; }
}
