/* ================================================================
   KoedTidsplan · styles.css
   ================================================================ */

:root {
  --bg:        #ffffff;
  --surface:   #f5f3ee;
  --brand:     #b8995c;
  --brand-dk:  #9a7f44;
  --sand:      #cdb389;
  --dark:      #1c1c1c;
  --brand-dim: rgba(184,153,92,.12);
  --text:      #2c2c2c;
  --muted:     #8c887e;
  --line:      rgba(0,0,0,.08);
  --line-y:    rgba(184,153,92,.28);
  --radius:    16px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --topbar-h:  30px;
  --header-h:  56px;
  --sigbar-h:  28px;
  --gold:      #b8995c;
  --dash-h:    128px;
  --day-w:     28px;      /* bredde pr. dag (stor zoom) */
  --row-h:     36px;      /* højde pr. aktivitetsrække */
}

/* ── Reset ─────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; overflow: hidden; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 13px; }
svg { display: block; flex-shrink: 0; }

/* ── App wrapper ───────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--sand);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.topbar-inner {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: #3a3020;
  padding: 0 20px;
  /* C: animation/varighed sættes dynamisk i app.js ud fra hastighed 0-5 */
  will-change: transform;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Site Header ───────────────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line-y);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  flex-shrink: 0;
  z-index: 50;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.logo-text-wrap { line-height: 1.2; }
.logo-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  display: block;
}
.logo-sub { font-size: 10px; color: var(--muted); display: block; }
.active-sag-area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}
.sag-label { flex-shrink: 0; }
.sag-prik {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  transition: background .3s;
}
.sag-prik.green { background: #4caf50; }
.sag-prik.yellow { background: #ff9800; }
.sag-prik.red { background: #f44336; }
.sag-navn {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sag-select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  max-width: 220px;
  cursor: pointer;
}
.btn-opret-sag {
  height: 32px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: filter .15s;
  white-space: nowrap;
}
.btn-opret-sag:hover { filter: brightness(1.1); }
.header-sep { width: 1px; height: 20px; background: var(--line); }
.header-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dk);
  white-space: nowrap;
}
.btn-logout {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: rgba(192,57,43,.1); color: #c0392b; }

/* ── Main Area ─────────────────────────────────────────────────── */
.main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Left Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #faf8f3;
  border-right: 1px solid var(--line-y);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
  position: relative;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,153,92,.2) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(184,153,92,.25); border-radius: 2px; }

/* Menu overskrifter (blå/mørke, ikke klikbare) */
.menu-overskrift {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand-dk);
  user-select: none;
  margin-top: 6px;
}
.menu-overskrift:first-child { margin-top: 4px; }
.menu-overskrift-ikon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

/* Underfaner (lilla/klikbare) */
.menu-underfane {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 22px;
  font-size: 12px;
  font-weight: 500;
  color: #6b5ea8;
  cursor: pointer;
  border-radius: 0 20px 20px 0;
  margin-right: 10px;
  transition: background .12s, color .12s;
  position: relative;
  user-select: none;
}
.menu-underfane:hover,
.menu-underfane.open { background: var(--brand-dim); color: var(--brand-dk); }
.menu-underfane .menu-genvej {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  background: rgba(184,153,92,.18);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dk);
  flex-shrink: 0;
}
.menu-underfane .menu-arrow {
  margin-left: auto;
  font-size: 9px;
  opacity: .5;
  transition: transform .2s;
}
.menu-underfane.open .menu-arrow { transform: rotate(90deg); opacity: 1; }
.menu-underfane-ikon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

