/* ==========================================================================
   AutoFlow – designsystem
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e5eaf2;
  --line-strong: #d6dde9;

  --primary: #1f5aef;
  --primary-dark: #1846c2;
  --primary-soft: #eaf0ff;
  --green: #0f9f6e;
  --green-soft: #e6f7f0;
  --amber: #b4690e;
  --amber-soft: #fdf3e3;
  --red: #d13b42;
  --red-soft: #fdeced;
  --violet: #6d4aff;
  --violet-soft: #f0ecff;

  --sidebar: #0b1424;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px -18px rgba(15, 23, 42, .25);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 380px at 100% -10%, #eaf0ff 0%, rgba(234, 240, 255, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
svg { display: block; }

.sprite { display: none; }

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.text-danger { color: var(--red); }
.tone-green { color: var(--green); }
.link { color: var(--primary); font-weight: 550; }
.link:hover { text-decoration: underline; }
.rotate-180 { transform: rotate(180deg); }

/* ---------- App-skal ---------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 258px;
  padding: 22px 16px 16px;
  background:
    radial-gradient(420px 220px at 15% 0%, rgba(56, 116, 255, .22), transparent 70%),
    radial-gradient(320px 260px at 100% 100%, rgba(36, 214, 154, .10), transparent 70%),
    var(--sidebar);
  color: #b9c4d8;
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  color: #fff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #37d99b, #16a34a);
  color: #04140c;
  box-shadow: 0 8px 20px -8px rgba(22, 163, 74, .8);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; font-weight: 650; }
.brand-text small { font-size: 11px; color: #7f8ea8; text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #63718a;
  padding: 18px 12px 7px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #aab7cc;
  font-weight: 520;
  font-size: 14px;
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.nav-item .icon { width: 19px; height: 19px; color: #7d8da8; transition: color .16s ease; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item:hover .icon { color: #c7d3e6; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(47, 107, 255, .24), rgba(47, 107, 255, .08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(94, 142, 255, .22);
}
.nav-item.is-active .icon { color: #8db0ff; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4f83ff;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #dbe6ff;
  font-size: 11px;
  font-weight: 650;
  display: grid;
  place-items: center;
}

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; margin-top: 8px; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.user-chip form { margin-left: auto; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-meta strong { color: #e8eefb; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #74839c; font-size: 11px; }

.main { flex: 1; margin-left: 258px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 30px;
  background: rgba(244, 246, 251, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 234, 242, .8);
}

.menu-btn { display: none; }

.global-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 11px;
  color: var(--muted);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 90, 239, .12); }
.global-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  width: 100%;
  font-size: 13.5px;
}
.global-search kbd {
  font-family: inherit;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface-2);
  white-space: nowrap;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 26px 30px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }

/* ---------- Sidehoved --------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 6px;
}
.eyebrow a:hover { color: var(--primary); }

.page-title {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Knapper ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 580;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
  white-space: nowrap;
  line-height: 1.35;
}
.btn .icon { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #2a63f5, var(--primary));
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(31, 90, 239, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
  border-color: #1b4fd6;
}
.btn-primary:hover { background: linear-gradient(180deg, #2559e6, var(--primary-dark)); }

.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink-soft); box-shadow: 0 1px 1px rgba(15, 23, 42, .03); }
.btn-secondary:hover { border-color: #b9c4d8; background: #fbfcff; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(15, 23, 42, .045); color: var(--ink); }

.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f6c9cc; }
.btn-danger:hover { background: #fbdde0; }

.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }
.icon-btn-danger:hover { background: var(--red-soft); color: var(--red); }

.row-link {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.row-link:hover { background: var(--primary-soft); color: var(--primary); transform: translateX(2px); }
.row-link .icon { width: 16px; height: 16px; }

/* ---------- Kort -------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card + .card, .stack > * + * { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px 13px;
}
.card-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.012em; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); margin-top: 4px; }
.foot-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }

.stack { min-width: 0; }

/* ---------- Dashboard --------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  position: relative;
}
.kpi:hover { transform: translateY(-2px); border-color: #d5deee; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 18px 30px -22px rgba(15, 23, 42, .4); }

.kpi-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  flex: none;
}
.kpi-icon .icon { width: 19px; height: 19px; }
.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }

.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: 23px; font-weight: 680; letter-spacing: -.03em; line-height: 1.2; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12px; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.kpi-hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi-arrow { width: 15px; height: 15px; color: #c3cbdb; margin-left: auto; align-self: center; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.money-spot {
  margin: 0 20px 14px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f1d36, #1c2f52);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
}
.money-spot::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 131, 255, .45), transparent 65%);
}
.money-label { font-size: 11.5px; color: #a9b8d4; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.money-value { font-size: 25px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------- Lister og tabeller ----------------------------------------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 650;
  padding: 9px 14px;
  background: #fafbfe;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .right { text-align: right; }
.table .money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.cell-main { display: block; font-weight: 600; color: var(--ink); letter-spacing: -.005em; }
a.cell-main:hover { color: var(--primary); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.entity { display: flex; align-items: center; gap: 11px; min-width: 190px; }

.plate {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: #0f1c31;
  color: #f4f7ff;
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  white-space: nowrap;
  border: 1px solid #26374f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.plate-lg { font-size: 12.5px; padding: 4px 9px; }
.plate-hero { font-size: 17px; padding: 8px 13px; border-radius: 8px; letter-spacing: .08em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .005em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill-lg { font-size: 12.5px; padding: 5px 11px; }
.pill-success { background: var(--green-soft); color: #0a7d56; border-color: #c6ebdd; }
.pill-info { background: var(--primary-soft); color: #1a4bc4; border-color: #d3dfff; }
.pill-warning { background: var(--amber-soft); color: #9a5a0a; border-color: #f4dfbb; }
.pill-danger { background: var(--red-soft); color: #b32f36; border-color: #f6cdd0; }
.pill-violet { background: var(--violet-soft); color: #5b3ce0; border-color: #ded5ff; }
.pill-muted { background: #f1f4f9; color: #5b6b82; border-color: #e3e9f2; }

/* ---------- Værktøjslinje, tabs, søgning -------------------------------- */

