/* XMedicus shared UI — app.css (black/white theme) */
:root {
  --color-primary: #000000;
  --color-on-primary: #ffffff;
  --color-primary-soft: rgba(0, 0, 0, 0.08);
  --color-primary-border: rgba(0, 0, 0, 0.25);
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #111111;
  --text-muted: #666666;
  --border: #e5e5e5;
  --border-strong: #cccccc;
  --primary: #111111;
  --primary-hover: #333333;
  --primary-soft: #f2f2f2;
  --primary-text: #111111;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-soft: #fee2e2;
  --secondary: #666666;
  --secondary-hover: #333333;
  --secondary-soft: #f2f2f2;
  --focus: rgba(17, 17, 17, 0.28);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bar-h: 56px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --flex-pos: #3d7a5a;
  --flex-neg: #a34040;
  --bar-bg: #111111;
  --bar-text: #ffffff;
  --bar-muted: #b3b3b3;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }

p { margin: 0 0 var(--space-3); }
small, .hint, .note { color: var(--text-muted); font-size: 0.875rem; }

/* —— App bar —— */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--bar-h);
  height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-3);
  padding: 6px var(--space-4);
  background: var(--bar-bg);
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  color: var(--bar-text);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bar-text);
  text-decoration: none;
  white-space: nowrap;
}
.app-brand:hover { text-decoration: none; color: #ffffff; opacity: 0.92; }
.app-brand-mark {
  width: 28px; height: 28px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0;
  overflow: hidden;
}
.app-brand-mark img,
.app-brand-logo {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}
.app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.app-nav a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--bar-muted);
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
}
.app-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.app-nav a.active {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
}
.app-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.app-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--bar-muted);
  min-width: 0;
  max-width: 200px;
}
.app-user strong,
.app-user .app-user-name {
  display: block;
  color: #ffffff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 140px;
}
.app-menu-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.app-bar.nav-open .app-nav {
  display: flex;
}
/* —— Layout —— */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}
.app-main--wide { max-width: 1200px; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* —— Cards —— */
.card, .box, .computed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-5);
  margin: 0 0 var(--space-4);
}
.card > h3:first-child,
.box > h3:first-child { margin-top: 0; }
.computed {
  background: var(--primary-soft);
  border-color: var(--border-strong);
}

/* —— Forms —— */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
}
.row > label,
label.field-label {
  display: inline-block;
  min-width: 160px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
}
.inline-label {
  min-width: auto !important;
  width: auto !important;
  margin-right: var(--space-2);
  font-weight: 500;
}
.days label { min-width: auto; width: auto; margin-right: 12px; font-weight: 400; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="time"],
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-height: 40px;
  max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}
input:disabled, select:disabled, textarea:disabled, button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--secondary-soft);
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.form-stack label { font-weight: 500; font-size: 0.875rem; margin-bottom: 2px; }
.form-stack input, .form-stack select { width: 100%; }

/* —— Buttons —— */
button, .btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}
button:hover:not(:disabled), .btn:hover { background: var(--primary-hover); text-decoration: none; }
button.btn-secondary, .btn-secondary,
button[type="button"].btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: #111111;
}
button.btn-secondary:hover:not(:disabled), .btn-secondary:hover {
  background: var(--secondary-soft);
}
/* App bar (dark) — beat later equal-specificity button rules */
.app-bar button.btn-ghost,
.app-bar .btn-ghost {
  color: var(--bar-muted);
}
.app-bar button.btn-ghost:hover:not(:disabled),
.app-bar .btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.app-bar button.btn-secondary,
.app-bar button[type="button"].btn-secondary,
.app-bar .btn-secondary {
  background: transparent !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.55) !important;
}
.app-bar button.btn-secondary:hover:not(:disabled),
.app-bar button[type="button"].btn-secondary:hover:not(:disabled),
.app-bar .btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}
button.btn-ghost, .btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  font-weight: 500;
  padding: 8px 10px;
}
button.btn-ghost:hover:not(:disabled) {
  background: var(--secondary-soft);
  color: var(--text);
}
button.btn-danger, .btn-danger {
  background: var(--danger);
  color: #fff;
}
button.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
button.btn-sm, .btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  min-height: 32px;
}

/* Default page buttons that aren't primary actions stay secondary-looking via class in markup;
   keep legacy bare <button> as primary for main actions. */