/* Løvpunkter (punkt - kan trækkes ind på tidsplanen) */
.menu-punkt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 38px;
  font-size: 12px;
  color: var(--text);
  cursor: grab;
  transition: background .1s;
  user-select: none;
  border-radius: 0 16px 16px 0;
  margin-right: 10px;
}
.menu-punkt:hover { background: var(--brand-dim); }
.menu-punkt .menu-punkt-genvej {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 14px;
  padding: 0 3px;
  background: rgba(107,94,168,.15);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #6b5ea8;
  flex-shrink: 0;
}
.menu-punkt .menu-punkt-farve {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-punkt.dragging { opacity: .5; cursor: grabbing; }

/* Børneliste (collapsible) */
.menu-born { overflow: hidden; }
.menu-born.hidden { display: none; }

.sidebar-bottom {
  border-top: 1px solid var(--line-y);
  padding: 8px 12px;
  flex-shrink: 0;
  background: rgba(184,153,92,.05);
}
.sidebar-bottom-text {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

/* ── Content Area ──────────────────────────────────────────────── */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #f8f6f1;
}

/* ── Dashboard Panel — 5 kort + actions grid ───────────────────── */
.dashboard-panel {
  height: var(--dash-h);
  background: #fff;
  border-bottom: 1px solid var(--line-y);
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 12px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Kort-række */
.dash-cards {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  align-items: stretch;
}
.dash-card {
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
  flex: 1;
}
.dash-card-donut {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.dash-card-milepael {
  border-color: var(--brand);
  border-width: 1.5px;
  flex: 0 0 auto; /* P3: kun så bred som chips kræver */
  min-width: 0;
  background: #fdf9f4;
}
.dash-card-top {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.dash-card-icon { font-size: 14px; flex-shrink: 0; }
.dash-card-lbl  { font-size: 10px; font-weight: 600; color: var(--muted); }
.dash-card-lbl-caps { text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dk); }
.dash-card-big  { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.dash-card-date { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.dash-card-sub-lbl { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* Action-grid øverst til højre */
.dash-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  flex-shrink: 0;
}
.dash-actions-row { display: flex; gap: 4px; }
.btn-admin {
  width: auto !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 600;
  white-space: nowrap;
}

/* Notat-kort (dynamisk smallere — #2: viger plads til dato/dage-kortet) */
.dash-card-notat {
  flex: 1 1 0;        /* #2: må krympe under indhold så combo-dato altid vises fuldt */
  min-width: 120px;
  max-width: none;

  gap: 4px;
  position: relative;
  overflow: hidden;
  background-image: url('../images/Hero.png'); /* P3: dronefoto vandmærke */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Halvtransparent overlay for læsbarhed */
.dash-card-notat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.84);
  z-index: 0;
  pointer-events: none;
  border-radius: 9px;
}
.dash-card-notat > * { position: relative; z-index: 1; }
/* Kombineret Planlagt + Ny slutdato */
.dash-card-combo-dato {
  flex: 0 0 auto;
  /* Løst2: ingen beskæring — kort vokser efter indhold */
  width: auto;
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--line-y);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  background: #fff;
}
.combo-dato-left, .combo-dato-right {
  flex: 0 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* #2: ingen stram min-width der klipper — vokser efter indhold */
  min-width: max-content;
  white-space: nowrap;
}
/* #2: Periode i egen midterkolonne — centreret stort dagstal */
.combo-dato-mid {
  flex: 0 0 auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  white-space: nowrap;
}
/* #2: stort centreret periode-dagstal under "Periode:" */
.combo-dato-periode-stor {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: var(--brand-dk);
  line-height: 1.1;
  margin-top: 2px;
}


/* Løst2: redigerbare dato-felter — vis cursor + hover */
.dash-card-date.redigerbar { cursor: pointer; border-bottom: 1px dashed transparent; }
.dash-card-date.redigerbar:hover { border-bottom-color: var(--line-y); }

.combo-dato-divider {
  width: 1px;
  background: var(--line-y);
  flex-shrink: 0;
  margin: 8px 0;
}
.sag-notat-input {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  background: transparent; /* P3: gennemsigtig — Hero-foto anes bagved */
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  padding: 5px 7px;
  transition: border-color .15s;
  min-height: 0;
}
.sag-notat-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.btn-gem-notat {
  align-self: flex-end;
  height: 22px;
  padding: 0 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter .15s;
  margin-top: 2px;
}
.btn-gem-notat:hover { filter: brightness(1.1); }
.dashboard-donut-wrap {
  position: relative;
  flex-shrink: 0;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  pointer-events: none;
  text-align: center;
  line-height: 1.2;
}
.donut-tooltip {
  position: absolute;
  background: var(--dark);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  z-index: 100;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
}
.donut-toggle {
  display: none; /* P1: Timer/Procent-knapper skjult — total vises fast i midten */
}
.btn-donut {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line-y);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-donut.active,
.btn-donut:hover { background: var(--brand-dim); border-color: var(--brand); color: var(--brand-dk); }
.dashboard-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
  font-size: 11px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap; /* P2: Forsinkelse på én linje */
  flex-wrap: nowrap;
}
.status-lbl {
  color: var(--muted);
  white-space: nowrap;
}
.status-red { color: #e53935; font-weight: 600; }
.status-green { color: #43a047; font-weight: 600; }
.dashboard-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 200px;
  justify-content: flex-end;
}
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: background .12s, border-color .12s;
  cursor: pointer;
}
.btn-icon:hover { background: var(--brand-dim); border-color: var(--brand); }
.btn-icon.active { background: var(--brand-dim); border-color: var(--brand); color: var(--brand-dk); opacity: 1; }
.btn-icon:not(.active) { opacity: 0.55; }
.btn-icon:hover { opacity: 1; }
/* A2: zoom-knap altid fuld opacitet (niveau vises via badge 1-5) */
#btnSkala { opacity: 1 !important; }


/* ── Gantt Outer ───────────────────────────────────────────────── */
.gantt-outer {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left fixed column */
.gantt-left {
  width: 180px;
  flex-shrink: 0;
  background: #faf8f3;
  border-right: 1px solid var(--line-y);
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow: hidden;
}
/* Venstre header — 3 sub-rækker flugter med uge-akse, dag-akse, vejr-akse */
.gantt-left-header {
  height: auto; /* følger date-axis: 48px (vejr fra) / 80px (vejr til) */
  display: flex;

  flex-direction: column;
  align-items: stretch;
  padding: 0;
  flex-shrink: 0;
  background: #faf8f3;
  border-bottom: 1px solid var(--line-y);
  position: relative;
  z-index: 5;
}
/* Svarer til .gantt-weeks-row (24px) */
.glh-weeks {
  height: 24px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(184,153,92,.06);
}
/* Svarer til .gantt-days-row (24px) — "Faggruppe / Aktivitet" her */
.glh-days {
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line-y);
}
/* Svarer til .gantt-weather-row (32px) */
.glh-weather {
  height: 32px;
  flex-shrink: 0;
}
/* A1: brug scrollTop-sync i stedet for translateY — eliminerer blokerende kasse */
.gantt-rows-left {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;      /* Firefox */
}
.gantt-rows-left::-webkit-scrollbar { display: none; }  /* Chrome/Edge */
.gantt-row-label {
  height: var(--row-h);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
  overflow: hidden;
}
.gantt-row-label:hover { background: var(--brand-dim); }
.gantt-row-label.selected { background: var(--brand-dim); }
.gantt-row-label-farve {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gantt-row-label-tekst {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.gantt-row-label-tekst small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-row-milestone-label {
  font-size: 11px;
  color: var(--brand-dk);
  font-weight: 700;
}

/* Right scrollable area */
.gantt-right {
  flex: 1;
  overflow: auto;
  position: relative;
  scroll-behavior: auto;
}
.gantt-right::-webkit-scrollbar { height: 8px; width: 8px; }
.gantt-right::-webkit-scrollbar-track { background: var(--surface); }
.gantt-right::-webkit-scrollbar-thumb { background: rgba(184,153,92,.3); border-radius: 4px; }
.gantt-right::-webkit-scrollbar-thumb:hover { background: rgba(184,153,92,.6); }

/* Gantt inner (width set by JS) */
.gantt-inner {
  position: relative;
  min-height: 100%;
}

/* Date axis */
.gantt-date-axis {
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: #fff;
  border-bottom: 2px solid var(--line-y);
  display: flex;
  flex-direction: column;
}
.gantt-weeks-row {
  display: flex;
  height: 24px;
  border-bottom: 1px solid var(--line);
}
.gantt-week-cell {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dk);
  border-right: 1px solid var(--line-y);
  overflow: hidden;
  white-space: nowrap;
  background: rgba(184,153,92,.06);
}
.gantt-days-row {
  display: flex;
  height: 24px;
}
.gantt-day-cell {
  flex-shrink: 0;
  width: var(--day-w);
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  position: relative;
}
.gantt-day-cell.weekend { background: rgba(0,0,0,.03); color: #bbb; }
.gantt-day-cell.today { background: rgba(184,153,92,.2); color: var(--brand-dk); font-weight: 700; }
/* Helligdag-celle i dato-aksen */
.gantt-day-cell.helligdag {
  background: rgba(229,57,53,.08);
  color: #c62828;
  font-weight: 700;
}
.gantt-day-cell.helligdag::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e53935;
}
/* #3: Helligdag-markør i gantt-kroppen — lodret stribe + navn-label */
.gantt-helligdag-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(229,57,53,.06);
  border-left: 1px dashed rgba(229,57,53,.45);
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
.gantt-helligdag-navn {
  position: absolute;
  left: 50%;                  /* #8: centreret i kolonnen */
  font-size: 13px;
  font-weight: 700;
  color: #c62828;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  /* #8: centreret horisontalt + vendt 180 grader (læses nedefra-op) */
  transform: translate(-50%, -50%) rotate(180deg);
  transform-origin: center;
  line-height: 1;
  opacity: .8;
}



.gantt-day-cell.today::after {
  content: '';
  position: absolute;
  bottom: 0;

  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--brand);
}

/* Weather row */
.gantt-weather-row {
  height: 28px;
  display: flex;
  background: rgba(184,153,92,.04);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 48px;
  z-index: 7;
}
.gantt-weather-cell {
  flex-shrink: 0;
  width: var(--day-w);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-right: 1px solid var(--line);
  cursor: default;
  gap: 1px;
}
.gantt-weather-cell .temp { font-size: 9px; color: var(--muted); }

/* Gantt rows area */
.gantt-rows-area {
  position: relative;
}

/* Gantt row */
.gantt-row {
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
}
.gantt-row.weekend-bg { background: rgba(0,0,0,.015); }
.gantt-row:hover { background: rgba(184,153,92,.04); }
.gantt-row.selected { background: rgba(184,153,92,.08); }

/* Day columns in rows (background grid) */
.gantt-grid-col {
  flex-shrink: 0;
  width: var(--day-w);
  height: 100%;
  border-right: 1px solid var(--line);
  pointer-events: none;
}
/* A7: tydeligere weekend-kolonne */
.gantt-grid-col.weekend { background: rgba(0,0,0,.07); }
.gantt-grid-col.today-col { background: rgba(184,153,92,.12); }

/* Activity bar */
.gantt-bar {
  position: absolute;
  top: 5px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: filter .1s, box-shadow .1s;
  z-index: 2;
  white-space: nowrap;
}
.gantt-bar:hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 3;
}
.gantt-bar.selected {
  outline: 2px solid var(--dark);
  outline-offset: 1px;
  z-index: 4;
}
.gantt-bar.dragging {
  opacity: .7;
  cursor: grabbing;
  z-index: 10;
}
/* Mini-visning (lille skala) */
.gantt-bar.mini {
  height: 18px;
  top: 9px;
  border-radius: 4px;
  padding: 0 5px;
}
.gantt-bar.mini .bar-label { display: none; }
.gantt-bar.mini .bar-label-mini { display: flex !important; }

.bar-label {
  position: relative; /* G4: hæves over weekend-dimmers (z-index:1) */
  z-index: 2;
  font-size: 11px;
  font-weight: 500;
  color: rgba(0,0,0,.75);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.bar-label-mini {
  display: none;
  font-size: 9px;
  font-weight: 600;
  color: rgba(0,0,0,.65);
  overflow: hidden;
  pointer-events: none;
}
.bar-bim7aa {
  font-size: 9px;
  color: rgba(0,0,0,.45);
  margin-left: 5px;
  flex-shrink: 0;
  pointer-events: none;
}
.bar-timer {
  font-size: 10px;
  color: rgba(0,0,0,.55);
  margin-left: auto;
  padding-left: 6px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Resize handle */
.bar-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: ew-resize;
  border-radius: 0 6px 6px 0;
  background: rgba(0,0,0,.1);
  opacity: 0;
  transition: opacity .1s;
}
.gantt-bar:hover .bar-resize-handle { opacity: 1; }

/* Milestone (diamond) */
.gantt-milestone {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 18px;
  height: 18px;
  background: var(--brand);
  border: 2px solid var(--brand-dk);
  cursor: pointer;
  transition: transform .1s, filter .1s;
  border-radius: 3px;
}
.gantt-milestone:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
  filter: brightness(1.1);
}
.gantt-milestone.selected {
  outline: 2px solid var(--dark);
  outline-offset: 2px;
}
.gantt-milestone-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dk);
  white-space: nowrap;
  pointer-events: none;
}