.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar-stack { flex-direction: column; align-items: stretch; gap: 12px; }
.toolbar-count { margin-left: auto; font-size: 12px; color: var(--muted); }

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--muted);
  max-width: 460px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 90, 239, .12); }
.search-field input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); width: 100%; }
.search-field-lg { max-width: none; padding: 12px 14px; }
.card > .search-field-lg { margin: 18px 20px; width: calc(100% - 40px); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.is-active { background: var(--primary-soft); color: var(--primary); border-color: #d8e3ff; }
.tab-count { font-size: 10.5px; background: rgba(15, 23, 42, .07); border-radius: 999px; padding: 1px 6px; color: var(--muted); font-weight: 650; }
.tab.is-active .tab-count { background: #fff; color: var(--primary); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.page-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; color: var(--ink-soft); background: var(--surface); }
.page-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.page-btn.is-disabled { opacity: .42; pointer-events: none; }
.page-btn .icon { width: 14px; height: 14px; }
.page-btn:first-child .icon { transform: rotate(180deg); }
.page-info { font-size: 12px; color: var(--muted); }

/* ---------- Tomme tilstande -------------------------------------------- */

.empty { padding: 38px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty-sm { padding: 22px 20px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: #94a3b8; margin-bottom: 8px; border: 1px solid var(--line); }
.empty-title { font-weight: 620; font-size: 14px; }
.empty-text { font-size: 12.5px; color: var(--muted); max-width: 340px; margin-bottom: 8px; }

/* ---------- Formularer -------------------------------------------------- */

.form-layout { max-width: 780px; }
.form-layout-wide { max-width: 980px; }
.form-card { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.form-grid > .field:last-child:nth-child(odd) { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.req { color: var(--red); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 90, 239, .12); }
.textarea { resize: vertical; min-height: 76px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.help { font-size: 11.5px; color: var(--muted); }
.errorlist { list-style: none; padding: 0; margin: 0; color: var(--red); font-size: 11.5px; font-weight: 550; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: #e5868b; background: #fffafa; }

.field-radio { grid-column: 1 / -1; }
.radio-choice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-choice > div > div { display: flex; }
.radio-choice label { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink-soft); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.radio-choice label:hover { border-color: #c7d3e6; }
.radio-choice input { margin: 0; accent-color: var(--primary); }
.radio-choice label:has(input:checked) { border-color: #b9ceff; background: var(--primary-soft); color: #1a4bc4; }

.check-field { display: flex; align-items: flex-start; gap: 9px; grid-column: 1 / -1; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.check-field .checkbox { width: 16px; height: 16px; accent-color: var(--primary); margin-top: 2px; }
.check-field strong { display: block; font-size: 13px; font-weight: 600; }
.check-field small { display: block; font-size: 11.5px; color: var(--muted); }

.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }

.line-form {
  display: grid;
  grid-template-columns: 178px 92px minmax(0, 1fr) 66px 100px 78px auto;
  gap: 9px;
  align-items: end;
  padding: 15px 20px 18px;
  background: #fbfcff;
  border-top: 1px solid var(--line);
}
.field-sm .field-label { font-size: 11px; }
.field-sm .input, .field-sm .select { padding: 8px 9px; font-size: 12.5px; }
.line-kind .select { padding-left: 7px; padding-right: 22px; font-size: 12px; background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; }
.line-desc .input { padding: 8px 11px; font-size: 13px; }
.line-form .is-filled { border-color: #cfe4d5; background: #f6fbf7; }
.line-form-btn { height: 37px; white-space: nowrap; }
.line-form-actions { display: flex; align-items: center; gap: 6px; }

/* Redigering af en linje direkte i tabellen */
.line-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.line-edit-row > td { padding: 0 !important; background: #f4f8ff; }
.line-edit-row .line-form { border-top: 1px solid #dbe6fb; background: #f4f8ff; }
.totals-discount span:last-child { color: var(--green); font-weight: 620; }

/* Kunde- og bilvælger på arbejdskort, tilbud og fakturaer */
.party { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.party-block { display: flex; flex-direction: column; gap: 11px; padding: 14px 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcff; }
.party-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.party-title { margin: 0; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.party-choice > div { display: flex; flex-wrap: wrap; gap: 4px; }
.party-choice > div > div { display: flex; }
.party-choice label { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 550; color: var(--ink-soft); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.party-choice label:hover { border-color: #c7d3e6; }
.party-choice input { margin: 0; accent-color: var(--primary); }
.party-choice label:has(input:checked) { border-color: #c3d3fb; background: var(--primary-soft); color: #1a4bc4; }
.party-choice .errorlist { margin-top: 4px; }
.party-pane { display: flex; flex-direction: column; gap: 9px; }
.party-pane[hidden] { display: none; }
.party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.party-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.party .alert { margin: 0; }

@media (max-width: 760px) {
  .party { grid-template-columns: 1fr; }
  .party-grid { grid-template-columns: 1fr; }
}

.danger-card { border-color: #f3d6d8; background: #fffdfd; }
.danger-card h3 { font-size: 14px; margin: 16px 20px 4px; color: #a72b32; }
.danger-card p { font-size: 12.5px; color: var(--muted); margin: 0 20px 13px; }
.danger-card .btn { margin: 0 20px 18px; }

.alert { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 14px; border: 1px solid; }
.alert-error { background: var(--red-soft); color: #a72b32; border-color: #f4ccce; }
.alert-info { background: var(--primary-soft); color: #24479b; border-color: #d3dfff; }
.alert-info code, .alert code { background: rgba(255, 255, 255, .75); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.alert .icon { width: 16px; height: 16px; }

.attach-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 12px; border: 1px dashed #cfd9ea; border-radius: 10px; background: #fbfcff; font-size: 12.5px; color: var(--muted); }
.attach-note strong { color: var(--ink-soft); }
.attach-note .icon { width: 16px; height: 16px; }

.notes-text { padding: 0 20px 18px; color: var(--ink-soft); font-size: 13.5px; white-space: pre-line; }

/* ---------- Detaljesider ------------------------------------------------ */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 20px 20px; }
.meta { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.meta-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.meta-value { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }

.totals { margin-left: auto; padding: 14px 20px 4px; max-width: 340px; }
.totals-row { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.totals-grand { border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 9px; color: var(--ink); font-weight: 680; font-size: 15.5px; }

.stat-rows { padding: 2px 20px 16px; display: flex; flex-direction: column; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #edf1f7; font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); }
.stat-row strong { font-variant-numeric: tabular-nums; font-weight: 620; }

.timeline { padding: 4px 20px 18px; display: flex; flex-direction: column; gap: 2px; }
.timeline li { display: flex; gap: 11px; padding: 7px 0; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 18px; bottom: -6px; width: 1.5px; background: var(--line); }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; margin-top: 5px; flex: none; box-shadow: 0 0 0 3px #f1f4fa; }
.timeline-dot.is-done { background: var(--green); box-shadow: 0 0 0 3px #e8f7f1; }
.timeline div { display: flex; flex-direction: column; line-height: 1.35; }
.timeline strong { font-size: 12.5px; font-weight: 600; }
.timeline small { font-size: 11.5px; color: var(--muted); }

.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 2px 20px 18px; }
.status-actions form { margin: 0; }
.status-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.status-btn:hover { border-color: #c7d3e6; background: var(--surface-2); }
.status-btn.is-current { background: var(--primary-soft); border-color: #cfdcff; color: var(--primary); font-weight: 650; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex: none; }
.status-draft { background: #94a3b8; }
.status-planned, .status-sent { background: #3b82f6; }
.status-in_progress { background: #f59e0b; }
.status-waiting { background: #ef4444; }
.status-done, .status-paid, .status-accepted { background: var(--green); }
.status-cancelled, .status-rejected, .status-credited { background: #94a3b8; }

.contact-list { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.contact-row { display: flex; gap: 11px; align-items: flex-start; }
.contact-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.contact-icon .icon { width: 15px; height: 15px; }
.contact-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.contact-value { display: block; font-size: 13px; font-weight: 550; color: var(--ink-soft); margin-top: 1px; }
a.contact-value:hover { color: var(--primary); }

.owner-card { display: flex; align-items: center; gap: 12px; padding: 4px 20px 16px; }
.owner-name { font-weight: 650; font-size: 14px; display: block; }
a.owner-name:hover { color: var(--primary); }
.owner-meta { display: block; font-size: 12px; color: var(--muted); }

.vehicle-summary { display: flex; align-items: center; gap: 12px; padding: 4px 20px 14px; }

.vehicle-list { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.vehicle-list li a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); transition: border-color .15s ease, background .15s ease; }
.vehicle-list li a:hover { border-color: #cfd9e8; background: #fff; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-main strong { font-size: 13.5px; font-weight: 600; }
.row-main small { font-size: 11.5px; color: var(--muted); }
.row-arrow { width: 15px; height: 15px; color: #b6c1d4; }

.simple-list { display: flex; flex-direction: column; }
.simple-list li + li { border-top: 1px solid #eef2f8; }
.simple-list a { display: flex; align-items: center; gap: 11px; padding: 10px 20px; transition: background .14s ease; }
.simple-list a:hover { background: #fafcff; }
.row-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.row-avatar .icon { width: 16px; height: 16px; }
.row-amount { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8efff, #dbe6ff);
  color: #2447a8;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
  border: 1px solid #d3e0ff;
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; background: rgba(255, 255, 255, .1); color: #dbe6ff; border-color: rgba(255, 255, 255, .14); }
.avatar-lg { width: 46px; height: 46px; font-size: 14px; }
.avatar-xl { width: 54px; height: 54px; font-size: 16px; }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.spec { background: var(--surface); padding: 13px 16px; }
.spec-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.spec-value { display: block; font-size: 14px; font-weight: 620; margin-top: 3px; letter-spacing: -.01em; }

.summary-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; }
.summary-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.summary-value { font-size: 20px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary-divider { width: 1px; height: 34px; background: var(--line); }
.summary-hint { margin-left: auto; font-size: 12px; color: var(--muted); max-width: 330px; }

/* ---------- Agenda ------------------------------------------------------ */

.agenda { padding: 2px 20px 14px; display: flex; flex-direction: column; }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef2f8; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-time { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-soft); width: 40px; flex: none; }
.agenda-date { font-size: 11.5px; font-weight: 650; color: var(--primary); width: 58px; flex: none; text-transform: uppercase; letter-spacing: .04em; }
.agenda-line { width: 3px; height: 26px; border-radius: 2px; background: #dbe4f3; flex: none; }
.agenda-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.agenda-title { font-size: 13.5px; font-weight: 600; }
.agenda-title:hover { color: var(--primary); }
.agenda-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-compact { padding-left: 0; padding-right: 0; padding-bottom: 6px; }
.agenda-compact .agenda-item { padding: 7px 20px; }

.mini-appointment { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 12.5px; }
.mini-date { color: var(--primary); font-weight: 650; width: 52px; flex: none; }
.mini-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Kalender ---------------------------------------------------- */

.calendar-card { margin-bottom: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-month { font-size: 17px; font-weight: 650; letter-spacing: -.02em; min-width: 200px; text-align: center; }
.calendar-nav .icon-btn { border: 1px solid var(--line); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays { border-bottom: 1px solid var(--line); background: #fafbfe; }
.cal-weekday { padding: 8px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.cal-weeks { background: var(--line); gap: 1px; }
.cal-day { background: var(--surface); min-height: 104px; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.cal-day.is-outside { background: #fbfcfe; }
.cal-day.is-outside .cal-daynum { color: #b6c1d4; }
.cal-day.is-today { background: #f7faff; box-shadow: inset 0 0 0 1.5px #b9ceff; }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-daynum { font-size: 12px; font-weight: 650; color: var(--ink-soft); width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-daynum { background: var(--primary); color: #fff; }
.cal-add { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s ease, background .15s ease; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--primary-soft); color: var(--primary); }
.cal-appointments { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 550; border-left: 2.5px solid; background: var(--primary-soft); color: #1d47ad; overflow: hidden; }
.cal-chip-time { font-variant-numeric: tabular-nums; opacity: .8; flex: none; }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip-info { background: var(--primary-soft); border-color: #4a7dff; color: #1d47ad; }
.cal-chip-success { background: var(--green-soft); border-color: var(--green); color: #0a7d56; }
.cal-chip-muted { background: #f1f4f9; border-color: #9aa8bc; color: #5b6b82; text-decoration: line-through; }
.cal-chip-note { background: #fdf7e3; border-color: #e0a92a; color: #7a5203; }
.cal-chip-note.cal-chip-muted { background: #f7f4ea; border-color: #c9b27a; color: #857a5c; }
.cal-wide-link { color: var(--primary); font-weight: 620; }
.cal-wide-link:hover { text-decoration: underline; }
.cal-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
.cal-chip-who { display: inline-block; flex: none; font-size: 9px; font-weight: 750; letter-spacing: .04em; padding: 0 3px; border-radius: 4px; background: rgba(255, 255, 255, .7); text-decoration: none; }

.cal-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); background: #fbfcff; }
.cal-filter-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.cal-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; transition: border-color .14s ease, color .14s ease, background .14s ease; }
.cal-filter-chip:hover { border-color: #b9ceff; color: var(--primary); }
.cal-filter-chip.is-active { background: var(--primary-soft); border-color: #b3c8ff; color: #1d47ad; }
.cal-filter-ini { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: #eef2f9; color: var(--ink-soft); font-size: 9.5px; font-weight: 750; letter-spacing: .04em; }
.cal-filter-chip.is-active .cal-filter-ini { background: #fff; color: var(--primary); }
.cal-filter-hint { margin-left: auto; font-size: 11px; color: var(--muted); }
.cal-filter-hint a { color: var(--primary); font-weight: 600; }

.calendar-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-toggle { display: flex; gap: 2px; padding: 3px; background: #f1f4fa; border-radius: 9px; }
.cal-toggle a { padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cal-toggle a:hover { color: var(--ink); }
.cal-toggle a.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.cal-days { grid-template-columns: repeat(var(--cal-cols, 7), minmax(0, 1fr)); background: var(--line); gap: 1px; }
.cal-day-wide { min-height: 210px; gap: 8px; }
.cal-wide-weekday { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; }
.cal-wide-date { display: block; font-size: 15px; font-weight: 650; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cal-day-wide.is-today .cal-wide-date { color: var(--primary); }
.cal-day-wide .cal-appointments { gap: 5px; }
.cal-wide-sub { font-size: 10.5px; color: var(--muted); padding: 0 2px 2px 6px; border-left: 2px solid #eef1f6; margin-left: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-empty { font-size: 10.5px; color: #aab5c6; padding: 2px; }

/* ---------- Kalender: tidsgitter med en kolonne pr. mekaniker ---------- */

.cal-res { overflow-x: auto; --hour-h: 54px; }
.cal-res-head, .cal-res-body { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.cal-res-gutter, .cal-res-hours { flex: 0 0 54px; }
.cal-res-daygroup { display: flex; flex: 1 1 0; min-width: 0; }
.cal-res-daygroup-head { flex-direction: column; }
.cal-res-daylabel { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #f7f9fd; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 11.5px; font-weight: 650; color: var(--ink-soft); white-space: nowrap; }
.cal-res-weekday { text-transform: uppercase; letter-spacing: .07em; font-size: 9.5px; color: var(--muted); font-weight: 700; }
.cal-res-date { font-variant-numeric: tabular-nums; }
.cal-res-daygroup-head.is-today .cal-res-date { color: var(--primary); }
.cal-res-daylabel .cal-add { margin-left: auto; opacity: 1; }
.cal-res-mechs { display: flex; background: #fbfcff; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-res-mechhead { flex: 1 1 0; min-width: 84px; padding: 5px 3px; text-align: center; border-left: 1px solid var(--line); }
.cal-res-mechhead:first-child { border-left: 0; }
.cal-res-ini { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--primary-soft); color: #1d47ad; font-size: 9.5px; font-weight: 750; letter-spacing: .04em; }
.cal-res-ini-none { background: #eef1f6; color: #8b98ab; }
.cal-res-hours { display: flex; flex-direction: column; }
.cal-res-hour { height: var(--hour-h); position: relative; }
.cal-res-hour span { position: absolute; top: -6px; right: 8px; padding: 0 2px; background: var(--surface); font-size: 10px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-res-hour:first-child span { top: 2px; }
.cal-res-col { flex: 1 1 0; min-width: 84px; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, #edf1f8 0, #edf1f8 1px, transparent 1px, transparent var(--hour-h)); }
.cal-res-col.is-drop-target { background-color: #f3f8ff; box-shadow: inset 0 0 0 1.5px #b9ceff; }
.cal-res-rail { position: relative; height: calc(var(--hours, 10) * var(--hour-h)); }
.cal-event { position: absolute; top: var(--top); left: calc(var(--left) + 2px); width: calc(var(--width) - 4px); height: var(--height); min-height: 19px; box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 2px 5px; border-radius: 6px; border-left: 3px solid #4a7dff; background: var(--primary-soft); color: #1d47ad; font-size: 10.5px; font-weight: 560; line-height: 1.25; cursor: grab; touch-action: none; user-select: none; transition: box-shadow .12s ease; }
.cal-event:hover { box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .4); z-index: 20; }
.cal-event-note { background: #fdf7e3; border-color: #e0a92a; color: #7a5203; }
.cal-event-success { background: var(--green-soft); border-color: var(--green); color: #0a7d56; }
.cal-event-muted { background: #f1f4f9; border-color: #9aa8bc; color: #5b6b82; }
.cal-event-muted .cal-event-title { text-decoration: line-through; }
.cal-event-time { font-size: 9.5px; letter-spacing: .01em; opacity: .85; font-variant-numeric: tabular-nums; }
.cal-event-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-wo { font-size: 9px; font-weight: 700; opacity: .8; }
.cal-event-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500; opacity: .9; }
.cal-event-label { font-size: 8.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.cal-event-line-plate { font-variant-numeric: tabular-nums; letter-spacing: .03em; font-weight: 650; }
.cal-event-line-notes, .cal-event-line-invoice { font-style: italic; }
.cal-event-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.cal-event-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; border-radius: 2px; background: currentColor; opacity: .3; transform: translateX(-50%); }
.cal-event.is-dragging { z-index: 60; pointer-events: none; cursor: grabbing; opacity: .96; box-shadow: 0 16px 30px -12px rgba(15, 23, 42, .55); }
.cal-event.is-pressed { box-shadow: 0 3px 10px -4px rgba(15, 23, 42, .4); }
body.is-dragging { cursor: grabbing; }
.cal-selection { position: absolute; top: var(--top); left: 2px; right: 2px; height: var(--height); min-height: 14px; z-index: 30; box-sizing: border-box; border-radius: 6px; border: 1.5px dashed #2f6bff; background: rgba(74, 125, 255, .16); pointer-events: none; }
body.is-creating, body.is-creating * { cursor: crosshair; user-select: none; }
.cal-drag-tip { position: fixed; z-index: 90; pointer-events: none; padding: 4px 9px; border-radius: 8px; background: #101c2f; color: #eef4ff; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 10px 25px -12px rgba(0, 0, 0, .7); transform: translate(-50%, -150%); }
.cal-res-hint { padding: 9px 16px; border-top: 1px solid var(--line); background: #fbfcff; font-size: 11px; color: var(--muted); }

/* ---------- Login ------------------------------------------------------- */

.login-body { background: #0b1424; }

.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

.login-brand {
  position: relative;
  padding: 44px 52px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 30px;
  background:
    radial-gradient(700px 420px at 10% 0%, rgba(56, 116, 255, .3), transparent 65%),
    radial-gradient(520px 400px at 90% 100%, rgba(36, 214, 154, .16), transparent 65%),
    linear-gradient(160deg, #0a1322, #0e1b30 60%, #0a1424);
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(600px 400px at 70% 30%, #000, transparent 75%);
  pointer-events: none;
}

.login-brand-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-mark-lg { width: 44px; height: 44px; border-radius: 13px; }
.brand-mark-lg svg { width: 24px; height: 24px; }
.login-brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }

.login-brand-copy { position: relative; z-index: 1; max-width: 540px; }
.login-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: #82a1d6; font-weight: 650; margin-bottom: 14px; }
.login-brand-copy h1 { font-size: clamp(27px, 3vw, 39px); line-height: 1.14; letter-spacing: -.035em; font-weight: 680; }
.login-lead { color: #9fb0cc; font-size: 14px; line-height: 1.65; margin-top: 16px; max-width: 470px; }

.login-points { margin-top: 24px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: #c3d0e6; }
.login-points li { display: flex; align-items: center; gap: 9px; }
.tick { width: 20px; height: 20px; border-radius: 50%; background: rgba(38, 210, 150, .14); color: #3ce0a4; display: grid; place-items: center; font-size: 11px; flex: none; }

.login-mock {
  position: relative;
  z-index: 1;
  margin-top: auto;
  width: min(430px, 100%);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  padding: 14px 16px;
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, .8);
}
.mock-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 6px; }
.mock-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ce0a4; }
.mock-title { font-size: 11.5px; color: #b9c8e2; font-weight: 600; letter-spacing: .02em; }
.mock-head .pill { margin-left: auto; background: rgba(245, 158, 11, .14); color: #f7c266; border-color: rgba(245, 158, 11, .25); }
.mock-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 12px; color: #a9b8d2; font-variant-numeric: tabular-nums; }
.mock-total { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 4px; padding-top: 9px; color: #fff; font-weight: 650; }

.login-brand-foot { position: relative; z-index: 1; font-size: 11.5px; color: #61728d; }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-box { width: min(390px, 100%); }
.login-title { font-size: 27px; font-weight: 680; letter-spacing: -.03em; margin-top: 2px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; margin-bottom: 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { margin-top: 6px; padding: 11px; }
.login-demo { margin-top: 18px; background: var(--primary-soft); border: 1px dashed #c3d4ff; color: #2a4a9b; border-radius: 10px; padding: 9px 11px; font-size: 11.5px; }
.login-demo code { background: rgba(255, 255, 255, .7); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.login-help { margin-top: 16px; font-size: 11.5px; color: var(--muted); text-align: center; }
.login-download { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.login-download:hover { border-color: #b9c4d8; background: #fbfcff; color: var(--primary); }
.login-download .icon { width: 15px; height: 15px; }

/* ---------- Toasts ------------------------------------------------------ */

.toasts { position: fixed; top: 18px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #101c2f;
  color: #eef4ff;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 12.5px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6);
  animation: toast-in .25s ease;
  border: 1px solid rgba(255, 255, 255, .08);
}
.toast .icon { color: #7fe3b8; }
.toast-error .icon { color: #ff9ea3; }
.toast-close { margin-left: auto; background: none; border: 0; color: #93a4bf; font-size: 16px; cursor: pointer; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Bekræft sletning ------------------------------------------- */

.confirm-card { max-width: 520px; margin: 40px auto; padding: 34px 30px; text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--red-soft); color: var(--red); margin: 0 auto 14px; }
.confirm-icon .icon { width: 24px; height: 24px; }
.confirm-card h2 { font-size: 20px; font-weight: 660; letter-spacing: -.02em; }
.confirm-object { margin-top: 10px; font-weight: 600; }
.confirm-warning { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Faktura til print ------------------------------------------ */

.print-body { background: #eef1f6; padding: 26px 16px 50px; }
.print-toolbar { max-width: 820px; margin: 0 auto 16px; display: flex; justify-content: space-between; gap: 10px; }

.sheet {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 6px;
  padding: 48px 52px 36px;
  box-shadow: 0 20px 50px -30px rgba(15, 23, 42, .5);
  border: 1px solid #e2e8f0;
  color: #14203a;
  font-size: 12.5px;
}

.sheet-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 2px solid #14203a; }
.sheet-brand { display: flex; gap: 12px; }
.sheet-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.sheet-brand .brand-mark svg { width: 21px; height: 21px; }
.sheet-brand div { display: flex; flex-direction: column; gap: 1px; }
.sheet-brand strong { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.sheet-brand span { color: #64748b; font-size: 11.5px; }
.sheet-title { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sheet-doc { font-size: 10px; letter-spacing: .2em; color: #64748b; font-weight: 700; }
.sheet-title strong { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }

.sheet-meta { display: flex; justify-content: space-between; gap: 30px; padding: 26px 0 24px; }
.sheet-block { display: flex; flex-direction: column; gap: 1px; }
.sheet-block strong { font-size: 13.5px; font-weight: 650; margin-top: 3px; }
.sheet-label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #8494ab; font-weight: 700; }
.sheet-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; text-align: right; }
.sheet-facts div { display: flex; flex-direction: column; gap: 1px; }
.sheet-facts strong { font-size: 12.5px; font-weight: 650; }

.sheet-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sheet-table th { font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: #8494ab; text-align: left; padding: 8px 0; border-bottom: 1px solid #cbd5e1; font-weight: 700; }
.sheet-table td { padding: 10px 0; border-bottom: 1px solid #eef2f8; vertical-align: top; }
.sheet-table .right { text-align: right; }
.sheet-table td strong { display: block; font-weight: 600; }
.sheet-line-type { font-size: 10px; color: #8494ab; }

.sheet-totals { margin-left: auto; width: 260px; padding-top: 14px; }
.sheet-total-row { display: flex; justify-content: space-between; gap: 20px; padding: 4px 0; color: #4b5c74; font-variant-numeric: tabular-nums; }
.sheet-grand { border-top: 1.5px solid #14203a; margin-top: 6px; padding-top: 9px; color: #14203a; font-weight: 700; font-size: 14.5px; }

.sheet-notes { padding: 20px 0 0; color: #4b5c74; }
.sheet-notes p { margin-top: 3px; }

.sheet-payment { margin-top: 28px; padding: 16px 18px; background: #f6f8fc; border: 1px solid #e4eaf3; border-radius: 8px; display: flex; justify-content: space-between; gap: 24px; }
.sheet-payment div { display: flex; flex-direction: column; gap: 2px; }
.sheet-payment strong { font-size: 12.5px; }
.sheet-due { text-align: right; }
.sheet-due strong { font-size: 17px; font-weight: 700; }

.sheet-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 12px; border-top: 1px solid #e4eaf3; color: #8494ab; font-size: 10.5px; }

/* ---------- Responsivt -------------------------------------------------- */

.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .spec-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .sidebar-scrim.is-open { display: block; position: fixed; inset: 0; background: rgba(9, 16, 29, .5); z-index: 35; }
  .topbar { padding: 11px 18px; }
  .content { padding: 20px 18px 50px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 760px) {
  .page-head { align-items: flex-start; }
  .page-title { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .line-form { grid-template-columns: 1fr 1fr; }
  .line-form .line-product { grid-column: 1 / -1; }
  .line-form .line-desc { grid-column: 1 / -1; }
  .line-form-actions { grid-column: 1 / -1; }
  .line-form-btn { grid-column: 1 / -1; flex: 1; justify-content: center; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .spec-strip { grid-template-columns: 1fr 1fr; }
  .summary-hint { margin-left: 0; }
  .cal-day { min-height: 84px; padding: 5px; }
  .cal-chip-title { display: none; }
  .cal-day-wide .cal-chip-title { display: inline; }
  .cal-days { grid-template-columns: repeat(var(--cal-cols, 7), minmax(150px, 1fr)); overflow-x: auto; }
  .cal-chip { padding: 2px 4px; }
  .table th, .table td { padding-left: 12px !important; padding-right: 12px !important; }
  .toasts { left: 14px; right: 14px; max-width: none; }
  .sheet { padding: 30px 22px; }
  .sheet-head, .sheet-meta, .sheet-payment { flex-direction: column; }
  .sheet-facts, .sheet-due { text-align: left; }
  .sheet-totals { width: 100%; }
  .print-toolbar { flex-direction: column; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .global-search kbd { display: none; }
  .topbar-actions .btn span { display: none; }
  .calendar-month { min-width: 0; font-size: 15px; }
  .cal-toggle { flex-wrap: wrap; }
  .cal-toggle a { padding: 5px 8px; font-size: 11px; }
  .cal-weekday { font-size: 9px; padding: 6px 4px; }
  .cal-filter { padding: 8px 12px; gap: 6px; }
  .cal-filter-chip { padding: 3px 8px; font-size: 11px; }
  .cal-filter-hint { width: 100%; margin-left: 0; }
}

@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; padding: 0; }
  .sheet { max-width: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  @page { margin: 16mm; }
}
