/* Skoleweb – farver, skrift og kantede flader fra skolemælk.dk, bygget oven på Bootstrap 5. */
/* Layout: fast lilla topbjælke, venstremenu (offcanvas på mobil), én arbejdsflade. Kantede hjørner og fede knapper som på skolemælk.dk. */
:root {
  --bg: #f4fbff; --surface: #ffffff; --surface-2: #daf2ff; --fg: #17111f; --muted: #53595f; --line: #c4dcea;
  --brand-btn: #502083; --brand-btn-strong: #3b175f; --brand-text: #502083; --header-bg: #3b175f; --on-solid: #ffffff;
  --action: #006629; --action-strong: #004d21; --link: #004799;
  --alert: #941f66; --alert-bg: #f8e4ef; --ok: #004d21; --ok-bg: #dff1e5; --info-bg: #daf2ff; --neutral-bg: #e9edf0;
  --stripe: linear-gradient(90deg, #502083 0 25%, #006629 25% 50%, #004799 50% 75%, #941f66 75% 100%);
  --font-body: "Roboto", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Roboto Condensed", "Roboto", "Arial Narrow", Arial, sans-serif;
  --header-h: 56px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #140d20; --surface: #1e1430; --surface-2: #2b1d45; --fg: #efeaf7; --muted: #aaa3ba; --line: #3d2d5b;
  --brand-btn: #6a34a8; --brand-btn-strong: #7c45bd; --brand-text: #c3a3f0; --header-bg: #241640; --on-solid: #ffffff;
  --action: #1f7a45; --action-strong: #27914f; --link: #8fc0ff;
  --alert: #f08fc6; --alert-bg: #401733; --ok: #7fd6a0; --ok-bg: #123620; --info-bg: #12304a; --neutral-bg: #2a2438;
  color-scheme: dark; } }

/* Bootstrap bundet til tokens */
:root, :root[data-bs-theme="light"], :root[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg); --bs-body-color: var(--fg); --bs-border-color: var(--line); --bs-secondary-color: var(--muted);
  --bs-font-sans-serif: var(--font-body); --bs-body-font-family: var(--font-body); --bs-body-font-size: 0.9375rem;
  --bs-border-radius: 0; --bs-border-radius-sm: 0; --bs-border-radius-lg: 0; --bs-border-radius-xl: 0; --bs-border-radius-pill: 0;
  --bs-heading-color: var(--fg); --bs-emphasis-color: var(--fg); --bs-tertiary-bg: var(--surface-2);
}
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 0.9375rem; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 1040; background: var(--header-bg); }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; letter-spacing: 0.01em; }
h1 { font-size: 1.75rem; margin: 0; } h2 { font-size: 1.1875rem; margin: 0; } h3 { font-size: 1rem; margin: 0; }
.ic { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.lbl { font-family: var(--font-label); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

/* Topbjælke */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1030; background: var(--header-bg); color: var(--on-solid); }
.top-in { display: flex; align-items: center; gap: 12px; height: var(--header-h); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top::after { content: ""; display: block; height: 4px; background: var(--stripe); }
.wordmark { font-weight: 900; font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.proto-tag { font-family: var(--font-label); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; border: 1px dashed currentColor; padding: 2px 6px; white-space: nowrap; }
.top-btn { background: none; border: 0; color: inherit; padding: 8px; font-size: 1.25rem; line-height: 1; position: relative; }
.top-btn .dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; background: var(--on-solid); color: var(--header-bg); font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; }
.who { margin-left: auto; text-align: right; line-height: 1.2; min-width: 0; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 0.75rem; opacity: 0.8; }
@media (max-width: 575px) { .who { display: none; } .top-in .spacer { margin-left: auto; } .proto-long { display: none; } }

/* Skal */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); }
main { min-width: 0; padding-block: 24px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; display: flex; flex-direction: column; gap: 24px; }
.side { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--fg); --bs-offcanvas-width: 280px; background: var(--surface); }
.side-in { display: flex; flex-direction: column; gap: 20px; padding-block: 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; }
@media (min-width: 992px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr); }
  .side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h) + 4px); align-self: start; height: calc(100vh - var(--header-h) - 4px - env(safe-area-inset-top, 0px)); overflow-y: auto; border-right: 1px solid var(--line); }
  main { padding-left: 32px; padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}
.school b { display: block; font-size: 1rem; }
.navlist { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.navlist a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--fg); text-decoration: none; font-family: var(--font-label); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.navlist a:hover { background: var(--surface-2); }
.navlist a[aria-current="page"] { background: var(--brand-btn); color: var(--on-solid); }
.navlist .cnt { margin-left: auto; background: var(--alert-bg); color: var(--alert); font-size: 0.6875rem; padding: 1px 6px; letter-spacing: 0; }
.demo-box { border: 1px dashed var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }

/* Flader */
.panel { background: var(--surface); border: 1px solid var(--line); }
.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-h .grow { flex: 1 1 200px; min-width: 0; }
.panel-b { padding: 16px; }
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.page-h .grow { flex: 1 1 280px; min-width: 0; }
.page-h p { margin: 6px 0 0; color: var(--muted); max-width: 65ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.fact { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact .big { font-size: 1.625rem; font-weight: 900; line-height: 1.15; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.cols > * { min-width: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows .grow { flex: 1 1 220px; min-width: 0; }
.empty { padding: 20px 16px; color: var(--muted); }

/* Mærkater */
.tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-label); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; white-space: nowrap; background: var(--neutral-bg); color: var(--fg); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--alert-bg); color: var(--alert); }
.tag.info { background: var(--info-bg); color: var(--link); }
.tag.sim { background: none; border: 1px dashed var(--muted); color: var(--muted); }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px; background: var(--surface-2); font-size: 0.875rem; white-space: nowrap; }
.chip b { font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Bootstrap-komponenter i brandets tone */
.btn { --bs-btn-border-radius: 0; --bs-btn-font-weight: 700; --bs-btn-padding-x: 1rem; }
.btn-primary { --bs-btn-color: var(--on-solid); --bs-btn-bg: var(--action); --bs-btn-border-color: var(--action); --bs-btn-hover-color: var(--on-solid); --bs-btn-hover-bg: var(--action-strong); --bs-btn-hover-border-color: var(--action-strong); --bs-btn-active-color: var(--on-solid); --bs-btn-active-bg: var(--action-strong); --bs-btn-active-border-color: var(--action-strong); --bs-btn-disabled-color: var(--on-solid); --bs-btn-disabled-bg: var(--action); --bs-btn-disabled-border-color: var(--action); }
.btn-brand { --bs-btn-color: var(--on-solid); --bs-btn-bg: var(--brand-btn); --bs-btn-border-color: var(--brand-btn); --bs-btn-hover-color: var(--on-solid); --bs-btn-hover-bg: var(--brand-btn-strong); --bs-btn-hover-border-color: var(--brand-btn-strong); --bs-btn-active-color: var(--on-solid); --bs-btn-active-bg: var(--brand-btn-strong); --bs-btn-active-border-color: var(--brand-btn-strong); }
.btn-line { --bs-btn-color: var(--brand-text); --bs-btn-bg: transparent; --bs-btn-border-color: var(--brand-text); --bs-btn-hover-color: var(--on-solid); --bs-btn-hover-bg: var(--brand-btn); --bs-btn-hover-border-color: var(--brand-btn); --bs-btn-active-color: var(--on-solid); --bs-btn-active-bg: var(--brand-btn); --bs-btn-active-border-color: var(--brand-btn); --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line); }
.btn-quiet { --bs-btn-color: var(--fg); --bs-btn-bg: transparent; --bs-btn-border-color: var(--line); --bs-btn-hover-color: var(--fg); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line); --bs-btn-active-color: var(--fg); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--line); --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line); }
.btn-sim { --bs-btn-color: var(--muted); --bs-btn-bg: transparent; --bs-btn-border-color: var(--muted); --bs-btn-hover-color: var(--fg); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--fg); border-style: dashed; }
.form-control, .form-select { background-color: var(--surface); color: var(--fg); border-color: var(--line); border-radius: 0; }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--fg); border-color: var(--link); box-shadow: 0 0 0 3px var(--info-bg); }
.form-label { font-weight: 700; margin-bottom: 4px; }
.form-text { color: var(--muted); }
.form-check-input { background-color: var(--surface); border-color: var(--muted); border-radius: 0 !important; }
.form-check-input:checked { background-color: var(--brand-btn); border-color: var(--brand-btn); }
.form-check-input:disabled { opacity: 0.45; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--fg); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--fg); margin: 0; }
.table > thead th { font-family: var(--font-label); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; border-bottom-width: 1px; }
.table > :not(caption) > * > * { padding: 10px 16px; vertical-align: middle; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.modal-content { background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 0; }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-color: var(--fg); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-color: var(--fg); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-hover-color: var(--fg); border-radius: 0; width: min(360px, calc(100vw - 32px)); padding: 0; }
.dropdown-menu .dropdown-item { white-space: normal; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.toasts { position: fixed; z-index: 1090; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast-x { pointer-events: auto; max-width: 420px; background: var(--fg); color: var(--bg); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; border-left: 6px solid var(--action); }
.toast-x.bad { border-left-color: var(--alert); }
.note { display: flex; gap: 10px; padding: 12px 16px; background: var(--info-bg); border: 1px solid var(--line); }
.note.warn { background: var(--alert-bg); }
.note > .ic { margin-top: 3px; }
.note p { margin: 0; }

/* Mælkedage-gitter */
.daygrid th, .daygrid td { text-align: center; }
.daygrid th:first-child, .daygrid td:first-child { text-align: left; }
.daygrid .form-check-input { width: 1.5rem; height: 1.5rem; margin: 0; }
.daygrid tr.school-row > * { background: var(--surface-2); font-weight: 700; }

/* Pakkeliste */
.pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pack-card { background: var(--surface); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pack-card.done { background: var(--ok-bg); }
.pack-card .hd { display: flex; align-items: baseline; gap: 8px; }
.pack-card .hd b { font-size: 1.25rem; font-weight: 900; }
.pack-card .hd .n { margin-left: auto; font-size: 1.25rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.pack-card .btn { min-height: 44px; }
.sheet { background: var(--surface); border: 1px solid var(--line); padding: 28px; max-width: 760px; }
.sheet h2 { font-size: 1.375rem; }
.sheet table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.sheet th, .sheet td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.sheet .box { width: 18px; height: 18px; border: 2px solid var(--fg); display: inline-block; vertical-align: middle; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.steps li { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; }
.steps .mk { width: 22px; height: 22px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 0.8rem; color: var(--on-solid); }
.steps li.done .mk { background: var(--action); border-color: var(--action); }
.steps li.now .mk { border-color: var(--brand-text); }
.steps li.todo { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters > div { flex: 1 1 150px; min-width: 0; max-width: 240px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, .side, .toasts, .no-print { display: none !important; } .shell { display: block; } main { padding: 0; } .sheet { border: 0; } }

/* Login og invitation */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); }
.login-box::before { content: ""; display: block; height: 6px; background: var(--stripe); }
.login-in { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-in .wordmark { color: var(--brand-text); font-size: 1.5rem; }
.login-in p { margin: 0; color: var(--muted); }
.link-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; word-break: break-all; background: var(--surface-2); padding: 8px 10px; user-select: all; }
.loading { color: var(--muted); padding: 24px 0; }