/* Today line */
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(184,153,92,.7);
  z-index: 5;
  pointer-events: none;
}
.gantt-today-line::before {
  content: 'I dag';
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 9px;
  color: var(--brand-dk);
  font-weight: 700;
  white-space: nowrap;
}

/* Dependency arrows SVG overlay */
.gantt-deps-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}
/* A5: dep-path — synlig linje (pointer-events: none — hit-area håndterer klik) */
.dep-path {
  fill: none;
  stroke: #5a7fa0;
  stroke-width: 2.5;
  stroke-dasharray: none;
  opacity: 1;
  pointer-events: none;
  transition: stroke .15s, stroke-width .15s;
}
.dep-path.dep-selected { stroke: #e53935; stroke-width: 3px; }
.dep-arrow {
  fill: #5a7fa0;
  opacity: 1;
  pointer-events: none;
  transition: fill .15s;
}
.dep-arrow.dep-selected { fill: #e53935; }
/* A5: endepunkt-prikker (MS Project / Frappe Gantt stil) */
.dep-dot {
  fill: #5a7fa0;
  stroke: #fff;
  stroke-width: 1.5;
  pointer-events: none;
  transition: r .1s, fill .15s;
}
.dep-dot.dep-selected {
  fill: #e53935;
  stroke: #fff;
  stroke-width: 2;
}
/* A5: label ved valgt dep-sti */
.dep-label {
  font-size: 10px;
  fill: #e53935;
  font-family: var(--font);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: auto;
  font-weight: 600;
}

/* Drop target highlight */
.gantt-drop-target {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px dashed var(--brand);
  pointer-events: none;
  z-index: 6;
}

/* Drag ghost */
.gantt-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: .7;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  transform: translate(-50%, -120%);
}

/* Afhaengighed-vælger */
.dep-select-mode .gantt-bar {
  outline: 2px dashed var(--brand);
  cursor: crosshair;
}

/* ── Scroll Controls — se grid-regel nedenfor (~l.1920) ──────── */
.scroll-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-y);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background .1s, border-color .1s;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.scroll-btn:hover { background: var(--brand-dim); border-color: var(--brand); }

