* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Fieldnotes design tokens. Accentfarven kan senere overstyres pr. firma
     (tenant-branding) ved at sætte --accent* på :root fra serveren. */
  --graphite: #1f2937;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e7e9ee;
  --accent: #1e9e50;
  --accent-dark: #177f40;
  --accent-soft: #e7f5ec;
  --accent-ink: #14713e;
  /* Bagudkompatible aliaser — ældre regler bruger stadig mint-navnene */
  --mint: var(--accent);
  --mint-grad: linear-gradient(90deg, #35c06e, var(--accent-dark));
  --mint-soft: var(--accent-soft);
  --error: #ef4444;
  --success: var(--accent);
  --radius-btn: 8px;
  --radius-card: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

body {
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}
.nav-toggle:hover { border-color: var(--graphite); }
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--graphite);
  border-radius: 2px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.4);
  z-index: 60;
}
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  max-width: 82vw;
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
  z-index: 61;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.22s ease;
  overflow-y: auto;
}
.nav-drawer.hidden { display: flex !important; transform: translateX(-105%); }
.nav-drawer nav { display: flex; flex-direction: column; gap: 2px; }

/* Sidebar-hoved: logo + firmanavn */
.sidebar-brand { padding: 2px 10px 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sidebar-brand .logo-btn { font-size: 21px; font-weight: 800; letter-spacing: 0.01em; color: var(--graphite); }
.sidebar-tenant { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--muted); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-btn);
  background: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav-item.soon { color: var(--muted); }
.nav-ico { width: 20px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.nav-ico svg { width: 17px; height: 17px; }
.nav-item.active .nav-ico { color: var(--accent-ink); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 4px;
}
.nav-footer { padding: 10px 12px 2px; font-size: 12px; color: var(--muted); }

/* Sidebar-fod: bruger + sprog + guide */
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.sidebar-user-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-main #user-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }

/* Desktop: fast sidebar, ingen topbar */
@media (min-width: 920px) {
  body.authed { padding-left: 248px; }
  body.authed header { display: none; }
  body.authed .nav-drawer,
  body.authed .nav-drawer.hidden { transform: none; box-shadow: none; }
  body.authed .nav-backdrop { display: none !important; }
  body:not(.authed) .nav-drawer { display: none !important; }
}

.placeholder {
  max-width: 460px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 24px;
}
.placeholder-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.9; }
.placeholder h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.placeholder-text { margin-top: 0; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--graphite);
}
.logo-accent {
  background: linear-gradient(90deg, #35c06e, #177f40);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Logoet er en knap (tilbage til dashboard) men skal se ud som ren tekst */
.logo-btn {
  background: none; border: none; padding: 0; font-family: inherit; cursor: pointer;
}
.logo-btn:hover { opacity: 0.75; }
.brand-divider { width: 1px; height: 24px; background: var(--border); }
.brand h1 { font-size: 18px; font-weight: 500; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 16px; }

.help-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}
.help-link:hover { color: var(--graphite); border-color: var(--graphite); }

/* user-chip bor nu i sidebar-foden (se .sidebar-user) */
.logout-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--graphite); border-color: var(--graphite); }

.lang-switch { display: flex; gap: 8px; }
.flag-btn {
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  padding: 3px 4px 0 4px;
  background: none;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s, border-color 0.2s;
}
.flag-btn:hover { opacity: 0.85; }
.flag-btn.active { opacity: 1; border-color: var(--graphite); }
.flag-btn svg { border-radius: 2px; display: block; }

.demo-banner {
  background: var(--mint-soft);
  color: var(--accent-ink);
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
}

.view { max-width: 1080px; margin: 32px auto; padding: 0 16px; }
#slots-list { max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-logo { font-size: 26px; font-weight: 800; letter-spacing: 0.01em; margin-bottom: 14px; }
.login-switch {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}
.login-switch:hover { color: var(--graphite); }
.login-card { max-width: 400px; margin: 72px auto; text-align: center; }