/* —— Badges / pills —— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-role {
  background: #e8e8e8;
  color: #111111;
}
.badge-role.admin { background: #111111; color: #ffffff; }
.badge-role.leader { background: #d4d4d4; color: #111111; }
.badge-role.direktion { background: #1f4e79; color: #ffffff; }
.app-bar .badge-role.direktion { background: #1f4e79; color: #ffffff; }
/* Role badges on dark app bar */
.app-bar .badge-role {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}
.app-bar .badge-role.admin {
  background: #ffffff;
  color: #111111;
}
.app-bar .badge-role.leader {
  background: rgba(255,255,255,0.28);
  color: #ffffff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e8e8e8;
  color: #333333;
}
/* Greyscale status pills — slight shade variation for scanning */
.status-Kontor { background: #166534; color: #ffffff; }
.status-Hjemme { background: #0f766e; color: #ffffff; }
.status-Ude { background: #c2410c; color: #ffffff; }
.status-Afspadsering { background: #7c3aed; color: #ffffff; }
.status-Ferie { background: #2563eb; color: #ffffff; }
.status-Syg { background: #b91c1c; color: #ffffff; }
.status-Barn_syg { background: #db2777; color: #ffffff; }
.status-Barsel { background: #7e22ce; color: #ffffff; }
.status-Arbejder_ikke { background: #e5e7eb; color: #374151; }
.status-Weekend { background: #e5e7eb; color: #4b5563; }
.status-Helligdag { background: #d1d5db; color: #1f2937; }
.status-Firmafridag { background: #d1d5db; color: #1f2937; }
.status-Fri { background: #4b5563; color: #ffffff; }
.status-Fraværende,
.status-Fravaerende { background: #991b1b; color: #ffffff; }
.status-Ikke_startet { background: #f3f4f6; color: #6b7280; }

.flex-pos { color: var(--flex-pos); font-weight: 600; }
.flex-neg { color: var(--flex-neg); font-weight: 600; }

/* —— Tables —— */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}
th {
  background: #fafafa;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:hover { background: #f0f0f0; }
table.period-table th, table.period-table td,
table.plan-table th, table.plan-table td,
table.sw-table th, table.sw-table td {
  border: 1px solid var(--border);
}
.sw-table select, .sw-table input,
.plan-table select, .plan-table input,
.period-table select, .period-table input[type="time"] {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  min-height: 36px;
  font-size: 0.875rem;
}
.period-actions { margin: var(--space-2) 0 var(--space-3); }
.period-actions button { margin-right: var(--space-2); }
.period-compact { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.forced { background: #fafafa !important; color: var(--text-muted); }

/* —— Tabs (segmented) —— */
.tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 var(--space-4);
  padding: 4px;
  background: var(--secondary-soft);
  border-radius: var(--radius);
  border-bottom: none;
}
.tab-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: none;
}
.tab-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.7);
  color: var(--text);
}
.tab-btn.active {
  background: var(--surface);
  color: var(--primary-text);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* —— Week nav —— */
.week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.week-nav button { padding: 8px 12px; font-size: 0.85rem; }

/* —— Messages —— */
#msg, #planMsg, #standardMsg, #result {
  min-height: 1.25em;
  margin: var(--space-3) 0;
  font-size: 0.9rem;
}
.msg-ok { color: var(--flex-pos); }
.msg-err { color: var(--danger); }
#viewOnlyBadge {
  display: none;
  color: var(--danger);
  font-weight: 600;
  margin-left: var(--space-3);
  font-size: 0.875rem;
}

/* —— Login —— */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--bg);
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-logo {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto var(--space-4);
}
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}
.login-card .app-brand {
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 1.25rem;
  color: var(--text);
}
.login-card .app-brand:hover { color: var(--text); opacity: 1; }
.login-card .app-brand-mark img,
.login-card .app-brand-logo {
  width: 32px;
  height: 32px;
}
.login-card h2 { margin-bottom: var(--space-4); }
.login-card input {
  width: 100%;
  margin: 0 0 var(--space-3);
  text-align: left;
}
.login-card button { width: 100%; margin: var(--space-2) 0; }
.login-card .hint { margin-top: var(--space-3); }
#setPasswordBox { display: none; margin-top: var(--space-2); text-align: left; }
#setPasswordBox h3 { text-align: center; }
#setPasswordBox .hint { text-align: center; }

/* —— Modal (change password) —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: var(--space-5);
}
.modal h3 { margin-top: 0; }
.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* —— Utility —— */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Legacy id hooks still styled */
#userBar { display: none !important; } /* replaced by app-bar */
#pwdBox { display: none !important; } /* replaced by modal */

/* —— Responsive —— */
@media (max-width: 1280px) {
  .app-nav a { padding: 7px 8px; font-size: 0.8125rem; }
  .app-user { max-width: 160px; }
  .app-user strong,
  .app-user .app-user-name { max-width: 110px; }
}
@media (max-width: 1360px) {
  .app-nav {
    flex: 1 1 100%;
    order: 3;
    margin: 0 calc(-1 * var(--space-4));
    padding: 4px var(--space-4) 4px;
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  .app-bar-right { margin-left: auto; }
  .app-user { max-width: 180px; }
  .app-user strong,
  .app-user .app-user-name { max-width: 120px; }
}
@media (max-width: 720px) {
  .app-menu-toggle { display: inline-flex; }
  .app-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    order: initial;
    flex: none;
    margin: 0;
    border-top: none;
    flex-wrap: nowrap;
    flex-direction: column;
    align-items: stretch;
    background: var(--bar-bg);
    border-bottom: 1px solid #000;
    padding: var(--space-2);
    box-shadow: var(--shadow);
  }
  .app-bar.nav-open .app-nav { display: flex; }
  .app-nav a { padding: 12px 14px; }
  .app-user span.user-meta { display: none; }
  .app-bar-right .btn-ghost span { display: none; }
  .row > label { min-width: 100%; margin-bottom: 2px; }
  .row input, .row select { width: 100%; }
  .app-main { padding: var(--space-4) var(--space-3) var(--space-5); }
  .tabs { width: 100%; }
  .tab-btn { flex: 1; text-align: center; }
}


/* —— Personalehåndbog —— */
.handbook-page .handbook-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.handbook-header h1 { margin-bottom: 0; }
.handbook-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.handbook-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.handbook-search-wrap input[type="search"] {
  min-width: 220px;
  width: min(360px, 70vw);
}
.handbook-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.handbook-toc {
  position: sticky;
  top: calc(var(--bar-h) + var(--space-3));
  max-height: calc(100vh - var(--bar-h) - var(--space-5));
  overflow: auto;
  padding: var(--space-3);
}
.handbook-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  gap: var(--space-2);
}
.handbook-toc-toggle { display: none; }
.handbook-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-item {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
}
.toc-item:hover {
  background: var(--primary-soft);
  text-decoration: none;
}
.toc-item.toc-l1 { font-weight: 650; }
.toc-item.toc-l2 { padding-left: 18px; color: #333; }
.toc-item.toc-l3 { padding-left: 28px; font-size: 0.85rem; color: var(--text-muted); }
.toc-item.toc-l4 { padding-left: 36px; font-size: 0.85rem; color: var(--text-muted); }
.handbook-section {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  scroll-margin-top: calc(var(--bar-h) + var(--space-3));
}
.handbook-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.handbook-section-title { margin: 0; }
.handbook-section-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.handbook-section-body {
  line-height: 1.6;
}
.handbook-section-body ul,
.handbook-section-body ol {
  margin: 0 0 var(--space-3);
  padding-left: 1.4em;
}
.handbook-section-body li { margin-bottom: 4px; }
.handbook-section-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-3);
  font-size: 0.9rem;
}
.handbook-section-body th,
.handbook-section-body td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.handbook-section-body th { background: var(--primary-soft); }
.hb-mark {
  background: #ffe566;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
.handbook-modal {
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.handbook-modal .row-2 {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: var(--space-3);
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.rte-toolbar button {
  background: var(--primary-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.rte-toolbar button:hover { background: #e8e8e8; }
.rte-editor {
  min-height: 180px;
  max-height: 40vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: #fff;
  line-height: 1.55;
}
.rte-editor:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

@media (max-width: 860px) {
  .handbook-layout {
    grid-template-columns: 1fr;
  }
  .handbook-toc {
    position: relative;
    top: 0;
    max-height: none;
  }
  .handbook-toc.collapsed .handbook-toc-nav { display: none; }
  .handbook-toc-toggle { display: inline-flex; }
  .handbook-search-wrap input[type="search"] { min-width: 0; width: 100%; }
  .handbook-header-actions { width: 100%; }
  .handbook-modal .row-2 { grid-template-columns: 1fr; }
}

@media print {
  .app-bar,
  .handbook-toc,
  .handbook-header-actions,
  .handbook-section-actions,
  #msg { display: none !important; }
  .handbook-layout { display: block; }
  .handbook-section {
    break-inside: avoid;
    box-shadow: none;
    border: none;
    padding: 0 0 12px;
  }
  body { background: #fff; }
  .app-main { padding: 0; max-width: none; }
}

/* —— Support rotation —— */
.support-page .support-lineup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.support-role-card {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.support-role-num {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: #111;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.support-coverage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-4);
}
.cov-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f0f0f0;
  border: 1px solid #cccccc;
  font-size: 0.8rem;
  color: #333;
}
.cov-chip.cov-warn {
  background: #f5e6e6;
  border-color: #c9a0a0;
  color: #6b3030;
}
.cov-chip.cov-bad {
  background: #fee2e2;
  border-color: #a34040;
  color: #a34040;
  font-weight: 600;
}
.support-week-table th,
.support-matrix-table th {
  white-space: nowrap;
  font-size: 0.8rem;
}
.support-week-table td,
.support-matrix-table td {
  vertical-align: top;
  font-size: 0.875rem;
}
.support-week-table tr.row-warn {
  background: #fff5f5;
}
.rot-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.rot-pill.rot-support { background: #111; color: #fff; }
.rot-pill.rot-backup { background: #444; color: #fff; }
.rot-pill.rot-frileg { background: #e5e5e5; color: #333; }
.rot-pill.rot-dedikeret {
  background: #fff;
  color: #333;
  border: 1px solid #999;
}
.rot-pill.rot-primary { background: #111; color: #fff; }
.support-member-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.support-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.support-member-idx {
  font-weight: 700;
  width: 22px;
  text-align: center;
  color: var(--text-muted);
}
.support-member-name { flex: 1; }
.support-override-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
}
.support-override-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .support-page .support-lineup-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
}
.support-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}
.support-role-badge.muted {
  background: #e5e5e5;
  color: #333;
}
.support-role-badge.outline {
  background: #fff;
  color: #333;
  border: 1px solid #999;
}

/* Terminated employees */
.row-terminated td { color: #777; background: #f5f5f5; }
.badge-terminated {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #d4d4d4;
  color: #333;
  font-weight: 600;
}
.retention-soon { color: #111; font-weight: 600; }

/* —— Overview / Vacation pages —— */
.overview-page .overview-toolbar,
.vacation-page .overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.overview-week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.overview-support,
.dash-support-line {
  border: 1px solid var(--border-strong, #cfcfcf);
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
  box-sizing: border-box;
  max-width: 100%;
}
.overview-support { font-size: 0.9rem; color: var(--text-muted); }
.ov-support-line { color: var(--text); }
.ov-sup-sep { color: var(--text-muted); margin: 0 2px; }
.ov-sup-sick { color: #b91c1c; font-weight: 600; }
.dash-support-line {
  display: inline-flex; flex: 0 1 auto; width: auto; margin-top: 4px;
  font-size: 0.9rem; color: var(--text);
}
.dash-banner .dash-support-line { font-weight: 500; }
.overview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 12px;
}
button.ov-sum-chip,
.ov-sum-chip {
  background: #fff !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #111 !important;
  font-weight: 500;
  box-shadow: none;
}
button.ov-sum-chip:hover,
.ov-sum-chip:hover {
  background: #f2f2f2 !important;
  color: #111 !important;
}
.ov-sum-chip strong { font-weight: 700; margin-left: 2px; }
.ov-sum-sep { color: #999; font-weight: 600; user-select: none; padding: 0 2px; }

.overview-filters { padding: 12px 16px; margin-bottom: 12px; }
.overview-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
}
.overview-filters-row > label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overview-filters-row label.inline-label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text);
  padding-bottom: 6px;
}
.overview-filters-row input[type="search"],
.overview-filters-row select {
  min-height: 36px;
}

/* Afdeling checkbox dropdown */
.ov-dept-dd {
  position: relative;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-self: flex-end;
}
.ov-dept-dd > summary {
  list-style: none;
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #111;
  font-size: 0.875rem;
  user-select: none;
}
.ov-dept-dd > summary::-webkit-details-marker { display: none; }
.ov-dept-dd > summary::after { content: " ▾"; color: #666; font-size: 0.75rem; }
.ov-dept-dd[open] > summary { border-color: #111; }
.ov-dept-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ov-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #111;
  padding: 4px 4px;
  cursor: pointer;
}

.overview-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.ov-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 0.8rem; }
.ov-grid th, .ov-grid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px 8px; vertical-align: top; }
.ov-grid thead th { position: sticky; top: 0; background: #111; color: #fff; z-index: 2; font-weight: 600; }
.ov-name-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 180px; max-width: 220px; }
.ov-grid thead .ov-name-col { z-index: 3; background: #111; color: #fff; }
.ov-day-h { text-align: center; min-width: 88px; }
.ov-day-h.is-weekend { min-width: 56px; background: #333; }
.ov-day-h.is-today { box-shadow: inset 0 -3px 0 #fff; }
.ov-day-h.is-holiday .ov-hol { font-size: 0.65rem; opacity: 0.85; font-weight: 500; }
.ov-date { font-weight: 400; opacity: 0.85; font-size: 0.75rem; }
.ov-cell { cursor: pointer; text-align: center; min-width: 88px; }
.ov-cell.is-planned { background: #fafafa; }
.ov-cell:hover { background: #eee; }
.ov-grid tr:hover .ov-name-col { background: #f5f5f5; }
.ov-times { margin-top: 4px; display: flex; flex-direction: column; gap: 1px; font-size: 0.7rem; line-height: 1.2; }
.ov-planned { color: #888; }
.ov-realized { color: #111; font-weight: 700; }
.ov-multi, .ov-extra { font-size: 0.65rem; color: #666; }
.ov-name-btn {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  cursor: pointer; text-align: left; color: var(--text);
}
.ov-name-btn:hover { text-decoration: underline; }
.ov-sub { font-size: 0.7rem; color: var(--text-muted); }
.ov-timelon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 3px; margin-left: 4px;
  background: #ddd; color: #111; font-size: 0.65rem; font-weight: 700;
}
.ov-support-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: #111; color: #fff; font-size: 0.65rem; font-weight: 600;
}
.ov-support-badge.muted { background: #ccc; color: #111; }

/* Group headers: dark text on light grey (override global button white) */
.ov-group td {
  background: #e8e8e8 !important;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 8px 10px !important;
  border-bottom: 1px solid #ccc;
}
button.ov-group-toggle,
.ov-group-toggle {
  background: transparent !important;
  border: none !important;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #111 !important;
  padding: 0;
  text-align: left;
  box-shadow: none;
}
button.ov-group-toggle:hover,
.ov-group-toggle:hover {
  background: transparent !important;
  color: #111 !important;
  text-decoration: underline;
}
.ov-group-toggle .hint { color: #555; font-weight: 500; }
.overview-modal { max-width: 520px; width: 92vw; }
.status-Ikke_startet { background: #eee; color: #666; }

/* Vacation heatmap */
.vac-quarters { display: flex; gap: 4px; flex-wrap: wrap; }
.vac-quarters .active { background: #111 !important; color: #fff !important; border-color: #111 !important; }
.vac-types {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  align-self: flex-end;
}
.vac-types legend { padding: 0 4px; font-size: 0.75rem; color: var(--text-muted); }
.vac-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
.vac-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 2px;
  margin-right: 4px; vertical-align: middle; border: 1px solid #bbb;
}
.vac-swatch.vac-ferie { background: #111; }
.vac-swatch.vac-ferie-past { background: #777; }
.vac-swatch.vac-other { background: #bbb; }
.vac-swatch.vac-weekend { background: #e8e8e8; }
.vac-grid-wrap, .vac-overlap-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.vac-grid-wrap { max-height: calc(100vh - 320px); }
.vac-grid {
  border-collapse: separate; border-spacing: 0; font-size: 0.7rem;
  width: max-content; min-width: 100%;
}
.vac-grid th, .vac-grid td { border-right: 1px solid #eee; border-bottom: 1px solid #eee; padding: 0; }
.vac-grid thead th {
  position: sticky; top: 0; background: #111; color: #fff; z-index: 2;
  font-weight: 600; text-align: center;
}
.vac-name-col, .vac-total-col {
  position: sticky; background: #fff; z-index: 1;
  padding: 4px 8px !important; text-align: left; white-space: nowrap;
}
.vac-name-col { left: 0; min-width: 150px; }
.vac-total-col {
  left: 150px; min-width: 48px; text-align: center !important;
  border-right: 2px solid #ccc !important;
}
.vac-grid thead .vac-name-col, .vac-grid thead .vac-total-col {
  background: #111; color: #fff; z-index: 3;
}
.vac-month-h { font-size: 0.75rem; padding: 4px !important; }
.vac-day-h {
  min-width: 14px; max-width: 16px; font-weight: 400;
  font-size: 0.6rem; padding: 2px 0 !important;
}
.vac-day-h.is-muted { background: #333; }
.vac-day-h.is-today { box-shadow: inset 0 -2px 0 #fff; }
.vac-cell { min-width: 14px; max-width: 16px; height: 18px; cursor: pointer; }
.vac-cell.is-muted { background: #f0f0f0; }
.vac-cell.is-today { outline: 1px solid #111; outline-offset: -1px; }
.vac-cell.vac-ferie { background: #111; }
.vac-cell.vac-ferie-past { background: #777; }
.vac-cell.vac-other { background: #bdbdbd; }

/* Overlap row aligned with day columns */
.vac-overlap { padding: 0; }
.vac-overlap-table { margin: 0; }
.vac-overlap-table thead th {
  position: sticky; top: 0;
  background: #f5f5f5; color: #111; font-weight: 600;
  height: 28px; vertical-align: middle;
}
.vac-overlap-table .vac-name-col,
.vac-overlap-table .vac-total-col {
  background: #f5f5f5 !important; color: #111 !important;
  font-size: 0.75rem; text-align: left !important;
}
.vac-ov-h {
  min-width: 14px; max-width: 16px;
  font-size: 0.65rem; font-weight: 700;
  padding: 0 !important;
}
.vac-ov-h.is-muted { opacity: 0.55; }
.vac-ov-h.is-today { box-shadow: inset 0 -2px 0 #111; }
.vac-ov-n0 { background: #f5f5f5; color: transparent; }
.vac-ov-n1 { background: #d4d4d4; color: #111; }
.vac-ov-n2 { background: #9a9a9a; color: #fff; }
.vac-ov-n3 { background: #111; color: #fff; }


.ov-dept-dd { margin-bottom: 0; height: 36px; }
.ov-dept-dd > summary {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  box-sizing: border-box;
  line-height: 1;
}
.overview-filters-row > .ov-dept-dd { display: flex; flex-direction: column; justify-content: flex-end; }
.overview-filters-row input[type="search"],
.overview-filters-row select {
  height: 36px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .ov-day-h, .ov-cell { min-width: 72px; }
}

/* Vacation blue (intentional exception to B/W theme) */
.vac-view-toggle { display: flex; gap: 4px; margin-left: 8px; }
.vac-view-toggle .active { background: #111 !important; color: #fff !important; border-color: #111 !important; }

.vac-swatch.vac-ferie { background: #2563eb; border-color: #1d4ed8; }
.vac-swatch.vac-ferie-past { background: #93c5fd; border-color: #60a5fa; }
.vac-swatch.vac-week-full { background: #2563eb; border-color: #1d4ed8; }
.vac-swatch.vac-week-partial { background: #bfdbfe; border-color: #93c5fd; }

.vac-cell.vac-ferie { background: #2563eb !important; }
.vac-cell.vac-ferie-past { background: #60a5fa !important; }

.vac-week-grid .vac-week-h {
  min-width: 28px;
  max-width: 36px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 2px !important;
  background: #111;
  color: #fff;
}
.vac-week-grid .vac-week-h.is-past { opacity: 0.85; }
.vac-week-cell {
  min-width: 28px;
  max-width: 36px;
  height: 22px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 700;
  color: #1e3a8a;
  padding: 0 !important;
}
.vac-week-cell.vac-week-full {
  background: #2563eb;
  color: #fff;
}
.vac-week-cell.vac-week-partial {
  background: #bfdbfe;
  color: #1e3a8a;
}
.vac-week-cell.vac-other { background: #bdbdbd; color: #333; }
.vac-week-cell.is-past.vac-week-full { background: #3b82f6; }
.vac-week-cell.is-past.vac-week-partial { background: #dbeafe; }
.vac-week-cell:hover { outline: 1px solid #111; outline-offset: -1px; }

.vac-ov-week {
  min-width: 28px;
  max-width: 36px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 0 !important;
}
.vac-overlap-table .vac-ov-week.is-past { opacity: 0.85; }

/* Overview planned vs registered */
.ov-times-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ov-times-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.ov-times-toggle { display: flex; gap: 4px; }
.ov-times-toggle .active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.ov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-top: 10px;
  font-size: 0.8rem;
}
.ov-legend .status-pill { vertical-align: middle; margin-right: 4px; }

/* Solid = registered; outline = planned only */
.status-pill.ov-badge-solid {
  border: 1px solid transparent;
}
.status-pill.ov-badge-outline {
  background: #fff !important;
  color: #111 !important;
  border: 1.5px solid #111 !important;
  font-weight: 600;
}
.status-pill.ov-badge-outline.status-Hjemme,
.status-pill.ov-badge-outline.status-Ude {
  border-color: #555 !important;
  color: #333 !important;
}
.status-pill.ov-badge-struck {
  text-decoration: line-through;
  opacity: 0.65;
  margin-right: 2px;
}
.ov-planned {
  color: #777;
  font-size: 0.68rem;
  display: block;
}
.ov-realized {
  color: #111;
  font-weight: 700;
  font-size: 0.72rem;
  display: block;
}
.ov-unreg-mark {
  display: block;
  margin-top: 3px;
  font-size: 0.65rem;
  font-style: italic;
  color: #888;
}
.ov-cell.is-unregistered { background: #fafafa; }
.ov-leg-solid { /* sample in legend */ }
.ov-leg-outline {
  background: #fff !important;
  color: #111 !important;
  border: 1.5px solid #111 !important;
}
.ov-compare-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
  background: #f5f5f5;
  white-space: nowrap;
}
.ov-compare-table td, .ov-compare-table th {
  padding: 6px 10px;
  vertical-align: top;
}

/* Missing registrations */
.miss-emp { margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: #fff; }
.miss-emp summary { cursor: pointer; font-size: 0.95rem; }
.miss-emp .badge { margin-left: 8px; }
.xm-miss-actions { white-space: nowrap; }
.ov-effective { color: #111; font-weight: 600; font-size: 0.75rem; }

/* Time page: planned vs registered */
.time-reg-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.time-reg-badge.is-registered { background: #111; color: #fff; }
.time-reg-badge.is-planned {
  background: #fff; color: #111; border: 1.5px solid #111;
}
.btn-approve { padding: 4px 10px; font-size: 0.8rem; }

/* —— Time month view + day modal —— */
.time-month-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.time-month-nav input[type="month"] { min-width: 160px; }
.time-month-summary { margin-bottom: 10px; }
.time-month-table tbody tr {
  cursor: pointer;
}
.time-month-table tbody tr:hover { background: #f5f5f5; }
.time-month-table tbody tr.is-today {
  outline: 2px solid #111;
  outline-offset: -2px;
}
.time-month-table tbody tr.is-calendar-day {
  background: #f0f0f0;
  color: #666;
}
.time-month-table tbody tr.is-calendar-day .status-pill {
  opacity: 0.75;
}
.time-day-modal {
  max-width: 640px;
  width: 96%;
  max-height: 90vh;
  overflow: auto;
}
.time-day-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
.time-day-banner.is-planned {
  background: #fafafa;
  border-style: dashed;
}
.time-day-banner.is-registered {
  background: #111;
  color: #fff;
  border-color: #111;
}
.time-day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}
.time-historik {
  margin-top: 14px;
  border-top: 1px solid #ddd;
  padding-top: 8px;
}
.time-historik summary {
  cursor: pointer;
  font-weight: 600;
}
.time-historik-list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.time-historik-list li { margin-bottom: 8px; }
.time-log-filters { margin-bottom: 12px; gap: 10px; }


/* —— Overview view toggle, today column, legend, day view —— */
.ov-view-toggle {
  display: inline-flex;
  border: 1px solid #111;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 10px;
}
.ov-view-toggle button {
  border: none;
  background: #fff;
  color: #111;
  padding: 6px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  border-right: 1px solid #111;
}
.ov-view-toggle button:last-child { border-right: none; }
.ov-view-toggle button.active {
  background: #111;
  color: #fff;
}
.ov-day-nav { display: none; align-items: center; gap: 8px; flex-wrap: wrap; }
.overview-page.is-day-view .ov-week-nav { display: none; }
.overview-page.is-day-view .ov-day-nav { display: flex; }
.overview-page.is-day-view #showWeekend { } /* still usable */

/* Today column — week view */
.ov-grid th.ov-day-h.is-today {
  background: #111 !important;
  color: #fff !important;
  border-left: 2px solid #111;
  border-right: 2px solid #111;
}
.ov-grid th.ov-day-h.is-today .ov-date,
.ov-grid th.ov-day-h.is-today .ov-hol { color: #e5e5e5; }
.ov-grid td.ov-cell.is-today-col {
  background: #f3f4f6;
  border-left: 2px solid #111;
  border-right: 2px solid #111;
}
.ov-day-title.is-today {
  background: #111;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  display: inline-block;
}

/* Summary chips with status colors */
.ov-sum-chip[data-k="kontor"] { border-color: #166534; color: #166534; }
.ov-sum-chip[data-k="hjemme"] { border-color: #0f766e; color: #0f766e; }
.ov-sum-chip[data-k="ude"] { border-color: #c2410c; color: #c2410c; }
.ov-sum-chip[data-k="fravaerende"] { border-color: #b91c1c; color: #b91c1c; }

.ov-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fafafa;
  font-size: 0.8rem;
}
.ov-status-legend .leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #333;
}
.ov-status-legend .status-pill { font-size: 0.7rem; }

.ov-dept-filter-label {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.875rem;
}
.ov-dept-filter-label > span { font-weight: 500; }

/* Day view detail table */
.ov-day-grid .ov-periods { display: flex; flex-direction: column; gap: 4px; }
.ov-day-grid .ov-period-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.85rem; }
.ov-day-grid .ov-meta { font-size: 0.85rem; color: #333; }


/* branding-primary-map */
.btn-primary,
button.primary,
main button[type="submit"],
.login-card button[type="submit"],
form.login-form button[type="submit"] {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}
/* Default solid action buttons in forms (not secondary/ghost) */
.form-actions > button:first-child:not(.btn-secondary):not(.btn-ghost),
.modal-actions > button:last-child:not(.btn-secondary):not(.btn-ghost) {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}
.app-nav a.active {
  background: var(--color-primary) !important;
  color: var(--color-on-primary) !important;
}
.app-bar {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.settings-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  flex-wrap: wrap;
}
.settings-preview-nav {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
}
.settings-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .settings-logos { grid-template-columns: 1fr; }
}
.settings-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border, #ddd);
  margin-bottom: 8px;
}
.settings-logo-box.light { background: #fff; }
.settings-logo-box.dark { background: #111; }
.settings-logo-box img { max-height: 48px; max-width: 100%; }
.settings-office-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.settings-office-row input[type="text"] { flex: 1; }
.ov-day.is-today,
.day-col.today,
td.is-today,
.overview-table th.is-today {
  box-shadow: inset 0 -3px 0 var(--color-primary);
}


/* time-month-clear */
.time-month-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
  font-size: 0.85rem;
}
.time-reg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.time-reg-badge.is-registered {
  background: #111;
  color: #fff;
  border: 1.5px solid #111;
}
.time-reg-badge.is-planned {
  background: #fff8e6;
  color: #7a5b00;
  border: 1.5px dashed #c9a227;
}
.time-month-table tbody tr.is-registered-row {
  background: #f3faf3;
  box-shadow: inset 4px 0 0 #1a7f37;
}
.time-month-table tbody tr.is-planned-row {
  background: #fffdf5;
  box-shadow: inset 4px 0 0 #c9a227;
}
.time-month-table tbody tr.is-registered-row:hover { background: #e7f6e9; }
.time-month-table tbody tr.is-planned-row:hover { background: #fff6d9; }
.time-month-table tbody tr.is-today.is-registered-row,
.time-month-table tbody tr.is-today.is-planned-row {
  outline: 2px solid var(--color-primary, #111);
  outline-offset: -2px;
}
.time-type-cell { white-space: nowrap; }
.time-comment-hint {
  font-size: 0.75rem;
  color: #555;
  font-weight: 500;
}

/* time-quick-sick */
.time-quick-sick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}
.btn-quick-sick {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #b91c1c;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.btn-quick-sick:hover { filter: brightness(1.08); }
#btnQuickBarnSyg {
  background: #db2777;
  border-color: #db2777;
}
.time-quick-comment {
  min-width: 180px;
  flex: 1 1 160px;
  max-width: 320px;
  padding: 6px 8px;
}


/* xm-combo — searchable employee select */
.xm-combo {
  position: relative;
  display: inline-block;
  min-width: 220px;
  max-width: 100%;
  vertical-align: middle;
}
.xm-combo-native {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}
.xm-combo-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--border-strong, #ccc);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  color: var(--text, #111);
  font: inherit;
  font-size: 0.9rem;
  min-height: 38px;
}
.xm-combo-input:focus {
  outline: none;
  border-color: var(--color-primary, #111);
  box-shadow: 0 0 0 3px var(--focus, rgba(17,17,17,0.2));
}
.xm-combo.is-open .xm-combo-input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.xm-combo-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border-strong, #ccc);
  border-top: none;
  border-radius: 0 0 var(--radius-sm, 8px) var(--radius-sm, 8px);
  box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,0.08));
}
.xm-combo-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text, #111);
}
.xm-combo-option:hover,
.xm-combo-option.is-active {
  background: var(--color-primary-soft, #f2f2f2);
}
.xm-combo-option.is-selected {
  font-weight: 600;
}
.xm-combo-option.is-selected.is-active,
.xm-combo-option.is-selected:hover {
  background: var(--color-primary, #111);
  color: var(--color-on-primary, #fff);
}
.xm-combo-empty {
  padding: 8px 12px;
  color: var(--text-muted, #666);
  font-size: 0.85rem;
}


/* settings-locations */
.settings-location-card {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  background: #fafafa;
}
.settings-location-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.settings-addr-row input { margin-right: 6px; }
.settings-depts { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #ddd; }
.settings-depts h4 { margin: 0 0 8px; }
.settings-dept-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.settings-dept-row .dept-name { flex: 1 1 160px; min-width: 140px; }
.settings-dept-row .dept-manager { flex: 1 1 160px; min-width: 140px; }


/* cvr production units */
.cvr-units-box {
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  background: #fafafa;
}
.cvr-units-list {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}
.cvr-units-list li { margin-bottom: 4px; }


/* Partial registration (mødetid without fyraften) */
.time-reg-badge.is-partial {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.time-day-banner.is-partial {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}
.time-month-table tbody tr.is-partial-row { background: #fffaf3; }
.time-month-table tbody tr.is-partial-row:hover { background: #ffedd5; }




/* Planned vs registered clock times */
.time-time-planned,
.time-end-planned {
  color: #c62828;
  font-style: italic;
  font-weight: 400;
}
.time-time-registered {
  color: #111;
  font-style: normal;
  font-weight: 700;
}
.time-plan-hint {
  margin-top: 2px;
  font-size: 0.85rem;
}

/* Multi-rotation support */

.support-rot-section { margin-top: var(--space-3); }
.support-rot-section + .support-rot-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.support-rot-heading {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
  font-weight: 700;
}
.support-page .support-lineup-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.support-member-row .slot-title-select,
.support-member-row .title-name,
.support-member-row .title-code {
  font-size: 0.875rem;
}



/* Support coverage model (tracks + week duty) */
.support-gap-cell {
  color: #a34040;
  font-weight: 600;
}
.support-td-gap {
  background: #fff5f5;
}
.support-role-card--gap {
  border-color: #a34040;
  background: #fff5f5;
}
.support-staffing-banner {
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: #f0f0f0;
  border: 1px solid #cccccc;
  font-size: 0.9rem;
}
.support-staffing-banner--bad {
  background: #fee2e2;
  border-color: #a34040;
  color: #a34040;
  font-weight: 600;
}


/* Private time-registration comment */
.comment-private-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #444;
  cursor: help;
  white-space: nowrap;
  user-select: none;
  margin-left: 6px;
}
.comment-private-label input { margin: 0; }
.row-comment { flex-wrap: wrap; align-items: center; }
.time-comment-hint.is-private { color: #6b21a8; }

/* Planlaegning layout polish */
#tabPlan .section-heading { margin-bottom: var(--space-4); }
#tabPlan .section-heading h3 { margin: 0; }
#tabPlan .section-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }
#tabPlan .period-plan-controls {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: var(--space-3);
}
#tabPlan .period-plan-toggle,
#tabPlan .period-date-field { display: flex; flex-direction: column; gap: 6px; }
#tabPlan .control-label,
#tabPlan .period-date-field > span { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; }
#tabPlan .segmented-toggle {
  display: inline-flex;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--secondary-soft);
}
#tabPlan .toggle-option { position: relative; margin: 0; min-width: 0; }
#tabPlan .toggle-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#tabPlan .toggle-option span {
  display: block;
  padding: 7px 14px;
  border-radius: calc(var(--radius-sm) - 1px);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
#tabPlan .toggle-option input:checked + span {
  background: #166534;
  color: #ffffff;
  box-shadow: var(--shadow);
}
#tabPlan .toggle-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
#tabPlan .period-date-field input { width: 100%; min-width: 150px; }
#tabPlan .period-plan-controls > button { min-height: 40px; white-space: nowrap; }
#tabPlan .period-plan-hint { margin: var(--space-3) 0 0; }
#tabPlan .plan-week-box h3 { margin-bottom: var(--space-3); }
#tabPlan .week-nav { align-items: center; margin-bottom: var(--space-4); }
#tabPlan .week-picker {
  position: relative;
  display: inline-flex;
  flex: 1 1 220px;
  min-width: 210px;
  max-width: 270px;
  min-height: 40px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
#tabPlan .week-picker:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
#tabPlan .week-picker-label {
  position: absolute;
  left: 12px;
  right: 42px;
  z-index: 1;
  overflow: hidden;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#tabPlan .week-picker input {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 42px 8px 12px;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
#tabPlan .week-picker input::-webkit-calendar-picker-indicator { opacity: 0.7; cursor: pointer; }
#tabPlan .week-bulk-row { margin-top: 0; }

@media (max-width: 760px) {
  #tabPlan .period-plan-controls { grid-template-columns: 1fr 1fr; }
  #tabPlan .period-plan-toggle { grid-column: 1 / -1; }
  #tabPlan .period-plan-controls > button { grid-column: 1 / -1; justify-self: start; }
  #tabPlan .week-nav button { flex: 1 1 auto; }
  #tabPlan .week-picker { order: -1; max-width: none; flex-basis: 100%; }
}

/* Dashboard support line: own prominent row below the banner. */
.dash-support-row {
  display: block;
  margin: 4px 0 8px;
}
.dash-support-row .dash-support-line {
  display: flex;
  width: 100%;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 600;
  border-left: 4px solid #111;
}