/* ── Signature Bar ─────────────────────────────────────────────── */
.sig-bar {
  height: var(--sigbar-h);
  background: var(--dark);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  flex-shrink: 0;
  overflow: hidden;
}
/* A9: sig-bar — kun <b> (tast) er guld, al span-tekst hvid */
.sig-bar span {
  font-size: 10px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}
.sig-bar b { color: rgba(184,153,92,1); font-weight: 700; }

/* ── Context Menu ──────────────────────────────────────────────── */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 1000;
  min-width: 160px;
  overflow: hidden;
}
.ctx-item {
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.ctx-item:hover { background: var(--brand-dim); color: var(--brand-dk); }
.ctx-sep {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}
.ctx-danger { color: #e53935; }
.ctx-danger:hover { background: rgba(229,57,53,.08); color: #c62828; }

/* ── Modals ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Activity Modal */
.activity-modal { width: 500px; }
.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.modal-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
}
.modal-faggruppe {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.modal-faggruppe-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.modal-faggruppe-navn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.modal-date-sep { color: var(--muted); }
.modal-date-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--surface);
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  margin-left: auto;
  transition: background .1s;
}
.modal-close:hover { background: var(--line); color: var(--text); }

.modal-body { padding: 16px 18px; }
.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-row label {
  flex-shrink: 0;
  width: 80px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding-top: 7px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.modal-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s;
}
.modal-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.modal-input-sm  { width: 70px; flex: none; }
.modal-input-xs  { width: 44px; flex: none; }
.modal-input-sep { font-size: 11px; color: var(--muted); padding-top: 8px; }
.modal-timer-info {
  font-size: 11px;
  color: var(--brand-dk);
  font-style: italic;
  padding-top: 8px;
  white-space: nowrap;
}
.modal-textarea {
  flex: 1;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
  transition: border-color .15s;
}
.modal-textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.modal-checkbox-row { flex-wrap: wrap; gap: 16px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  padding-top: 0;
  width: auto;
}
.checkbox-label input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--brand); }
.bim7aa-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  background: rgba(184,153,92,.15);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dk);
  align-self: center;
  min-width: 36px;
  text-align: center;
}

/* Autocomplete */
.autocomplete-wrap { flex: 1; position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.focused { background: var(--brand-dim); color: var(--brand-dk); }
.autocomplete-item.category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  cursor: default;
  padding: 5px 12px;
}
.autocomplete-item.category:hover { background: var(--surface); color: var(--muted); }
.autocomplete-bim { font-size: 10px; color: var(--muted); margin-left: auto; }

/* File upload */
.file-upload-area { flex: 1; }
.file-list { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.file-item-remove {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.file-item-remove:hover { color: #e53935; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.btn-primary {
  height: 34px;
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter .15s;
  margin-left: auto;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  height: 34px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--brand-dim); border-color: var(--brand); color: var(--brand-dk); }
.btn-danger {
  height: 34px;
  padding: 0 14px;
  background: rgba(229,57,53,.08);
  color: #e53935;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(229,57,53,.2);
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(229,57,53,.15); }
.btn-sm {
  height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--brand-dim); }

/* New Case Modal */
.new-case-modal { width: 420px; }

/* Calendar Modal — A7: bredere for at rumme 7-kolonnes grid */
.calendar-modal { width: 680px; max-width: 96vw; }
.kal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kal-tab {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
}
.kal-tab.active { background: var(--brand-dim); border-color: var(--brand); color: var(--brand-dk); font-weight: 600; }
.kal-day-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.kal-cell {
  padding: 6px 8px;
  background: var(--bg);
  font-size: 11px;
  text-align: center;
}
.kal-cell.header {
  background: var(--surface);
  font-weight: 700;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .05em;
}
.kal-cell input[type=number] {
  width: 100%;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--line-y);
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  background: var(--surface);
}
.kal-cell input[type=number]:focus { outline: none; border-color: var(--brand); }

