/* Sindleva portal – stilark for udlån, vagtplan, HR og administration. Ingen eksterne skrifttyper eller CDN'er. */

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b2220;
  --ink-2: #3a4542;
  --muted: #66716d;
  --line: #e2e0d8;
  --line-strong: #c9ccc6;
  --accent: #1a47b8;
  --accent-hover: #153a96;
  --accent-soft: #e6ecfa;
  --accent-ink: #ffffff;
  --danger: #a8321f;
  --danger-soft: #fbeae6;
  --warn: #8a5300;
  --warn-soft: #fcf0d9;
  --info-soft: #e8eef6;
  --info: #24477a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 34, 32, .05), 0 2px 8px rgba(27, 34, 32, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3, .h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Topbjælke ---------- */

.env-banner {
  background: repeating-linear-gradient(-45deg, #f6c445, #f6c445 12px, #f2b92b 12px, #f2b92b 24px);
  color: #3d2a00;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: .3rem 1rem;
}
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: .55rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.topbar-inner.is-wide, .mainnav.is-wide { max-width: 1680px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand img { height: 22px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.brand-app {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .15rem .55rem;
}
.modnav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.modnav::-webkit-scrollbar { display: none; }
.modnav a {
  color: var(--ink-2); text-decoration: none; padding: .4rem .75rem; border-radius: 999px; font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.modnav a:hover { background: var(--surface-2); color: var(--ink); }
.modnav a.is-active { background: var(--ink); color: #fff; }
.subbar { border-top: 1px solid var(--line); background: var(--surface-2); }
.mainnav { display: flex; gap: .25rem; max-width: 1200px; margin: 0 auto; padding: .3rem 1rem; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a, .usermenu-name {
  color: var(--ink-2); text-decoration: none; padding: .4rem .7rem; border-radius: var(--radius-sm);
  font-size: .93rem; white-space: nowrap;
}
.mainnav a:hover, .usermenu-name:hover { background: var(--surface); color: var(--ink); }
.mainnav a.is-active, .usermenu-name.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.usermenu { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.usermenu form { margin: 0; }
.linklike {
  background: none; border: 0; padding: .45rem .5rem; color: var(--muted); font: inherit; font-size: .95rem;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.linklike:hover { color: var(--ink); }
.linklike.small { font-size: .82rem; padding: .2rem 0; }

@media (max-width: 720px) {
  .topbar-inner { gap: .4rem .75rem; }
  .modnav { order: 3; flex-basis: 100%; margin: 0 -.25rem; }
  .usermenu-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
  .brand img { height: 18px; }
}

/* ---------- Layout ---------- */

.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.container.is-wide { max-width: 1680px; }
.plain-wrap { max-width: 720px; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
.plain-brand { display: flex; align-items: center; gap: .55rem; justify-content: center; margin-bottom: 1.75rem; }
.plain-brand img { height: 30px; width: auto; display: block; }
.login-card { max-width: 420px; margin: 0 auto; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 560px; }
.card-danger { border-color: #efc9c1; }
.table-card { padding: 0; overflow-x: auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.page-head h1 { margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-head > p { flex-basis: 100%; margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-block; font-size: .9rem; text-decoration: none; margin-bottom: .25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.section-head h2 { margin: 0; }

/* ---------- Beskeder ---------- */

.flash {
  border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem;
  background: var(--info-soft); color: var(--info); border: 1px solid #cfdbec;
}
.flash ul { margin: 0; padding-left: 1.2rem; }
.flash-success { background: var(--accent-soft); color: var(--accent-hover); border-color: #c7d4f2; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #efc9c1; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dbb2; }
.flash-secret { background: #fff8e6; color: #4d3800; border-color: #f0dbb2; font-family: var(--mono); font-size: .92rem; }
.flash-secret .btn { font-family: var(--font); margin-top: .5rem; }
p.flash { margin: 0 0 .75rem; padding: .5rem .75rem; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.2;
  padding: .6rem 1rem; min-height: 42px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); border-color: #b6bab3; color: var(--ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .photo-box:focus-visible {
  outline: 3px solid rgba(26, 71, 184, .35); outline-offset: 1px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { background: var(--surface); border-color: #e3b1a6; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: .35rem .7rem; font-size: .875rem; }
.btn-lg { min-height: 50px; padding: .8rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-add { width: 100%; border-style: dashed; color: var(--accent); }

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

.form label, .loan-form label, .settings-form label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: .85rem; min-width: 0; }
.form label > input:not([type=checkbox]):not([type=radio]), .form label > select, .form label > textarea,
.loan-form label > input:not([type=checkbox]):not([type=radio]), .loan-form label > select, .loan-form label > textarea,
.settings-form label > input:not([type=checkbox]):not([type=radio]), .settings-form label > select, .settings-form label > textarea { display: block; margin-top: .3rem; }
.form label > .hint, .loan-form label > .hint, .settings-form label > .hint { display: block; margin-top: .3rem; }
.form label > .muted { font-weight: 400; }
input { min-width: 0; }
input, select, textarea {
  font: inherit; font-size: 16px; /* undgår zoom på iOS */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .6rem .7rem; min-height: 44px; width: 100%;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
input[type=file] { padding: .45rem; font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1rem .25rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.grid-2.tight { gap: 0 .6rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
label.check, .check {
  display: flex !important; flex-direction: row !important; align-items: center; gap: .6rem !important;
  font-weight: 500 !important; color: var(--ink) !important; cursor: pointer;
}
.hint { font-weight: 400; color: var(--muted); }
.field-static { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field-static .label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.field-static > span:last-child { min-height: 44px; display: flex; align-items: center; padding: 0 .1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.input-group { display: flex; gap: .4rem; }
.input-group input { flex: 1; min-width: 0; }
.input-group .btn { flex: none; padding-left: .75rem; padding-right: .75rem; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.checklist li { display: flex; gap: .55rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.check-mark { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex: none; }
.checklist .ok .check-mark { background: var(--accent-soft); color: var(--accent); }
.checklist .bad .check-mark { background: var(--danger-soft); color: var(--danger); }
.checklist .warn .check-mark { background: var(--warn-soft); color: var(--warn); }

/* ---------- Liste over udlån ---------- */

.tabs { display: flex; gap: .3rem; margin-bottom: .75rem; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .5rem .85rem; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface); font-size: .92rem; font-weight: 600;
}
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab .count { font-size: .78rem; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: .05rem .45rem; font-variant-numeric: tabular-nums; }
.tab.is-active .count { background: rgba(255, 255, 255, .18); color: #fff; }
.tab.tab-alert .count { background: var(--danger); color: #fff; }

.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.searchbar input { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2); padding: .65rem .9rem; border-bottom: 1px solid var(--line);
}
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: #fbfaf7; }
.rowlink a { text-decoration: none; color: var(--ink); }
tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.is-inactive td { color: var(--muted); }
tr.is-warn td { background: #fffaf0; }
.row-actions { text-align: right; }

@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { border: 0; padding: .15rem 0; display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; text-align: left; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; padding-top: .1rem; }
  .table.responsive td > * { grid-column: 2; justify-self: start; }
  .table.responsive td.row-actions { display: block; padding-top: .5rem; text-align: left; }
  .table.responsive td.row-actions::before { content: none; }
  tr.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
  tr.is-overdue td:first-child { box-shadow: none; }
}

.badge {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; padding: .15rem .6rem; vertical-align: middle; white-space: nowrap;
}
h1 .badge { font-size: .8rem; }
.badge-active { background: var(--accent-soft); color: var(--accent); }
.badge-overdue { background: var(--danger); color: #fff; }
.badge-returned { background: #ecebe6; color: var(--ink-2); }
.badge-muted { background: #ecebe6; color: var(--muted); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ---------- Nyt udlån ---------- */

.loan-form { max-width: 860px; }
.items { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: .75rem .9rem .1rem; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.item-no { font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.item-body { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; }
.item-photo { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.photo-box {
  width: 120px; height: 120px; border-radius: var(--radius-sm); border: 2px dashed var(--line-strong);
  background: var(--surface); padding: 0; cursor: pointer; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600;
}
.photo-box:hover { border-color: var(--accent); color: var(--accent); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-box.is-busy::after {
  content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .7) center / 28px no-repeat;
  background-image: radial-gradient(circle, var(--accent) 35%, transparent 37%);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .4; } }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.photo-icon {
  width: 30px; height: 24px; border: 2.5px solid currentColor; border-radius: 6px; position: relative;
}
.photo-icon::before { content: ""; position: absolute; width: 10px; height: 10px; border: 2.5px solid currentColor; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.photo-icon::after { content: ""; position: absolute; width: 9px; height: 4px; background: currentColor; border-radius: 2px 2px 0 0; left: 5px; top: -6px; }
.item-fields label { margin-bottom: .6rem; }
.item-fields .hint { display: block; margin: -.35rem 0 .6rem; color: var(--accent); }
@media (max-width: 560px) {
  .item-body { grid-template-columns: 1fr; gap: .5rem; }
  .item-photo { flex-direction: row; justify-content: flex-start; gap: .75rem; }
  .photo-box { width: 96px; height: 96px; }
  .input-group { flex-wrap: wrap; }
  .input-group input { flex-basis: 100%; }
  .input-group .btn { flex: 1; }
}

.terms {
  white-space: normal; font-size: .92rem; line-height: 1.55; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .9rem 1rem; max-height: 280px; overflow-y: auto; margin-bottom: .9rem;
}

.sig-wrap {
  position: relative; height: 200px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; touch-action: none; user-select: none; -webkit-user-select: none;
}
.sig-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.sig-hint { position: absolute; left: 1rem; bottom: 2.6rem; color: #b9bdb7; font-size: 1.05rem; pointer-events: none; }
.sig-line { position: absolute; left: 1rem; right: 1rem; bottom: 2.2rem; border-top: 1.5px solid #cdd0ca; pointer-events: none; }
.sig-caption { margin-top: .5rem; font-size: .9rem; color: var(--ink-2); }

.submit-bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
  background: rgba(244, 243, 239, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: .85rem 0 calc(.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: .5rem;
}
@media (max-width: 560px) { .submit-bar .btn { flex: 1; } }

/* Scanner-overlay */
.scanner { position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 13, .88); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.scanner-box { width: 100%; max-width: 560px; text-align: center; }
.scanner-view { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame {
  position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%;
  border: 3px solid rgba(255, 255, 255, .9); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35);
}
.scanner-frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #e5484d; animation: scanline 1.6s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-28px); } 50% { transform: translateY(28px); } }
.scanner-msg { color: #fff; margin: .9rem 0; }
.scanner-msg.is-error { color: #ffd2c8; }
.scanner-actions .btn { min-width: 140px; }

/* ---------- Udlånsside / seddel ---------- */

.loan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .loan-layout { grid-template-columns: 1fr; } .loan-side { order: -1; } }
.slip { padding: 1.75rem; }
.slip h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin: 1.4rem 0 .5rem; }
.slip-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--accent); flex-wrap: wrap; }
.slip-logo { max-height: 52px; max-width: 220px; display: block; margin-bottom: .4rem; }
.slip-company-name { font-weight: 700; font-size: 1.2rem; margin-bottom: .2rem; }
.slip-title { text-align: right; }
.slip-doc { font-size: 1.25rem; font-weight: 700; }
.slip-number { font-size: 1.15rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
@media (max-width: 640px) { .slip { padding: 1.1rem; } .slip-cols { grid-template-columns: 1fr; } .slip-title { text-align: left; } }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.items-table th, .items-table td { padding: .55rem .5rem; vertical-align: middle; }
.items-table th:first-child, .items-table td:first-child { padding-left: 0; }
.items-table th:last-child, .items-table td:last-child { padding-right: 0; }
.items-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.items-table tfoot td { border-top: 2px solid var(--ink); font-weight: 600; padding-top: .7rem; border-bottom: 0; }
.items-table .col-no { width: 2rem; color: var(--muted); }
.items-table .col-photo { width: 72px; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; display: block; border: 1px solid var(--line); }
.thumb-empty { background: var(--surface-2); }
@media (max-width: 560px) { .items-table .col-no { display: none; } .items-table th:nth-child(4), .items-table td.mono { display: none; } }

.terms-slip { max-height: none; overflow: visible; }
.slip-signature { margin-top: 1.5rem; max-width: 420px; }
.slip-signature img { height: 110px; width: auto; display: block; }
.slip-signature .sig-line { position: static; border-top: 1.5px solid var(--ink); margin: .1rem 0 .35rem; }
.return-note { margin-top: 1.25rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.return-note h3 { margin-top: 0; }
.loan-side .card { padding: 1.1rem; }
.loan-side h2 { margin-bottom: .5rem; }
.loan-side form { margin: 0; }

/* ---------- Admin ---------- */

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.settings-form { max-width: 860px; }
.settings-extra { max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 640px) { .settings-extra { grid-template-columns: 1fr; } }
.logo-row { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.logo-row label { margin-bottom: .5rem; }
.logo-preview { max-height: 64px; max-width: 200px; border: 1px solid var(--line); border-radius: 6px; padding: .4rem; background: #fff; margin-bottom: .5rem; }
.log-table td { font-size: .92rem; }

/* ---------- Print ---------- */

@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .topbar, .env-banner, .flash { display: none !important; }
  .container { padding: 0; max-width: none; }
  .loan-layout { display: block; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .slip h3 { break-after: avoid; }
  .items-table tr, .slip-signature { break-inside: avoid; }
  .thumb { width: 48px; height: 48px; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Send til låner ---------- */

.copy-row {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem .35rem .35rem .7rem;
}
.copy-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.mail-hint { margin: .6rem 0 .2rem; }
#mail-status:empty { display: none; }

/* =====================================================================
   Version 2: fælles komponenter
   ===================================================================== */

:root {
  --open: #2f9e6b;
  --close: #8b62c9;
  --warn-strong: #d98a00;
  --ok: #2f9e6b;
}

.tag {
  display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .1rem .55rem; margin: .1rem 0;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.tag-admin { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag-shifts { background: var(--accent-soft); border-color: #c7d4f2; color: var(--accent-hover); }
.tag-loans { background: #eaf5ef; border-color: #c4e3d1; color: #1f6d48; }
.code-pill {
  display: inline-block; font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .35rem; color: var(--ink-2); vertical-align: 1px;
}
h1 .code-pill { font-size: .8rem; }
.role-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; border-radius: 4px;
  font-size: .64rem; font-weight: 800; color: #fff; line-height: 1; vertical-align: 1px; flex: none;
}
.role-open { background: var(--open); }
.role-close { background: var(--close); }
.warn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--warn-strong); color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; flex: none;
}
.warn-text { color: var(--warn); }
.dot { display: inline-block; vertical-align: -1px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .75rem; }
.time-input { font-variant-numeric: tabular-nums; }
.hours-table .time-input { max-width: 6.5rem; }
.special-kind .time-input { width: 5.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 .75rem; }
.grid-4 .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } .grid-4 .span-2 { grid-column: 1 / -1; } }
.check-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: .85rem; }
.card-pad { padding: 1rem 1.25rem .25rem; }
.table.compact td, .table.compact th { padding: .45rem .6rem; }
.table tr.is-selected td { background: var(--accent-soft); }
.group-row td { background: var(--surface-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.empty-row, td.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
p.empty { padding: 1.5rem 1rem; margin: 0; }

.toolbar, .filterbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filterbar { justify-content: flex-start; }
.filterbar select { width: auto; min-width: 10rem; }
.filterbar input[type=search] { flex: 1; min-width: 14rem; width: auto; }
.toolbar-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.toolbar-group select { width: auto; }
.toolbar-title { font-size: 1.1rem; min-width: 10rem; text-align: center; }
.btn-sm.btn-ghost { border-color: transparent; }

/* Dialoger */
.dialog {
  border: 0; border-radius: 14px; padding: 1.25rem 1.25rem 1rem; width: min(580px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem); overflow: auto; box-shadow: 0 18px 48px rgba(10, 20, 40, .28); color: var(--ink);
}
.dialog::backdrop { background: rgba(16, 22, 30, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.dialog-head h2 { margin: 0; }
.dialog-head p { margin: .15rem 0 0; }
.dialog-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 .25rem; }
.dialog-x:hover { color: var(--ink); }
.dialog-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.push-right { margin-left: auto; }
.dialog-delete { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.indent { margin-left: 1.9rem; }
.inline-input { flex-direction: row !important; align-items: center; gap: .5rem !important; }
.inline-input input { width: 5.5rem; }
.compact-fieldset { padding: .5rem .9rem .1rem; }
.compact-fieldset .check { margin-bottom: .4rem; }
label.inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .4rem !important; margin: 0 !important; font-weight: 500 !important; }
label.inline input { width: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  max-width: min(640px, calc(100vw - 2rem)); font-size: .95rem;
}
.toast.is-error { background: var(--danger); }

/* Adgang (brugere) */
.access-fields .check { margin-bottom: .6rem; }
.scope-box { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); padding: .75rem .85rem .35rem; margin-bottom: .85rem; }
.scope-region { margin-bottom: .5rem; }
.scope-store { margin-left: 1.6rem; margin-bottom: .3rem !important; font-size: .92rem; }
.admin-grid td .tag { margin-right: .15rem; }

/* Butik */
.store-grid, .emp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .store-grid, .emp-grid { grid-template-columns: 1fr; } }
.hours-table td, .hours-table th { padding: .4rem .5rem; vertical-align: middle; }
.hours-table input { min-height: 40px; padding: .35rem .5rem; }
.hours-table input:disabled { opacity: .35; }
.hours-footer { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.hours-footer label { margin-bottom: 0 !important; }
.hours-footer input { width: auto; }
.special-kind { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .85rem; }
.special-kind input { min-height: 40px; padding: .35rem .5rem; }
.special-list .is-holiday-row td { color: var(--warn); }
.tpl-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.tpl-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.tpl-list form { margin: 0; }
.store-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem 1rem; margin-bottom: .9rem; }

/* Medarbejder */
.contract { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .8rem; margin-bottom: .6rem; }
.contract.is-current { border-color: #c7d4f2; background: #f7f9fe; }
.contract-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.contract .kv { margin-top: .4rem; }
.contract .actions form { margin: 0; }
.contract-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
input[type=color] { padding: .2rem; min-height: 44px; width: 5rem; }
.delete-form { margin-top: .75rem; }

/* Mine vagter */
.my-links { margin-bottom: 1rem; }
.my-week { padding: 1rem 1.15rem; }
.my-days { list-style: none; margin: 0; padding: 0; }
.my-days li { display: grid; grid-template-columns: 8.5rem 1fr; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.my-days li.is-today { background: var(--accent-soft); margin: 0 -1.15rem; padding: .5rem 1.15rem; }
.my-days li.is-past { color: var(--muted); }
.my-shift { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; flex-wrap: wrap; }

/* Fravær: måneds-strimmel */
.strip-card { padding: 0; }
.strip-scroll { overflow-x: auto; }
.strip { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 100%; }
.strip th, .strip td { border-bottom: 1px solid var(--line); text-align: center; padding: 0; height: 2rem; min-width: 1.75rem; }
.strip thead th { font-weight: 600; color: var(--muted); padding: .35rem 0; background: var(--surface-2); }
.strip-dow { display: block; font-size: .65rem; text-transform: uppercase; }
.strip-day { display: block; font-size: .82rem; color: var(--ink-2); }
.strip .strip-name {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 0 .75rem; min-width: 10rem;
  white-space: nowrap; border-right: 1px solid var(--line);
}
.strip thead .strip-name { background: var(--surface-2); }
.strip-name a { color: var(--ink); text-decoration: none; }
.strip .is-weekend { background: #f6f5f1; }
.strip .is-holiday { background: #fdf1d8; }
.strip .is-today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.strip td .abs-cell, .strip td .abs-empty { display: block; width: 100%; height: 2rem; line-height: 2rem; text-decoration: none; }
.abs-cell { color: #fff; font-weight: 700; font-size: .72rem; }
.abs-cell.is-requested { opacity: .55; }
.abs-empty:hover { background: var(--accent-soft); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: .7rem 1rem; font-size: .82rem; color: var(--ink-2); border-top: 1px solid var(--line); }
.abs-swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 3px; vertical-align: -1px; background: var(--muted); }
.is-holiday-swatch { background: #fdf1d8; border: 1px solid #f0dbb2; }

/* Kalender */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: .5rem .6rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 128px; padding: .4rem .5rem .5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .2rem; cursor: pointer; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #fbfaf7; }
.cal-day.is-out { background: #f8f7f3; color: var(--muted); }
.cal-day.is-out .cal-hours, .cal-day.is-out .cal-abs { opacity: .6; }
.cal-day.is-closed .cal-hours { color: var(--danger); font-weight: 600; }
.cal-day.is-today { box-shadow: inset 0 3px 0 var(--accent); }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font-weight: 700; }
.cal-dow { display: none; font-weight: 600; color: var(--muted); }
.cal-edit { background: none; border: 1px solid transparent; border-radius: 6px; font: inherit; font-size: .75rem; color: var(--muted); padding: .1rem .4rem; cursor: pointer; }
.cal-day:hover .cal-edit, .cal-edit:focus-visible { border-color: var(--line-strong); color: var(--accent); }
.cal-hours { font-size: .85rem; color: var(--ink-2); }
.cal-hours.is-special { color: var(--accent); font-weight: 600; }
.cal-tag { font-size: .72rem; font-weight: 700; border-radius: 4px; padding: .05rem .35rem; align-self: flex-start; }
.cal-tag-holiday { background: #fdf1d8; color: var(--warn); }
.cal-tag-special { background: var(--accent-soft); color: var(--accent-hover); }
.cal-abs { font-size: .78rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-planned { margin-top: auto; font-size: .75rem; color: var(--accent); text-decoration: none; }
.cal-planned.is-empty { color: var(--muted); }
@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; border-right: 0; }
  .cal-day.is-out { display: none; }
  .cal-dow { display: inline; }
}

/* =====================================================================
   Vagtplan
   ===================================================================== */

.page-schedule .container { padding-top: .75rem; }
.sched-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.store-pick select { width: auto; min-width: 12rem; font-weight: 600; }
.store-pick { margin: 0; }
.week-nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.week-title { font-size: 1.15rem; margin: 0 .35rem; white-space: nowrap; }
.week-jump { margin: 0; }
.week-jump input { width: auto; min-height: 34px; padding: .25rem .5rem; font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { font: inherit; font-size: .88rem; font-weight: 600; background: var(--surface); border: 0; padding: .35rem .8rem; min-height: 34px; cursor: pointer; color: var(--ink-2); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.is-active { background: var(--accent); color: #fff; }

.sched-summary { margin-bottom: .75rem; }
.sum-stats { display: flex; align-items: center; gap: .4rem 1.25rem; flex-wrap: wrap; font-size: .92rem; color: var(--ink-2); }
.sum-open strong { color: var(--warn); }
.sum-ok { color: var(--ok); font-weight: 600; }
.sum-warn-btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 600; color: var(--warn); background: var(--warn-soft); border: 1px solid #f0dbb2; border-radius: 999px; padding: .2rem .7rem .2rem .3rem; cursor: pointer; }
.sum-warn-list { list-style: none; margin: .6rem 0 0; padding: .6rem .9rem; background: var(--surface); border: 1px solid #f0dbb2; border-radius: var(--radius-sm); font-size: .9rem; max-height: 260px; overflow: auto; }
.sum-warn-list li { display: flex; gap: .6rem; padding: .25rem 0; align-items: baseline; flex-wrap: wrap; }
.sum-warn-list .linklike { padding: 0; font-size: .85rem; min-width: 5.5rem; text-align: left; }

.sched-app[data-loading] { min-height: 300px; }
.grid-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sched-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 970px; table-layout: fixed; font-size: .9rem; }
@media (max-width: 1100px) {
  .sched-grid .col-name { width: 138px; }
  .sched-grid .col-total { width: 84px; }
  .chip-hours { display: none; }
}
.sched-grid th, .sched-grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sched-grid tr > :last-child { border-right: 0; }
.sched-grid .col-name {
  position: sticky; left: 0; z-index: 2; width: 172px; background: var(--surface); text-align: left; padding: .5rem .65rem;
  font-weight: 400; vertical-align: top; box-shadow: 1px 0 0 var(--line);
}
.sched-grid .col-name[class*="emp-c"] { box-shadow: inset 4px 0 0 var(--emp, var(--accent)), 1px 0 0 var(--line); padding-left: .85rem; }
.sched-grid thead th { background: var(--surface-2); vertical-align: bottom; }
.sched-grid thead .corner { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.sched-grid .col-total { width: 104px; text-align: right; padding: .5rem .65rem; vertical-align: top; }
thead .col-total { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); vertical-align: bottom; }
.day-head { padding: 0; position: relative; }
.day-link { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; border: 0; font: inherit; text-align: left; padding: .5rem .6rem .4rem; cursor: pointer; color: var(--ink); }
.day-link:hover { background: var(--accent-soft); }
.dh-name { font-weight: 700; }
.dh-hours { font-size: .8rem; color: var(--muted); font-weight: 500; }
.dh-tag { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: .05rem .35rem; margin: 0 .6rem .4rem; }
.day-head.is-today { box-shadow: inset 0 3px 0 var(--accent); }
.day-head.is-today .dh-name { color: var(--accent); }
.day-head.is-closed { background: #ecebe6; }
.day-head.is-closed .dh-hours { color: var(--danger); font-weight: 600; }
.emp-line { display: flex; align-items: center; gap: .35rem; font-weight: 600; }
.emp-line a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-line a:hover { color: var(--accent); text-decoration: underline; }
.emp-sub { font-size: .75rem; color: var(--muted); line-height: 1.3; margin-top: .1rem; }
.emp-row.is-me .col-name, .tl-row.is-me .tl-name { background: #f2f6ff; }

.cell { vertical-align: top; padding: .3rem; position: relative; min-width: 120px; height: 62px; }
.is-editable .cell { cursor: copy; }
.is-editable .cell:hover { background: #f7f9fe; }
.cell.is-closed { background: repeating-linear-gradient(-45deg, #f7f6f2, #f7f6f2 6px, #f1f0ec 6px, #f1f0ec 12px); }
.cell.is-today { background-color: #fbfcff; }
.cell.has-abs { background: #fffaf0; }
.cell.is-drop { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.cell-add {
  position: absolute; right: .25rem; bottom: .25rem; width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1px dashed var(--line-strong);
  background: var(--surface); color: var(--accent); font-weight: 700; font-size: 1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.cell:hover .cell-add, .cell-add:focus-visible { opacity: 1; }
@media (hover: none) { .cell-add { opacity: .55; } }

.chip {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .3rem; position: relative;
  background: #eef2fb; border: 1px solid #d4def5; border-left: 4px solid var(--emp, var(--accent));
  border-radius: 7px; padding: .22rem .4rem .45rem; margin-bottom: .3rem; font-size: .82rem; line-height: 1.2; cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(26, 71, 184, .18); }
.chip:focus-visible { outline: 3px solid rgba(26, 71, 184, .35); outline-offset: 1px; }
.chip-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip-store { font-family: var(--mono); font-size: .7rem; margin-right: .25rem; }
.chip-hours { margin-left: auto; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-note { flex-basis: 100%; font-size: .72rem; color: var(--ink-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-bar { position: absolute; left: .4rem; right: .4rem; bottom: .18rem; height: 3px; background: rgba(26, 34, 32, .08); border-radius: 2px; }
.chip-fill { position: absolute; top: 0; bottom: 0; background: var(--emp, var(--accent)); border-radius: 2px; }
.chip.is-other { background: #f4f3ef; border-color: var(--line); border-left-color: #c3c6c1; color: var(--muted); cursor: default; }
.chip.is-other .chip-fill { background: #b7bab5; }
.chip.is-open { border-style: dashed; border-left-style: solid; background: #fffaf0; border-color: #f0dbb2; border-left-color: var(--warn-strong); }
.chip.has-warn { border-color: #f0c66b; background: #fff8e8; }
.chip.is-dragging { opacity: .45; }
.abs-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 5px; padding: .1rem .4rem; margin-bottom: .3rem; }
.abs-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--warn); display: inline-block; }

.col-total .tot-main { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot-norm { color: var(--muted); font-size: .82rem; }
.tot-other { font-size: .7rem; color: var(--muted); margin-top: .15rem; line-height: 1.25; }
.col-total.is-ok strong { color: var(--ok); }
.col-total.is-over strong { color: var(--warn); }
.col-total.is-under strong { color: var(--ink-2); }
.open-row .col-name { background: #fffdf7; }
.add-row .col-name { padding: .4rem; }
.add-row select { font-size: .85rem; min-height: 36px; padding: .3rem .4rem; }
.add-row td { background: var(--surface-2); }

.sched-grid tfoot th, .sched-grid tfoot td { background: var(--surface-2); padding: .4rem .55rem; font-size: .8rem; vertical-align: middle; }
.sched-grid tfoot .col-name { background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.foot-names { color: var(--ink-2); }
.foot-names.is-missing { color: var(--danger); font-weight: 600; }
.foot-total th, .foot-total td { border-top: 2px solid var(--line-strong); }
.sched-hint { margin: .6rem .2rem 0; }

.cov-wrap { display: flex; align-items: center; gap: .4rem; }
.cov-bar { flex: 1; display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: #ecebe6; min-width: 50px; }
.cov-bar.is-compact { height: 9px; }
.cov-seg { display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; min-width: 1px; }
.cov-seg.lvl-ok { background: var(--accent); }
.cov-seg.lvl-low { background: var(--warn-strong); }
.cov-seg.lvl-0 { background: var(--danger); }
.cov-issues { display: inline-flex; align-items: center; gap: .25rem; color: var(--warn); font-weight: 700; font-size: .78rem; }
.cov-ok { color: var(--ok); font-weight: 700; }

/* Dagsvisning */
.day-tabs { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: .75rem; scrollbar-width: none; }
.day-tab { flex: 1; min-width: 6.5rem; display: flex; flex-direction: column; align-items: center; gap: .05rem; font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .5rem; cursor: pointer; color: var(--ink-2); }
.day-tab .dt-name { font-weight: 700; font-size: .9rem; }
.day-tab .dt-hours { font-size: .75rem; color: var(--muted); }
.day-tab.is-today { border-color: #c7d4f2; }
.day-tab.is-closed .dt-hours { color: var(--danger); }
.day-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-tab.is-active .dt-hours { color: rgba(255, 255, 255, .85); }
.day-info { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .75rem; }
.day-info h2 { margin: 0; }
.day-open { font-weight: 600; color: var(--accent); }
.day-open.is-closed { color: var(--danger); }
.day-roles { display: inline-flex; align-items: center; gap: .25rem; font-size: .9rem; }
.tl-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tl { min-width: 760px; }
.tl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { padding: .45rem .7rem; font-weight: 600; font-size: .88rem; display: flex; flex-direction: column; justify-content: center; gap: .15rem; border-right: 1px solid var(--line); background: var(--surface); position: sticky; left: 0; z-index: 2; }
.tl-name[class*="emp-c"] { box-shadow: inset 4px 0 0 var(--emp, var(--accent)); padding-left: .9rem; }
.tl-name .abs-chip { align-self: flex-start; margin: 0; }
.tl-track { position: relative; height: 44px; }
.is-editable .tl-row:not(.tl-head):not(.tl-cov) .tl-track { cursor: copy; }
.tl-head .tl-track { height: 28px; background: var(--surface-2); }
.tl-head .tl-name { background: var(--surface-2); }
.tl-tick { position: absolute; top: .4rem; transform: translateX(-50%); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-tick.is-first { transform: none; padding-left: .25rem; }
.tl-tick.is-last { transform: translateX(-100%); padding-right: .25rem; }
.tl-open { position: absolute; top: 0; bottom: 0; background: #f2f6ff; }
.tl-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(26, 34, 32, .06); }
.tl-bar {
  position: absolute; top: 7px; bottom: 7px; display: flex; align-items: center; gap: .3rem; padding: 0 .45rem; overflow: hidden; white-space: nowrap;
  background: #dfe7fa; border: 1px solid #c7d4f2; border-left: 4px solid var(--emp, var(--accent)); border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.tl-bar:hover { border-color: var(--accent); }
.tl-bar.is-other { background: #f1f0ec; border-color: var(--line); border-left-color: #c3c6c1; color: var(--muted); cursor: default; }
.tl-bar.is-open { background: #fff4dc; border-style: dashed; border-color: #f0c66b; border-left: 4px solid var(--warn-strong); }
.tl-bar.has-warn { background: #fff8e8; border-color: #f0c66b; }
.tl-row.has-abs .tl-track { background: #fffaf0; }
.tl-cov .tl-track { height: 38px; }
.tl-cov .tl-name { font-size: .8rem; color: var(--ink-2); background: var(--surface-2); }
.tl-cov-holder { position: absolute; top: 9px; }
.tl-cov-holder .cov-issues { display: none; }
.tl-closed-text { position: absolute; left: 1rem; top: .7rem; }
.day-issues { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .3rem; }
.day-issues li { display: flex; align-items: center; gap: .45rem; color: var(--warn); font-weight: 600; font-size: .9rem; }

/* Vagtdialog */
.shift-dialog { width: min(620px, calc(100vw - 1.5rem)); }
.tpl-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.tpl-btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; }
.tpl-btn:hover, .tpl-btn:focus-visible { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.also-days { margin-bottom: .6rem; }
.also-list { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.also-day { font-size: .9rem; margin: 0 !important; }
.also-day.is-closed span { color: var(--muted); }
.shift-paid { margin: .25rem 0 .5rem; }
.shift-warnings { list-style: none; padding: 0; margin: 0 0 .5rem; }
.shift-warnings li { display: flex; gap: .45rem; align-items: flex-start; font-size: .88rem; color: var(--warn); padding: .2rem 0; }
.form-errors { margin: .5rem 0; }

@media (max-width: 700px) {
  .sched-toolbar { flex-direction: column; align-items: stretch; }
  .sched-toolbar .toolbar-group { justify-content: space-between; }
  .week-title { font-size: 1rem; }
  .week-jump { display: none; }
  .store-pick select { min-width: 0; width: 100%; }
  .store-pick { flex: 1; }
  .tl-row { grid-template-columns: 110px minmax(0, 1fr); }
  .tl { min-width: 620px; }
}

@media print {
  .sched-toolbar, .sched-summary, .sched-hint, .cell-add, .toast { display: none !important; }
}

/* ---------- Månedsvisning (som regnearket: start over slut) ---------- */
.month-grid { min-width: 0; width: max-content; }
.month-grid col.mc-name { width: 150px; }
.month-grid col.mc-day { width: 46px; }
.month-grid col.mc-total { width: 104px; }
.month-grid .col-name { width: 150px; }
.mday-head { padding: 0; text-align: center; }
.mday-link { display: flex; flex-direction: column; align-items: center; width: 100%; background: none; border: 0; font: inherit; padding: .35rem 0; cursor: pointer; color: var(--ink); }
.mday-link:hover { background: var(--accent-soft); }
.md-dow { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.md-num { font-weight: 700; font-size: .9rem; }
.mday-head.is-closed { background: #ecebe6; }
.mday-head.is-closed .md-num { color: var(--muted); }
.mday-head.is-special .md-num { color: var(--warn); }
.mday-head.is-today { box-shadow: inset 0 3px 0 var(--accent); }
.month-grid .is-monday { border-left: 2px solid var(--line-strong); }
.mcell { padding: 2px; vertical-align: top; height: 52px; text-align: center; }
.is-editable .mcell { cursor: copy; }
.is-editable .mcell:hover { background: #f7f9fe; }
.mcell.is-closed { background: repeating-linear-gradient(-45deg, #f7f6f2, #f7f6f2 5px, #f1f0ec 5px, #f1f0ec 10px); }
.mcell.is-today { background-color: #fbfcff; }
.mcell.is-drop { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.mchip {
  position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: .76rem; font-weight: 700;
  font-variant-numeric: tabular-nums; background: #eef2fb; border: 1px solid #d4def5; border-top: 3px solid var(--emp, var(--accent));
  border-radius: 5px; padding: 2px 0; margin-bottom: 2px; cursor: pointer; user-select: none;
}
.mchip:hover { border-color: var(--accent); }
.mchip .mc-e { color: var(--ink-2); font-weight: 600; }
.mchip.is-other { background: #f4f3ef; border-color: var(--line); border-top-color: #c3c6c1; color: var(--muted); cursor: default; }
.mchip.is-open { background: #fffaf0; border-style: dashed; border-top: 3px solid var(--warn-strong); }
.mchip.has-warn { background: #fff8e8; border-color: #f0c66b; }
.mchip.is-dragging { opacity: .45; }
.mc-store { font-size: .58rem; font-family: var(--mono); }
.mc-warn { position: absolute; top: -6px; right: -5px; width: .95rem; height: .95rem; border-radius: 50%; background: var(--warn-strong); color: #fff; font-size: .6rem; line-height: .95rem; text-align: center; }
.mabs { font-size: .64rem; font-weight: 700; color: #fff; border-radius: 4px; padding: 3px 0; margin-bottom: 2px; overflow: hidden; }
.mfoot { text-align: center; font-size: .72rem; padding: .3rem 0 !important; }
.month-grid tfoot .warn-icon { width: .95rem; height: .95rem; font-size: .6rem; }
.print-only { display: none; }

@page monthsheet { size: A4 landscape; margin: 8mm; }
@media print {
  .print-only { display: block; }
  .month-print-head { font-size: 11pt; margin-bottom: 3mm; }
  .page-schedule .grid-scroll { overflow: visible; border: 0; box-shadow: none; }
  .month-grid { page: monthsheet; width: 100%; font-size: 7pt; }
  .month-grid col.mc-name, .month-grid .col-name { width: 24mm; }
  .month-grid col.mc-day { width: auto; }
  .month-grid col.mc-total { width: 16mm; }
  .month-grid .col-name { position: static; padding: 1mm; }
  .month-grid .emp-sub, .month-grid .add-row, .month-grid .warn-icon, .mc-warn, .cov-ok { display: none !important; }
  .mcell { height: auto; padding: .5mm; }
  .mchip { font-size: 6.5pt; padding: .5mm 0; border-top-width: 2px; }
  .mday-link { padding: 1mm 0; }
}
a.seg-btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink-2); }
a.seg-btn:hover { background: var(--surface-2); color: var(--ink); }
span.seg-btn { display: inline-flex; align-items: center; }
.hours-grid { font-variant-numeric: tabular-nums; }
.hours-grid th a { color: inherit; }
.hours-grid td.num, .hours-grid th.num { min-width: 4.2rem; }
.hours-grid .hg-norm { font-size: .72rem; color: var(--muted); }
.hours-grid td.is-ok { color: var(--ok); font-weight: 600; }
.hours-grid td.is-over { color: var(--warn); font-weight: 600; }
.hours-grid tfoot th, .hours-grid tfoot td { border-top: 2px solid var(--line-strong); background: var(--surface-2); }
.ok-text { color: var(--ok); font-weight: 600; }
.grid-3 .span-3 { grid-column: 1 / -1; }
.import-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.import-cols > .card { margin: 0; }
.import-sample { font-size: .82rem; margin-bottom: .75rem; }
.import-sample th, .import-sample td { border: 1px solid var(--line); text-align: center; }
.import-people summary { cursor: pointer; white-space: nowrap; }
.import-people .table { margin-top: .35rem; font-size: .85rem; }
.import-form .card { margin-bottom: 1rem; }
.import-form fieldset { border: 0; padding: 0; margin: .75rem 0 0; }
.import-form legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.import-names select { min-width: 11rem; }
@media (max-width: 640px) {
  .import-months .col-period { display: none; }
  .import-months td, .import-months th { padding-left: .35rem; padding-right: .35rem; }
  .import-names select { min-width: 0; }
}