/* ---- Team / Ansatte ---- */
.license-info { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: 4px; }
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.team-row:hover { border-color: var(--graphite); }
.team-row.inactive { opacity: 0.55; }
.team-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-name { font-weight: 600; font-size: 15px; }
.team-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.team-role {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.team-role.role-owner { background: var(--graphite); color: #fff; }
.team-role.role-manager { background: #ede9fe; color: #5b21b6; }
.team-role.role-employee { background: var(--mint-soft); color: var(--accent-ink); }

/* ---- Platform: virksomheders plan-status ---- */
.plan-badge {
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.plan-badge.plan-active { background: var(--mint-soft); color: var(--accent-ink); }
.plan-badge.plan-trial { background: #fef3c7; color: #92400e; }
.plan-badge.plan-cancelled { background: #fee2e2; color: #991b1b; }
.tenant-emp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tenant-emp:last-child { border-bottom: none; }
.tenant-emp-name { font-size: 14.5px; font-weight: 600; }

/* ---- Opgaver / Ordrer ---- */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.order-text { font-size: 14.5px; white-space: pre-wrap; color: var(--text); }
.order-badge { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ostatus-open { background: #dbeafe; color: #1e40af; }
.ostatus-booked { background: #e0e7ff; color: #3730a3; }
.ostatus-in_progress { background: #fef3c7; color: #92400e; }
.ostatus-done { background: var(--mint-soft); color: var(--accent-ink); }
.ostatus-invoiced { background: #ede9fe; color: #5b21b6; }
.ostatus-cancelled { background: #fee2e2; color: #991b1b; }
#od-scheduled { white-space: pre-line; }
@media (max-width: 560px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* Opgave-liste som tabel (Minuba-stil). Fast kolonnelayout i procenter, så
   ALLE kolonner er synlige uden vandret scroll — langt indhold afkortes med
   "…" (fuld tekst ved hover og på opgavens detaljeside). */
#opgaver-view { max-width: 1560px; }
.orders-table-wrap {
  overflow-x: auto; /* kun fallback på smalle skærme (min-width på tabellen) */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.orders-table { width: 100%; min-width: 880px; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.orders-table thead th {
  text-align: left; font-weight: 700; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 10px;
  border-bottom: 1px solid var(--border); background: #fafafa;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.orders-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Kolonnebredder (sum 100 %): status, nr, beskrivelse, kundenr, kundenavn,
   postnr, by, adresse, reference, rekvirent, email */
.orders-table th:nth-child(1) { width: 8%; }
.orders-table th:nth-child(2) { width: 6.5%; }
.orders-table th:nth-child(3) { width: 19%; }
.orders-table th:nth-child(4) { width: 7.5%; }
.orders-table th:nth-child(5) { width: 11%; }
.orders-table th:nth-child(6) { width: 5.5%; }
.orders-table th:nth-child(7) { width: 7%; }
.orders-table th:nth-child(8) { width: 13.5%; }
.orders-table th:nth-child(9) { width: 6.5%; }
.orders-table th:nth-child(10) { width: 6.5%; }
.orders-table th:nth-child(11) { width: 9%; }
.orders-table tbody tr { cursor: pointer; transition: background 0.12s; }
.orders-table tbody tr:hover { background: var(--mint-soft); }
.orders-table tbody tr:last-child td { border-bottom: none; }
.ocol-status { font-weight: 600; }
.ocol-num { font-weight: 700; }
.order-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.order-dot.ostatus-open { background: #22c55e; }
.order-dot.ostatus-booked { background: #6366f1; }
.order-dot.ostatus-in_progress { background: #38bdf8; }
.order-dot.ostatus-done { background: var(--accent); }
.order-dot.ostatus-invoiced { background: #8b5cf6; }
.order-dot.ostatus-cancelled { background: #b45309; }

/* Opgave fase 2: materialer, timer, økonomi */
.order-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.order-economy { grid-column: 1 / -1; max-width: 420px; }
.order-lines-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-lines-head .cust-card-title { margin-bottom: 0; }
.line-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.line-row:last-child { border-bottom: none; }
.line-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.line-title { font-size: 14px; font-weight: 600; }
.line-sub { font-size: 12.5px; color: var(--muted); }
.line-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.line-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 4px; }
.line-del:hover { color: var(--error); background: #fee2e2; }
.line-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.line-form input { padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-family: inherit; font-size: 13.5px; }
.line-form input[type="text"] { flex: 1; min-width: 120px; }
.line-form input[type="number"] { width: 90px; }
.econ-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.econ-row.econ-sub { border-top: 1px solid var(--border); margin-top: 4px; font-weight: 600; }
.econ-row.econ-total { border-top: 2px solid var(--graphite); margin-top: 4px; font-weight: 800; font-size: 15.5px; }
.econ-row.econ-margin-top { border-top: 1px dashed var(--border); margin-top: 8px; }
.econ-row.econ-db { font-weight: 700; color: var(--success); }
@media (max-width: 720px) {
  .order-lines { grid-template-columns: 1fr; }
}

.cal-connected-name { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius-btn); margin: 12px 0 16px; font-size: 15px; }

/* ---- Oversigt (dashboard) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.ov-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ov-item:last-child { border-bottom: none; }
.ov-item:hover .ov-item-title { text-decoration: underline; }
.ov-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ov-item-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-item-sub { font-size: 12.5px; color: var(--muted); }
.ov-econ-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ov-econ-table th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border);
}
.ov-econ-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); }
.ov-econ-table tr:last-child td { border-bottom: none; }
.ov-econ-table td:first-child { font-weight: 600; }
@media (max-width: 900px) { .ov-grid { grid-template-columns: 1fr; } }

/* Satser & tillæg */
.supp-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.supp-row:last-child { border-bottom: none; }
.supp-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.supp-name { font-size: 14px; font-weight: 600; }
.supp-meta { font-size: 12.5px; color: var(--muted); }
.supp-visible { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.supp-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.supp-add input[type="text"] { flex: 1; min-width: 130px; padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-family: inherit; font-size: 13.5px; }
.supp-add input[type="number"] { width: 90px; padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-family: inherit; font-size: 13.5px; }
.supp-add select { padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-family: inherit; font-size: 13.5px; }
.hours-supp { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.hours-supp-label { flex-basis: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
.supp-check { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }

/* ---- Besigtigelse: skema-bygger ---- */
.form-builder-modal { max-width: 560px; }
.form-actions { display: flex; gap: 8px; flex-shrink: 0; }
.q-row {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px;
  margin-bottom: 10px;
  background: #fafafa;
}
.q-head { display: flex; gap: 8px; align-items: center; }
.q-label { flex: 1; }
.q-type { width: auto; font-size: 13px; padding: 8px 10px; }
.q-del {
  border: none; background: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.q-del:hover { color: #dc2626; background: #fef2f2; }
.q-options { width: 100%; margin-top: 8px; padding: 10px 12px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-family: inherit; font-size: 14px; resize: vertical; }
.q-req { display: flex; align-items: center; gap: 6px; margin: 8px 0 0 !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; cursor: pointer; }
.q-req input { width: auto; }

/* ---- Rapporter ---- */
.resp-modal { max-width: 560px; }
.resp-status { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: capitalize; flex-shrink: 0; }
.resp-status.s-ny { background: #fef3c7; color: #92400e; }
.resp-status.s-set { background: #e0e7ff; color: #3730a3; }
.resp-status.s-behandlet { background: var(--mint-soft); color: var(--accent-ink); }
.resp-status-row { display: flex; gap: 8px; margin: 6px 0 4px; }
.status-btn {
  flex: 1; padding: 9px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn);
  background: #fff; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-transform: capitalize;
}
.status-btn.active { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.answer-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.answer-q { font-size: 13px; font-weight: 600; color: var(--muted); }
.answer-v { font-size: 15px; margin-top: 2px; white-space: pre-wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* ---- Kundefeed ---- */
.feed-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed-row:last-child { border-bottom: none; }
.feed-ico { font-size: 18px; }
.feed-main { display: flex; flex-direction: column; gap: 1px; }
.feed-title { font-size: 14.5px; font-weight: 600; }
.feed-time { font-size: 12.5px; color: var(--muted); }

/* ---- Kundeprofil (dedikeret kundeside) ---- */
.cust-back {
  background: none; border: none; color: var(--muted); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 8px;
}
.cust-back:hover { color: var(--graphite); }
.cust-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.cust-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); padding: 14px 22px; display: flex; flex-direction: column; min-width: 110px;
}
.cust-stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.cust-stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.cust-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.cust-card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.cust-info { display: flex; flex-direction: column; }
.cust-info-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cust-info-row:last-child { border-bottom: none; }
.cust-info-row dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cust-info-row dd { font-size: 15.5px; }
.cust-info-row dd a { color: var(--success); text-decoration: none; font-weight: 600; }
.cust-info-row dd a:hover { text-decoration: underline; }
.od-form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.book-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.book-tab { background: none; border: none; padding: 10px 14px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.book-tab.active { color: var(--graphite); border-bottom-color: var(--graphite); }
.link-result { display: flex; gap: 6px; margin-top: 8px; }
.link-result input { flex: 1; min-width: 0; padding: 7px 10px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn); font-size: 12.5px; font-family: inherit; }
.cust-reports-card { margin-top: 20px; }
.cust-report-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.cust-report-row:last-child { border-bottom: none; }
.cust-report-row:hover .feed-title { text-decoration: underline; }
.cust-note-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cust-note-add textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d1d5db; border-radius: var(--radius-btn);
  font-family: inherit; font-size: 14.5px; resize: vertical;
}
.cust-note-add textarea:focus { outline: none; border-color: var(--graphite); }
.cust-note-add .btn { align-self: flex-end; }
@media (max-width: 720px) {
  .cust-grid { grid-template-columns: 1fr; }
}
.login-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}
input:focus, select:focus { outline: none; border-color: var(--graphite); }

.btn {
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease-in-out;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--graphite); border-color: #d1d5db; }
.btn.ghost:hover { border-color: var(--graphite); }
.btn.danger { background: none; color: #dc2626; border-color: #fca5a5; }
.btn.danger:hover { background: #fef2f2; border-color: #dc2626; }
.btn.danger:disabled { opacity: 0.5; cursor: not-allowed; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.toolbar h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }

.day-group { margin-bottom: 26px; }
.day-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-left: 2px;
}

.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.slot::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--mint-grad);
  opacity: 0;
  transition: opacity 0.2s;
}
.slot:hover { border-color: var(--graphite); transform: translateY(-1px); }
.slot:hover::before { opacity: 1; }
.slot .time { font-size: 17px; font-weight: 600; }
.slot .duration { color: var(--muted); font-size: 14px; margin-left: 10px; font-weight: 400; }
.slot .book-hint { color: var(--graphite); font-weight: 600; font-size: 14px; }
.slot .book-hint::after { content: " →"; }

.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.btn.small { padding: 8px 14px; font-size: 14px; }

.view-toggle {
  display: flex;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.toggle-btn {
  padding: 8px 18px;
  background: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--graphite);
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn.active { background: var(--graphite); color: #fff; }
/* (uge/måned/liste-skifteren beholder mørk aktiv — læsbar kontrast) */

/* ---- Week calendar (Google Calendar style) ---- */

.cal-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.cal-controls .btn { margin-right: 8px; }
.nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--graphite);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 3px;
}
.nav-btn:hover { background: #e6e6e6; }
#week-label { font-size: 18px; font-weight: 600; margin-left: 8px; text-transform: capitalize; }

.cal-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.cal-grid { min-width: 780px; }

.cal-head-row {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-day-head {
  padding: 10px 4px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--border);
}
.cal-day-head .daynum {
  display: block;
  width: 38px;
  height: 38px;
  line-height: 38px;
  margin: 4px auto 0;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--graphite);
}
.cal-day-head.today .daynum { background: var(--graphite); color: #fff; }
.cal-day-head.past { opacity: 0.45; }

.cal-body {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  position: relative;
}
.cal-gutter { position: relative; }
.hour-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  background: #fff;
  padding: 0 2px;
}
.cal-col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0,
    var(--border) 1px,
    transparent 1px,
    transparent 48px
  );
}
.cal-col.today-col { background-color: #f6fdfb; }

.cal-slot {
  position: absolute;
  left: 3px;
  right: 4px;
  background: var(--mint-soft);
  border: 1px solid rgba(30, 158, 80, 0.35);
  border-left: 3px solid var(--mint);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  transition: box-shadow 0.15s, transform 0.1s;
}
.cal-slot:hover {
  box-shadow: 0 3px 10px rgba(30, 158, 80, 0.35);
  transform: translateY(-1px);
  z-index: 3;
}
.cal-slot .cal-slot-time { font-weight: 600; color: var(--accent-ink); display: block; }
.cal-slot .cal-slot-label { color: var(--accent-ink); }

.cal-slot.booked {
  background: var(--graphite);
  border: 1px solid #111;
  border-left: 3px solid #000;
  cursor: default;
}
.cal-slot.booked:hover { box-shadow: none; transform: none; z-index: 1; }
.cal-slot.booked .cal-slot-time { color: #fff; }
.cal-slot.booked .cal-slot-label { color: #c9ced6; }
.cal-slot .cal-slot-loc { display: block; font-size: 11px; color: #8f99a3; }
.cal-slot.booked .cal-slot-loc { color: #9aa3ad; }
.cal-slot .cal-slot-by { display: block; font-size: 11px; color: #7dd8c8; font-weight: 600; margin-top: 1px; }

.cal-slot.booked.editable { cursor: pointer; }
.cal-slot.booked.editable:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
  z-index: 3;
}
.cal-slot .edit-hint {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  color: #9aa3ad;
}

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

.small-note { margin: 14px 0 0; }

/* ---- Filters & admin controls ---- */

.cal-controls-spacer { flex: 1; }
.filter-select {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: var(--radius-btn);
}

/* ---- Month view ---- */

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.month-head {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.month-cell {
  min-height: 96px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 4px;
  overflow: hidden;
}
.month-cell:nth-child(7n) { border-right: none; }
.month-cell.other-month { background: #fafafa; }
.month-cell.other-month .month-daynum { opacity: 0.35; }
.month-daynum {
  font-size: 13px;
  font-weight: 600;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  margin-bottom: 2px;
}
.month-daynum.today { background: var(--graphite); color: #fff; }
.month-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  padding: 2px 5px;
  margin-bottom: 2px;
  border-radius: 4px;
  background: var(--mint-soft);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-chip.booked { background: var(--graphite); color: #e5e7eb; font-weight: 500; }
.month-chip.readonly { cursor: default; }
.month-chip:not(.readonly):hover { filter: brightness(1.1); }
.month-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 1px 5px;
}
.month-more:hover { color: var(--graphite); }

.type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 6px;
}
.month-chip .type-dot { margin-right: 0; }

/* ---- Move section, travel warning ---- */

.move-toggle { margin-top: 16px; width: 100%; }
.travel-warning {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-btn);
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- Weekday picker (availability dialog) ---- */

.weekday-grid { display: flex; gap: 6px; }
.weekday-btn {
  flex: 1;
  padding: 9px 0;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-btn);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.weekday-btn:hover { border-color: var(--graphite); }
.weekday-btn.selected { background: var(--graphite); border-color: var(--graphite); color: #fff; }

/* ---- Stats ---- */

.stats-modal { max-width: 520px; }

/* ---- Customer link dialog ---- */

.link-result { display: flex; gap: 8px; margin-top: 16px; }
.link-result input { flex: 1; font-size: 13px; color: var(--muted); }
.link-result .btn { margin: 0; white-space: nowrap; }

.modal-actions-spacer { flex: 1; }
.stats-month { padding: 14px 0; border-bottom: 1px solid var(--border); }
.stats-month:last-child { border-bottom: none; }
.stats-month h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.stats-total { font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 6px; }
.stats-row { font-size: 13px; color: var(--text); margin-top: 4px; line-height: 1.6; }
.stats-label { color: var(--muted); font-weight: 600; }

.muted { color: var(--muted); text-align: center; margin-top: 48px; font-size: 15px; }
.error { color: var(--error); font-size: 14px; margin-top: 10px; }
.hidden { display: none !important; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 34, 34, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; }
.modal h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.modal .slot-info { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.modal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}

.jobtype-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jobtype-btn {
  padding: 13px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-btn);
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.jobtype-btn:hover { border-color: var(--graphite); }
.jobtype-btn.selected {
  border-color: var(--graphite);
  background: var(--graphite);
  color: #fff;
  font-weight: 600;
}

.time-row { display: flex; gap: 12px; }
.time-row > div { flex: 1; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--graphite);
  color: #fff;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
  border-left: 4px solid var(--mint);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 92vw;
}
.toast-action {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: none;
  color: var(--mint);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  white-space: nowrap;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 640px) {
  header { padding: 12px 12px; }
  .brand { gap: 8px; }
  .brand .logo { font-size: 16px; }
  .brand h1 { font-size: 12px; }
  .user-chip { padding: 4px 6px 4px 10px; font-size: 12px; }
  .header-right { gap: 8px; }
  .view { margin: 16px auto; }
  .time-row { flex-direction: column; gap: 0; }
  .toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .toolbar h2 { font-size: 21px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .cal-controls { flex-wrap: wrap; row-gap: 8px; }
  #week-label { font-size: 15px; }
  .filter-select { max-width: 44vw; }
  .month-cell { min-height: 72px; }
  .month-chip { font-size: 10px; }
  .cal-slot { font-size: 11px; padding: 3px 5px; }
  .btn { padding: 12px 20px; }

  /* iOS zooms into inputs below 16px — keep form controls at 16px on mobile */
  input, select { font-size: 16px; }

  /* Near-fullscreen dialogs on phones */
  .backdrop { padding: 0; align-items: flex-end; }
  .modal {
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    max-width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
  }
  .modal-actions { position: sticky; bottom: 0; background: var(--card); padding-top: 10px; }

  /* Smoother horizontal scroll in week view */
  .cal-scroll { -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
}

/* ---------- App-skal under indlæsning ----------
   Siden stod tom indtil /api/me svarede. Skallen tegnes med det samme, så der
   er struktur på skærmen fra første billede. Målene matcher det rigtige layout
   (248px sidebar, 1080px indhold), så intet hopper når data kommer. */

/* Skjult som udgangspunkt. Skallen vises KUN til gengangere der var logget ind
   sidst (boot-app sættes af et lille script i index.html). En gæst skal ikke se
   et app-skelet blive til en lille login-boks — det ville både være misvisende
   og flytte rundt på tingene. Ligger i NORMALT FLOW, så den lander præcis hvor
   det rigtige indhold kommer, inden for body.authed's padding-left: 248px. */
#boot-shell { display: none; background: var(--bg); }
#boot-shell.boot-app { display: block; }
#boot-shell.done { display: none !important; }

/* Sidebar-skelettet vises kun for gengangere (se boot-app) og kun på desktop,
   hvor sidebaren rent faktisk er fast. */
#boot-shell .boot-side { display: none; }

#boot-shell .boot-body {
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 16px;
}

#boot-shell .boot-bar,
#boot-shell .boot-card {
  background: linear-gradient(90deg, var(--border) 25%, #f3f4f6 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: boot-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
#boot-shell .boot-bar { height: 13px; margin-bottom: 12px; width: 100%; }
#boot-shell .boot-card {
  height: 190px;
  border-radius: var(--radius-card);
  margin-bottom: 14px;
}

@keyframes boot-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (min-width: 920px) {
  #boot-shell.boot-app .boot-side {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 248px;
    padding: 22px 18px;
    background: var(--card);
    border-right: 1px solid var(--border);
  }
  /* Ingen margin-left her: body.authed har allerede padding-left: 248px */
}

/* .view skifter til 16px margin her — skelettet skal følge med, ellers hopper
   indholdet 16px når det rigtige kommer */
@media (max-width: 640px) {
  #boot-shell .boot-body { margin: 16px auto; }
}

@media (prefers-reduced-motion: reduce) {
  #boot-shell .boot-bar,
  #boot-shell .boot-card { animation: none; }
}

/* ---------- Ansat-filter i månedsvisning ----------
   Erstatter dropdownen med klikbare navne, så man kan slå flere ansatte til og
   fra på én gang. Farven pr. ansat er den samme her som på indslagene i
   kalenderen (se ansatFarve() i app.js). */

.emp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.emp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; min-height: 34px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s, opacity .15s;
}
.emp-chip .emp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--emp, var(--accent)); flex: none;
}
.emp-chip:hover { border-color: var(--emp, var(--accent)); }
/* Aktiv = vises. Farven bæres af prikken, så teksten holder sin kontrast. */
.emp-chip:not(.off) { border-color: var(--emp, var(--accent)); background: var(--accent-soft); }
.emp-chip.off { opacity: .5; }
.emp-chip.off .emp-dot { background: var(--muted); }

@media (max-width: 640px) {
  .emp-chips { width: 100%; }
  /* Større tryk-mål på mobil — 34px er i underkanten for fingre */
  .emp-chip { font-size: 13px; padding: 8px 12px; min-height: 40px; }
}

/* Farvevælger pr. ansat (bruger-dialogen) */
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.color-swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  padding: 0; background-clip: padding-box;
}
.color-swatch.selected { border-color: var(--text); }
.color-swatch.auto {
  background: var(--card); display: inline-flex; align-items: center;
  justify-content: center; font-size: 15px; color: var(--muted); font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--border);
}