/* Help Modal */
.help-modal { width: 480px; }
.help-step {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.help-step:last-child { border-bottom: none; }
.help-step h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brand-dk);
}
.help-step p { font-size: 13px; color: var(--text); line-height: 1.6; }
.help-step ul { margin: 6px 0 0 16px; font-size: 13px; line-height: 1.7; }

/* Inactivity Modal */
.inactivity-modal { width: 360px; }

/* Search Modal */
.search-modal { width: 480px; }
.search-results {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .1s;
}
.search-result-item:hover { background: var(--brand-dim); }
.search-result-farve {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.search-result-navn { flex: 1; font-size: 13px; }
.search-result-sub { font-size: 11px; color: var(--muted); }

/* Konflikt-advarsel */
.konflikt-banner {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff3e0;
  border: 1px solid #ff9800;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 12px;
  color: #e65100;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 900;
  animation: bannerIn .2s ease;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Multi-bruger view */
.multi-view-separator {
  height: 2px;
  background: var(--brand-dim);
  margin: 4px 0;
  position: relative;
}
.multi-view-separator::before {
  content: attr(data-label);
  position: absolute;
  left: 8px;
  top: -8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-dk);
  background: #f8f6f1;
  padding: 0 4px;
}
.gantt-row.readonly { opacity: .6; pointer-events: none; }
.gantt-bar.readonly { cursor: default; }

/* ── Print / PDF ───────────────────────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { overflow: visible !important; height: auto !important; }
  #app { height: auto !important; overflow: visible !important; }
  .topbar, .sig-bar, .dashboard-actions, .gantt-scroll-controls,
  .sidebar, .btn-opret-sag, .btn-logout, .btn-icon { display: none !important; }
  .main-area { overflow: visible !important; }
  .content-area { overflow: visible !important; }
  .gantt-outer { overflow: visible !important; height: auto !important; }
  .gantt-right { overflow: visible !important; height: auto !important; }
  .gantt-rows-area { height: auto !important; }
  .site-header { break-inside: avoid; }
  .gantt-date-axis { position: relative !important; }
  .gantt-weather-row { position: relative !important; }
  @page { size: A3 portrait; margin: 15mm; }
  .print-header { display: block !important; }
  .print-footer { display: block !important; }
}
.print-header, .print-footer { display: none; }
.print-header {
  margin-bottom: 12px;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 8px;
}
.print-header h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; }

/* ── Responsivt ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; --day-w: 22px; --row-h: 32px; }
  .dashboard-panel { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .gantt-left { width: 130px; }
}
@media (max-width: 500px) {
  .sidebar { display: none; }
  .gantt-left { width: 100px; }
  :root { --day-w: 18px; }
  .header-right { gap: 4px; }
  .sag-select { max-width: 120px; }
}

/* ── Loading ───────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--brand);
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar global ──────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(184,153,92,.2) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { background: rgba(184,153,92,.25); border-radius: 3px; }

/* ── §3 Overrides ──────────────────────────────────────────────── */
/* Today-linje: sort og tykkere (4px) */
.gantt-today-line { width: 4px !important; background: #111 !important; box-shadow: 0 0 3px rgba(0,0,0,.3) !important; }
.gantt-today-line::before { color: #111 !important; left: 6px !important; font-weight:700 !important; }
/* Vejr-celle: større ikon + temp */
.gantt-weather-cell { height: 32px !important; font-size: 13px !important; gap: 2px !important; }
.gantt-weather-row { height: 32px !important; }
.gantt-weather-cell .temp { font-size: 10px !important; }
/* Projektvælger wrapper */
.sag-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line-y);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  max-width: 440px;
  min-width: 260px;
}
.sag-select-wrap .sag-select {
  border: none !important;
  background: transparent !important;
  height: 100%;
  flex: 1;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  padding: 0 4px 0 10px !important;
}
/* #4: planlagt start/slut skjult i sag-vælgeren (vises i dashboard i stedet) */
.sag-dato-badge { display: none !important; }

/* BIM7AA-knap styling */
.btn-icon#btnBim7aa { font-size: 9px !important; letter-spacing: -.3px; padding: 0 5px !important; }

/* ── B7/B9: Bruger-avatarer ─────────────────────────────────────── */
.header-avatars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}
.header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: 2px solid var(--bg);
  cursor: default;
  flex-shrink: 0;
  letter-spacing: -.3px;
  transition: transform .15s;
}
.header-avatar:hover { transform: scale(1.1); }
.header-avatar.aktiv {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 2px var(--brand-dim);
}

/* ── B4: Gantt-bar mellem-skala ─────────────────────────────────── */
.gantt-bar.mellem {
  height: 22px;
  top: 7px;
  font-size: 11px;
}
.gantt-bar.mellem .bar-label {
  font-size: 11px;
  padding: 0 5px;
}

/* ══════════════════════════════════════════════════════════════════
   HOVER-FLYOUT MENU
   ══════════════════════════════════════════════════════════════════ */

/* Sidebar viser kun main-kategorier */
.menu-main-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border-radius: 0 22px 22px 0;
  margin-right: 10px;
  transition: background .12s, color .12s;
  user-select: none;
  position: relative;
}
.menu-main-cat:hover {
  background: var(--brand-dim);
  color: var(--brand-dk);
}
.menu-main-cat-ikon { font-size: 18px; flex-shrink: 0; }
.menu-main-cat-navn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--dark);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-main-cat:hover .menu-main-cat-navn { color: var(--brand-dk); }
.menu-main-cat-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(184,153,92,.12);
  border-radius: 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Flyout panel (position:fixed, appended to body) */
.menu-flyout {
  position: fixed;
  z-index: 500;
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  min-width: 200px;
  max-width: 280px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}
.menu-flyout-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid rgba(0,0,0,.04);
  user-select: none;
}
.menu-flyout-item:last-child { border-bottom: none; }
.menu-flyout-item:hover,
.menu-flyout-item.has-children:hover {
  background: var(--brand-dim);
  color: var(--brand-dk);
}
.menu-flyout-item.dragging { opacity: .5; }
.menu-flyout-badge {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -.3px;
  flex-shrink: 0;
  color: #000 !important;
}
.menu-flyout-tekst {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-flyout-arr {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════
   DONUT ZOOM OVERLAY
   ══════════════════════════════════════════════════════════════════ */
.donut-zoom-overlay {
  position: fixed;
  z-index: 300;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line-y);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: modalIn .15s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.donut-zoom-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
  max-width: 220px;
  padding-top: 8px;
}
.donut-zoom-leg-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
}
.donut-zoom-seg { cursor: pointer; transition: stroke-width .12s; }

/* ══════════════════════════════════════════════════════════════════
   NÆSTE MILEPÆLE STRIP
   ══════════════════════════════════════════════════════════════════ */
.milepael-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  overflow: hidden;
  max-width: 380px;
}
.milepael-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 90px;
  transition: transform .12s;
}
.milepael-chip.naest {
  border-color: var(--brand);
  background: var(--brand-dim);
  box-shadow: 0 2px 6px rgba(184,153,92,.2);
  transform: scale(1.04);
}
.milepael-chip-navn {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dk);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.milepael-chip-dato { font-size: 10px; color: var(--muted); }
.milepael-chip-dage { font-size: 11px; font-weight: 700; color: var(--brand-dk); }
.milepael-chip-dage.red { color: #e53935; }
.milepael-chip-ios { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); margin-top: 2px; cursor: pointer; user-select: none; }
.milepael-chip-ios input { margin: 0; cursor: pointer; }

/* #6: ÉN iOS-widget toggle i MILEPÆLE-kassens header (1 kryds pr. bruger) */
.milepael-ios-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dk);
  cursor: pointer;
  user-select: none;
  padding: 1px 6px;
  border: 1px solid var(--line-y);
  border-radius: 10px;
  background: var(--surface);
}
.milepael-ios-toggle input { margin: 0; cursor: pointer; accent-color: var(--brand); }
.milepael-ios-toggle:hover { border-color: var(--brand); background: var(--brand-dim); }


.milepael-pil { font-size: 14px; color: var(--brand); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════
   HEADER STATUS PRIK MED FORKLARING
   ══════════════════════════════════════════════════════════════════ */
.header-status-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.header-status-tekst {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .02em;
}
.sag-prik.green + .header-status-tekst,
.header-status-wrap .sag-prik.green ~ .header-status-tekst { color: #4caf50; }
.header-status-wrap .sag-prik.yellow ~ .header-status-tekst { color: #ff9800; }
.header-status-wrap .sag-prik.red ~ .header-status-tekst { color: #f44336; }

/* ══════════════════════════════════════════════════════════════════
   DRAG SNAP LINJE (vises ved dragover på gantt)
   ══════════════════════════════════════════════════════════════════ */
.gantt-drop-snap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brand);
  opacity: .85;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 0 6px rgba(184,153,92,.6);
}
.gantt-drop-snap::after {
  content: attr(data-dato);
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════
   MENU: HOVEDNKATEGORIER (sidebar) + KEYBOARD STATES
   ══════════════════════════════════════════════════════════════════ */
.menu-main-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 8px;
  margin: 2px 6px;
  transition: background .12s;
  user-select: none;
}
.menu-main-cat:hover,
.menu-main-cat.kb-active {
  background: var(--brand-dim);
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
/* A6: ikon-slot — fixer SVG-indryk for MASKINER gravko */
.menu-main-cat-ikon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-main-cat-ikon svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.menu-main-cat-navn {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text);
  text-transform: uppercase;
}
.menu-main-cat-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  margin-left: auto;  /* altid højre side */
}

/* Flyout */
.menu-flyout {
  position: fixed;
  z-index: 9000;
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  min-width: 200px;
  padding: 4px 0;
}
.menu-flyout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .1s;
  user-select: none;
  border-radius: 6px;
  margin: 1px 4px;
}
.menu-flyout-item:hover,
.menu-flyout-item.kb-focused {
  background: var(--brand-dim);
  outline: 1.5px solid var(--brand);
  outline-offset: -1.5px;
}
.menu-flyout-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.menu-flyout-tekst {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.menu-flyout-arr {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}
.menu-flyout-item.dragging {
  opacity: .5;
}
/* ─── Drop-cursor ghost: følger musen centreret ──────────────── */
.gantt-drop-cursor-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1c1c1c;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  display: none;
  border: 2px solid rgba(0,0,0,.12);
  opacity: 0.9;
}

.gantt-drag-ghost {
  position: fixed;
  top: -100px;
  left: -100px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1c1c1c;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* Aktivitets status-prik selector i modal */
.modal-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.status-prik-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
  flex-shrink: 0;
}
.status-prik-btn:hover { transform: scale(1.15); }
.status-prik-btn.selected { border-color: #333; transform: scale(1.15); }
.status-prik-btn.graa  { background: #bbb; }
.status-prik-btn.groen { background: #4caf50; }
.status-prik-btn.gul   { background: #ff9800; }
.status-prik-btn.roed  { background: #f44336; }

/* ── Status-prik på gantt-bar ────────────────────────────────── */
.bar-status-dot {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.25);
}
.bar-status-dot.status-groen { background: #4caf50; }
.bar-status-dot.status-gul   { background: #ff9800; }
.bar-status-dot.status-roed  { background: #f44336; }

/* Inline status-prik i gantt venstre label */
.gantt-label-status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.gantt-label-status-dot.status-groen { background: #4caf50; }
.gantt-label-status-dot.status-gul   { background: #ff9800; }
.gantt-label-status-dot.status-roed  { background: #f44336; }

/* ── Kommende milepæl chip: tykkere kant ─────────────────────── */
.milepael-chip.kommende-milepael {
  border: 2.5px solid var(--brand-dk) !important;
  box-shadow: 0 0 0 1px rgba(154,127,68,.2);
}

/* ── Dashboard actions: 2×4 grid ─────────────────────────────── */
.dashboard-actions {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 3px;
  align-self: start;
}

/* ── Scroll Controls: kryds (▲ / ◀ ▶ / ▼) + home ────────────── */
.gantt-scroll-controls {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
  gap: 3px;
  position: fixed;
  bottom: calc(var(--sigbar-h) + 12px);
  right: 14px;
  z-index: 60;
}
/* Eksplicit placering — kryds-layout */
#scrollUp    { grid-column: 2; grid-row: 1; }
#scrollLeft  { grid-column: 1; grid-row: 2; }
#scrollRight { grid-column: 3; grid-row: 2; }
#scrollDown  { grid-column: 2; grid-row: 3; }
#btnGotoStart { grid-column: 2; grid-row: 2; }
.gantt-scroll-controls .scroll-btn {
  width: 30px;
  height: 30px;
}
.gantt-scroll-controls .scroll-btn-home {
  width: 30px;
  height: 30px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--brand);
  border: none;
  color: #fff;
  box-shadow: 0 1px 4px rgba(184,153,92,.35);
  transition: filter .15s;
}
.gantt-scroll-controls .scroll-btn-home:hover {
  filter: brightness(1.15);
}

/* ── Emoji-tema: brand-farvet filter KUN på kategori-ikoner ──────────── */
/* A8: filter fjernet fra .menu-flyout-badge — hue-rotate forskød faggruppe-
   farven (fx Maler grøn→gul). Badge skal vise EKSAKT getFagruppeColor-hex. */
.menu-main-cat-ikon {
  filter: sepia(0.55) saturate(1.4) hue-rotate(-15deg) brightness(0.82);
}

/* SVG-knapper i dash-actions arver brand-farve */
.btn-icon svg { color: var(--brand-dk); }

/* ─── Flyout nummer-badge ─────────────────────────────────────────────────── */
.menu-flyout-num {
  display: inline-block;
  min-width: 14px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  margin-left: auto;  /* P2: tal yderst til højre */
  padding-left: 6px;
  text-align: right;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.menu-flyout-item.kb-focused .menu-flyout-num { opacity: 1; color: var(--brand-dk); }

/* ─── Hover card ──────────────────────────────────────────────────────────── */
.activity-hover-card {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--line-y);
  border-radius: 8px;
  padding: 10px 13px;
  min-width: 200px;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
  display: none;
}
.ahc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}
.ahc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ahc-navn { flex: 1; }
.ahc-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}
.ahc-row span:last-child { color: var(--text); font-weight: 500; }
.ahc-note {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

/* ─── Drop-cursor snap linje (cursor mode) ───────────────────────────────── */
.gantt-drop-snap-cursor {
  border-left: 2px solid var(--brand) !important;
  background: transparent !important;
  box-shadow: 0 0 8px rgba(33,150,243,.5) !important;
  opacity: 1 !important;
}

/* #5: Grå dag-snap markør — fremhæver hele dag-kolonnen under cursoren */
/* Fejl2: dep-snap-håndtag — små bokse i start/slut på hver bar i dep-mode */
.gantt-dep-snap-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: #fff;
  border: 2px solid var(--brand, #b8995c);
  z-index: 6;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.gantt-dep-snap-handle.start { left: -6px; }
.gantt-dep-snap-handle.slut  { right: -6px; }
.gantt-dep-snap-handle:hover { background: var(--brand, #b8995c); transform: translateY(-50%) scale(1.3); }
.gantt-dep-snap-handle.kilde { border-color: #2563eb; background: #2563eb; }
/* Fremhævet mål-snap når musen er tæt under træk af forbindelse */
.gantt-dep-snap-handle.snap-hover {
  border-color: #1e90ff;
  background: #1e90ff;
  transform: translateY(-50%) scale(1.5);
  box-shadow: 0 0 8px rgba(30,144,255,.7);
}

.gantt-bar.dep-source { outline: 2px solid #2563eb; outline-offset: 1px; }

/* Bar nået sin afhængigheds-låsegrænse under træk (kan ikke flyttes længere tilbage) */
.gantt-bar.dep-locked {
  outline: 2px solid #e53935;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(229,57,53,.25), 0 2px 8px rgba(0,0,0,.2);
}

/* Mål-boks fremhævet mens en forbindelse trækkes hen over den */
.gantt-bar.dep-drop-target {
  outline: 2px solid #1e90ff;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(30,144,255,.25);
}

.gantt-drop-day-snap {

  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,.16);
  border-left: 1px solid rgba(0,0,0,.25);
  border-right: 1px solid rgba(0,0,0,.25);
  pointer-events: none;
  z-index: 18;
  display: none;
}
.gantt-drop-day-snap::after {
  content: attr(data-dato);
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}


/* ─── Admin modal ────────────────────────────────────────────────────────── */
#adminOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 5000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
}
.admin-modal {
  background: #fff;
  border-radius: 12px;
  width: min(900px, 96vw);
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.admin-modal h2 { margin: 0 0 20px; font-size: 18px; font-weight: 700; }
.admin-section { margin-bottom: 24px; }
.admin-section h3 {
  font-size: 12px; font-weight: 700; margin: 0 0 8px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  text-align: left; padding: 4px 8px;
  background: var(--surface); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-aktiv-row td { background: rgba(33,150,243,.07); }
.admin-btn-danger {
  background: #e53935; color: #fff;
  border: none; border-radius: 6px;
  padding: 7px 14px; font-size: 12px; cursor: pointer; margin-right: 8px;
}
.admin-btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 14px; font-size: 12px; cursor: pointer;
}

/* F6: Rubber-band multi-selektion */
.gantt-rubber-band {
  position: absolute;
  display: none;
  border: 1.5px solid var(--brand, #c8a96e);
  background: rgba(200, 169, 110, 0.12);
  pointer-events: none;
  z-index: 50;
}

/* ================================================================
   Admin — 7 foldbare afsnit (admin.js)
   ================================================================ */
.admin-head { margin-bottom: 14px; }
.admin-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg);
  overflow: hidden;
}
.admin-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  background: var(--surface);
}
.admin-fold > summary::-webkit-details-marker { display: none; }
.admin-fold > summary:hover { background: var(--brand-dim); }
.admin-fold[open] > summary { border-bottom: 1px solid var(--line); }
.admin-fold-nr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.admin-fold-body { padding: 14px; }
.admin-hint { font-size: 11px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.admin-hint code { background: var(--surface); padding: 1px 5px; border-radius: 3px; }

.admin-inp {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 5px;
  padding: 4px 7px; font-size: 12px; font-family: inherit; color: var(--text);
  background: var(--bg);
}
.admin-inp:focus { outline: none; border-color: var(--brand); }
.admin-inp-tast { text-align: center; font-weight: 600; }
.admin-pos-num { text-align: center; font-weight: 700; color: var(--muted); }

.admin-flyt {
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 4px; cursor: pointer; width: 22px; height: 20px;
  font-size: 9px; color: var(--text); padding: 0; line-height: 1;
}
.admin-flyt:hover:not(:disabled) { background: var(--brand-dim); border-color: var(--brand); }
.admin-flyt:disabled { opacity: .3; cursor: default; }

.admin-del {
  border: none; background: none; cursor: pointer;
  color: #c0392b; font-size: 14px; font-weight: 700; padding: 2px 5px; border-radius: 4px;
}
.admin-del:hover { background: rgba(192,57,43,.1); }

.admin-add {
  margin-top: 8px; border: 1px dashed var(--brand); background: none;
  color: var(--brand-dk); border-radius: 6px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.admin-add:hover { background: var(--brand-dim); }

.admin-init-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px; padding: 0 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #1c1c1c; /* sort tekst (5.5) */
}

/* Skabelon (afsnit 7) — én smal, høj kolonne */
.admin-skabeloner { display: flex; flex-direction: column; gap: 14px; }
.admin-skabelon { border: 1px solid var(--line); border-radius: 7px; padding: 10px; }
.admin-skabelon-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.admin-skabelon-navn { font-weight: 700; flex: 1; }
.admin-mp-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.admin-skabelon-kol { list-style: none; margin: 0; padding: 0; max-width: 320px; display: flex; flex-direction: column; gap: 5px; }
.admin-skabelon-kol li { display: flex; align-items: center; gap: 5px; }
.admin-post-inp { flex: 1; }

.admin-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px;
}




/* ── Login (Fase 2) ────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f3ede1 0%, #e7dcc6 100%);
}
.login-card {
  width: 340px; max-width: 90vw;
  background: #fff; border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 12px;
  font-family: var(--font, 'DM Sans', sans-serif);
}
.login-logo { height: 46px; width: auto; object-fit: contain; align-self: center; margin-bottom: 4px; }
.login-title { font-family: var(--font-display, 'Playfair Display', serif); font-size: 22px; margin: 0; text-align: center; color: #2a2418; }
.login-sub { margin: 0 0 8px; text-align: center; color: var(--muted, #8a7d63); font-size: 13px; }
.login-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #5a4f3a; }
.login-input {
  padding: 10px 12px; border: 1px solid var(--line-y, #d8cdb4); border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color .15s;
}
.login-input:focus { border-color: var(--brand, #b8995c); }
.login-fejl { color: #c0392b; font-size: 12px; min-height: 16px; text-align: center; }
.login-btn {
  margin-top: 6px; padding: 11px; border: none; border-radius: 8px;
  background: var(--brand, #b8995c); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: filter .15s;
}
.login-btn:hover:not(:disabled) { filter: brightness(1.07); }
.login-btn:disabled { opacity: .6; cursor: default; }

/* ── Admin: rolle-badge + invite-knap ──────────────────────────── */
.admin-rolle-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; background: #e7dcc6; color: #5a4f3a;
}
.admin-rolle-badge.er-admin { background: var(--brand, #b8995c); color: #fff; }
.admin-invite {
  padding: 4px 8px; border: 1px solid var(--line-y, #d8cdb4); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 11px; white-space: nowrap;
}
.admin-invite:hover { background: var(--bg, #f3ede1); }

/* Planlagt start/slut — lodrette stiplede linjer (sættes inline i JS) */
.gantt-planlagt-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}
.gantt-planlagt-line::before {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Admin: Sager-afsnit (afsnit 8) ────────────────────────────── */
.admin-sager-gruppe { margin-bottom: 18px; }
.admin-sager-ejer {
  font-size: 13px; font-weight: 700; color: var(--brand-dk, #5a4f3a);
  margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line-y, #d8cdb4);
}
.admin-sag-kort {
  border: 1px solid var(--line-y, #d8cdb4); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; background: var(--surface, #fff);
}
.admin-sag-bruger, .admin-sag-admin {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px;
}
.admin-sag-admin { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-y, #d8cdb4); }
.admin-sag-felt { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted, #8a7d63); }
.admin-sag-felt input, .admin-sag-felt select {
  font-size: 12px; padding: 4px 6px; border: 1px solid var(--line-y, #d8cdb4);
  border-radius: 4px; background: var(--surface, #fff); font-weight: 400; color: var(--text, #2a2418);
}
.admin-sag-felt input:disabled { background: var(--bg, #f3ede1); color: var(--muted, #8a7d63); }
