/* Sagsstyring — appens stilark. Indlæses af index.php med versionsnummer,
   fordi nginx cacher .css i 7 dage. */

/* ══════════════════════════════════════════
   DESIGN: Industrial precision — mørkt, markant,
   som et professionelt geodata-cockpit
══════════════════════════════════════════ */
:root {
  --bg:        #0a0c10;
  --surface:   #111318;
  --surface2:  #181c24;
  --surface3:  #1e2330;
  --border:    #252b3b;
  --border2:   #2e3650;
  --accent:    #3b82f6;
  --accent-d:  #1d4ed8;
  --accent-g:  rgba(59,130,246,0.1);
  --teal:      #14b8a6;
  --green:     #22c55e;
  --yellow:    #eab308;
  --red:       #ef4444;
  /* Daempet roed til prioritet. Signalroed hoerer til fejl og advarsler; paa
     mange smaa flader i kalenderen bliver den uroligt at se paa. */
  --prio-roed:       #d08077;
  --prio-roed-flade: rgba(208,128,119,0.13);
  --prio-blaa:       #7fa8cf;
  --purple:    #a78bfa;
  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #475569;
  --sidebar:   200px;
  --topbar:    56px;
  --radius:    10px;
  --radius-lg: 16px;
}
*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html { font-size: 14px; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── LOADER ── */
#loader {
  position: fixed; inset:0;
  background: var(--bg);
  display: flex; align-items:center; justify-content:center;
  z-index: 9999;
  flex-direction:column; gap:16px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset:0;
  background: var(--bg);
  display: none; align-items:center; justify-content:center;
  z-index: 500;
  background-image:
    radial-gradient(ellipse 600px 400px at 0% 100%, rgba(59,130,246,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 100% 0%, rgba(20,184,166,0.04) 0%, transparent 60%);
}
#login-screen.visible { display: flex; }
.login-wrap {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.06), 0 40px 80px rgba(0,0,0,0.6);
}
.login-brand {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 28px;
}
.login-logo {
  font-family: 'Fira Code', monospace;
  font-size: 26px; font-weight: 500;
  color: var(--accent);
  letter-spacing: -1px;
}
.login-brand-sub {
  font-size: 12px; color: var(--text3);
  letter-spacing: 2px; text-transform: uppercase; font-weight: 500;
}
.login-wrap label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.login-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text); font-family: inherit; font-size: 14px;
  outline: none; margin-bottom: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.btn-login {
  width: 100%; padding: 12px;
  background: var(--accent); color: white;
  border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.3px;
}
.btn-login:hover { background: var(--accent-d); transform: translateY(-1px); }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height:18px; text-align:center; }

/* ── APP SHELL ── */
#app { display: none; }
#app.visible { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left:0; top:0; bottom:0;
  z-index: 100;
}
.sb-brand {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sb-logo {
  font-family: 'Fira Code', monospace;
  font-size: 16px; font-weight: 500;
  color: var(--accent); letter-spacing: -0.5px;
}
.sb-logo-sub { font-size: 10px; color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase; }

.sb-nav { flex:1; padding: 10px 8px; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text3);
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer; color: var(--text2); font-weight: 500;
  margin-bottom: 2px; font-size: 13px;
  transition: all 0.12s;
  border: 1px solid transparent;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-g);
  color: var(--accent);
  border-color: rgba(59,130,246,0.18);
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink:0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width:18px; text-align:center;
}
.nav-badge.red { background: var(--red); }
.nav-badge.yellow { background: var(--yellow); color: #000; }

.sb-user {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.user-av {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content:center;
  font-weight: 700; font-size: 12px; color: white; flex-shrink:0;
}
.user-av.scanner { background: linear-gradient(135deg, var(--teal), var(--green)); }
.user-av.eb      { background: linear-gradient(135deg, var(--yellow), var(--teal)); }
.user-av.okonomi { background: linear-gradient(135deg, var(--purple), var(--accent)); }
.sb-username { font-size: 12px; font-weight: 600; }
.sb-role     { font-size: 10px; color: var(--text3); }
/* Sprogvælger under brugerens navn — lille og rolig, den bruges sjældent. */
.sb-sprog {
  margin-top: 3px; font-size: 10px; padding: 1px 4px; border-radius: 4px;
  background: transparent; color: var(--text3); border: 1px solid var(--border); cursor: pointer;
}
.sb-sprog:hover { color: var(--text); border-color: var(--text3); }
.login-sprog { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text3); }
.login-sprog a { color: var(--text3); cursor: pointer; text-decoration: none; padding: 2px 4px; }
.login-sprog a:hover, .login-sprog a.aktiv { color: var(--text); text-decoration: underline; }
.btn-logout {
  margin-left: auto; background: none; border: none;
  color: var(--text3); cursor: pointer; font-size: 14px;
  padding: 4px; border-radius: 6px; transition: color 0.15s;
}
.btn-logout:hover { color: var(--red); }

/* ── MAIN ── */
#main { margin-left: var(--sidebar); flex:1; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg);
  position: sticky; top:0; z-index: 50;
}
.topbar-left { display: flex; align-items:center; gap: 12px; }
.page-title { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.page-count { font-size: 11px; color: var(--text3); background: var(--surface2); padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.topbar-right { display: flex; gap: 8px; align-items: center; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.12s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-d); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface3); }
.btn-teal { background: rgba(20,184,166,0.12); color: var(--teal); border: 1px solid rgba(20,184,166,0.2); }
.btn-red { background: rgba(239,68,68,0.08); color: var(--red); border: 1px solid rgba(239,68,68,0.15); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── CONTENT ── */
.content { padding: 20px 24px; flex:1; }

/* ── STATS ROW ── */
.stats-row { display: flex; gap: 12px; margin-bottom: 20px; }
.stat {
  flex:1; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat-lbl { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.stat-val { font-family: 'Fira Code', monospace; font-size: 24px; font-weight: 500; }
.stat-val.blue { color: var(--accent); }
.stat-val.green { color: var(--green); }
.stat-val.yellow { color: var(--yellow); }
.stat-val.red { color: var(--red); }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }
.filter-bar input[type=search] { width: 240px; }

/* ── VIEW TOGGLE ── */
.view-toggle { display:flex; background: var(--surface2); border-radius:8px; padding: 3px; gap:2px; }
.vt-btn {
  padding: 5px 12px; border-radius:6px; border:none;
  font-family:inherit; font-size:12px; font-weight:500;
  cursor:pointer; color:var(--text2); background:none; transition: all 0.12s;
}
.vt-btn.active { background: var(--surface3); color: var(--text); }

/* ── GANTT UGEPLAN ── */
.gantt-info-hdr { text-align:left; padding:6px 10px; font-size:11px; color:var(--text3); white-space:nowrap; border-bottom:2px solid var(--border); }
.gantt-wk-hdr { min-width:38px; max-width:38px; text-align:center; font-size:11px; font-weight:500; padding:4px 2px; border-right:1px solid var(--border); border-bottom:2px solid var(--border); line-height:1.3; white-space:nowrap; }
.gantt-wk-cur { background:rgba(59,130,246,0.14) !important; color:#3b82f6; font-weight:700; }
.gantt-info-cell { padding:5px 10px; vertical-align:middle; white-space:nowrap; border-bottom:1px solid var(--border); }
.gantt-td { width:38px; min-width:38px; max-width:38px; padding:3px 2px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); }
.gantt-td-cur { background:rgba(59,130,246,0.06); }
.gantt-bar { height:14px; border-radius:3px; margin:0 2px; }
.gantt-scanner-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.gantt-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:11px; color:var(--text2); margin-left:auto; }
.gantt-legend span { display:flex; align-items:center; }
.gantt-td { cursor:pointer; }
.gantt-td-sel { background:rgba(20,184,166,0.22) !important; }
.gantt-td-dragging { background:rgba(59,130,246,0.25) !important; outline:1px solid rgba(59,130,246,0.5); z-index:1; position:relative; }
.gantt-td-past { opacity:0.35; cursor:default !important; pointer-events:none; }
.gantt-td:hover { background:rgba(255,255,255,0.04); }
.gantt-td { user-select:none; -webkit-user-select:none; }
.gantt-sum-td { border-top:2px solid var(--border2); border-right:1px solid var(--border); vertical-align:top; padding:3px 2px; min-height:28px; }

/* ── EB FREMGANG ── */
.eb-fremgang-wrap { display:flex; align-items:center; gap:8px; min-width:120px; cursor:pointer; }
.eb-fremgang-wrap:hover .eb-pct { color:var(--accent); }
.eb-pct { font-size:11px; color:var(--text3); min-width:32px; text-align:right; }

/* ── TABLE ── */
.tbl-wrap { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow-x: auto; }
table { width:100%; border-collapse: collapse; }
thead th {
  background: var(--surface);
  padding: 10px 14px;
  font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text3); text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
tbody td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }
.td-sub { color: var(--text2); font-size: 11px; margin-top: 2px; }
.td-mono { font-family: 'Fira Code', monospace; font-size: 12px; color: var(--text2); }

/* ── DELOPGAVE-INDIKATORER ── */
.subtask-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 8px; margin-left: 5px;
  font-size: 10px; font-weight: 600; font-family: system-ui, sans-serif;
  background: rgba(20,184,166,0.12); color: var(--teal);
  border: 1px solid rgba(20,184,166,0.25);
}
.subtask-arrow {
  color: var(--teal); font-weight: 700; margin-right: 2px; font-size: 13px;
}

/* ── TILBUD LINJE CELLER ── */
.tl-cell {
  width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px;
  font-size: 12px; background: transparent; color: var(--text); transition: border-color .15s;
  box-sizing: border-box; min-width: 0;
}
.tl-cell:hover { border-color: var(--border); }
.tl-cell:focus { border-color: var(--accent); outline: none; background: var(--surface); }

/* ── DEADLINE BADGE ── */
.dl {
  display: inline-flex; align-items:center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; font-family: 'Fira Code', monospace;
}
.dl-green  { background: rgba(34,197,94,0.1);  color: var(--green); }
.dl-yellow { background: rgba(234,179,8,0.12); color: var(--yellow); }
.dl-red    { background: rgba(239,68,68,0.12); color: var(--red); }
.dl-none   { color: var(--text3); font-size: 12px; }

/* ── STATUS CHIP ── */
.chip {
  display: inline-flex; align-items:center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.chip-ny   { background: rgba(71,85,105,0.2); color: var(--text2); }
.chip-scan { background: rgba(59,130,246,0.1); color: var(--accent); }
.chip-eb   { background: rgba(234,179,8,0.1); color: var(--yellow); }
.chip-afl  { background: rgba(34,197,94,0.1); color: var(--green); }
.chip-fak  { background: rgba(167,139,250,0.1); color: var(--purple); }

/* ── DONE BUTTON ── */
.done-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid var(--border2);
  background: none; cursor: pointer;
  display: flex; align-items:center; justify-content:center;
  font-size: 13px; transition: all 0.15s; color: var(--text3);
}
.done-btn:hover { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.08); }
.done-btn.done { border-color: var(--green); background: rgba(34,197,94,0.12); color: var(--green); }

/* ── INLINE EDITABLE ── */
.inline-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px; padding: 4px 7px;
  color: var(--text); font-family: inherit; font-size: 12px;
  outline: none; cursor: pointer; transition: all 0.15s;
  width: 100%;
}
.inline-input:hover { border-color: var(--border2); background: var(--surface2); }
.inline-input:focus { border-color: var(--accent); background: var(--bg); cursor: text; }

.assign-sel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 8px;
  color: var(--text); font-family: inherit; font-size: 12px;
  outline: none; cursor: pointer; max-width: 150px;
  transition: border-color 0.15s;
}
.assign-sel:focus { border-color: var(--accent); }

/* ── MAP ── */
.map-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden; height: 520px;
}
.map-wrap iframe { width:100%; height:100%; border:none; display:block; }

/* ── SCANNING / PLANLÆGNING KORT ── */
.scan-map-wrap, .plan-map-wrap { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; height: 560px; position: relative; }
#scan-map, #plan-map { width: 100%; height: 100%; }
.scan-map-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 10px 4px 2px; align-items: center; }
.sml-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.sml-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid rgba(255,255,255,0.25); box-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.plan-bundle-panel, .tilbud-bundle-panel { display:none; flex-direction:row; align-items:center; gap:8px; padding:8px 12px; margin-top:8px; background:rgba(59,130,246,0.08); border:1px solid rgba(59,130,246,0.25); border-radius:var(--radius); flex-wrap:wrap; }
#plan-bundle-btn.active, #tilbud-bundle-btn.active { background:rgba(239,68,68,0.12); color:var(--red); border-color:rgba(239,68,68,0.3); }
#plan-edit-btn.active { background:rgba(239,68,68,0.12); color:#ef4444; border-color:rgba(239,68,68,0.3); }
.tilbud-map-wrap { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; height: 400px; position: relative; }
#tilbud-overview-map { width: 100%; height: 100%; }
.tl-geo-warn { color: var(--red); cursor: help; font-size: 14px; margin-left: 2px; }
/* Kundegruppe-overskrift i listerne — tydeligt en overskrift, ikke en sag */
tr.kgruppe-head { cursor: pointer; user-select: none; }
tr.kgruppe-head td { background: var(--surface2); font-size: 12px; padding: 5px 10px;
  border-top: 1px solid var(--border); color: var(--text2); }
tr.kgruppe-head:hover td { background: var(--surface3, var(--surface2)); }
tr.kgruppe-head strong { color: var(--text); font-size: 13px; }
.kgruppe-antal { color: var(--text3); font-size: 11px; margin-left: 8px; }
/* Opsummering paa gruppe-overskriften: faste KOLONNER, saa alle overskrifter paa
   samme fane staar i samme spalter — antal over antal, ydelser over ydelser.
   Flyder de frit, skrider alt efter kundenavnets laengde. */
.kg-grid { display: grid; align-items: center; gap: 4px 10px; width: 100%; }
.kg-grid-enkel { grid-template-columns: minmax(0,1fr); }
.kg-grid-f3 { grid-template-columns: 190px 76px minmax(0,1fr) 150px 160px; }
.kg-grid-f4 { grid-template-columns: 190px 76px 96px minmax(0,1fr) 96px 160px 170px; }
.kg-grid-f6 { grid-template-columns: 190px 76px minmax(0,1fr) minmax(0,1fr) 170px; }
.kg-celle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.kg-celle-navn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.kg-celle-antal { white-space: nowrap; }
/* Smal skaerm: lad kolonnerne falde sammen frem for at skubbe tabellen bred */
@media (max-width: 1100px) {
  .kg-grid-f3, .kg-grid-f4, .kg-grid-f6 { grid-template-columns: 170px minmax(0,1fr); }
}
.kg-resume { margin-left: 10px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px;
  vertical-align: middle; }
.kg-chip { display: inline-block; font-size: 10px; line-height: 1.5; padding: 0 6px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }
.kg-chip-klik { cursor: pointer; border-color: var(--blue, #4a90d9); color: var(--text); }
.kg-chip-klik:hover { background: var(--blue, #4a90d9); color: #fff; }
.kg-chip-navn { opacity: 0.75; margin-left: 4px; padding-left: 4px; border-left: 1px solid currentColor; }
/* ── EB-KALENDER ──────────────────────────────────────────────────────────── */
.ebk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; padding: 8px 2px 12px; }
.ebk-bar-nav, .ebk-bar-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ebk-bar-dato, .ebk-bar-sum { color: var(--text3); font-size: 12px; }
.ebk-bruger { font-size: 12px; padding: 3px 6px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.ebk-andens { font-size: 11px; color: var(--yellow); border: 1px solid var(--yellow);
  border-radius: 8px; padding: 1px 7px; }
.ebk-wrap { display: flex; gap: 0; align-items: flex-start; overflow-x: auto; }
/* Timeskalaen staar for sig, saa dagene kan vaere lige brede */
.ebk-timer { position: relative; width: 46px; flex: 0 0 46px; margin-top: 30px; }
.ebk-time { position: absolute; left: 0; right: 0; font-size: 10px; color: var(--text3);
  transform: translateY(-50%); border-top: 1px solid var(--border); padding-left: 2px; }
.ebk-dage { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 6px; flex: 1 1 auto; min-width: 0; }
.ebk-dag { border: 1px solid var(--border); border-radius: var(--radius-lg, 8px);
  overflow: hidden; background: var(--surface); }
.ebk-dag.ebk-idag { border-color: var(--blue, #4a90d9); }
.ebk-dag-hoved { display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; font-size: 12px; font-weight: 700; background: var(--surface2);
  height: 30px; box-sizing: border-box; }
.ebk-dag.ebk-idag .ebk-dag-hoved { background: rgba(74,144,217,0.14); }
.ebk-dag-sum { font-weight: 400; color: var(--text3); font-size: 11px; }
.ebk-dag-sum.ebk-over-tid { color: var(--red); font-weight: 700; }
.ebk-dag-krop { position: relative; }
.ebk-blok { position: absolute; left: 3px; right: 3px; box-sizing: border-box;
  border-radius: 6px; padding: 2px 6px; cursor: pointer; overflow: hidden;
  background: var(--surface2); border-left: 3px solid var(--text3);
  font-size: 11px; line-height: 1.3; }
.ebk-blok:hover { background: var(--surface3, var(--surface2)); }
.ebk-blok.prio-v1 { border-left-color: var(--prio-roed); border-left-width: 4px; }
.ebk-blok.prio-v2 { border-left-color: var(--prio-roed); }
.ebk-blok.prio-v4 { border-left-color: var(--prio-blaa); }
.ebk-blok.prio-v5 { border-left-color: var(--prio-blaa); opacity: 0.85; }
.ebk-blok.ebk-uden-est { background-image: repeating-linear-gradient(45deg,
  transparent, transparent 5px, rgba(127,127,127,0.10) 5px, rgba(127,127,127,0.10) 10px); }
.ebk-blok.ebk-over { outline: 2px dashed var(--blue, #4a90d9); outline-offset: -2px; }
/* Faerdig: samme groenne som faerdig-maerkerne i listen, gennemsigtig, saa
   den skiller sig ud fra det, der mangler. background-color og ikke
   background — saa striberne for "ingen tid registreret" bliver staaende. */
.ebk-blok.ebk-faerdig { background-color: rgba(22,163,74,0.15); border-left-color: #16a34a; }
.ebk-blok.ebk-faerdig:hover { background-color: rgba(22,163,74,0.25); }
.ebk-blok.ebk-faerdig .ebk-l1 strong { color: #16a34a; }
.ebk-bar-faerdige { color: #16a34a; }
.ebk-blok { line-height: 1.2; display: flex; flex-direction: column; gap: 0; }
/* Tre linjer i fast orden og med samme hoejde, saa ydelse staar over ydelse,
   sagsnummer over sagsnummer og kunde over kunde — ogsaa paa tvaers af dagene. */
.ebk-l1, .ebk-l2, .ebk-l3 { height: 11px; line-height: 11px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; }
.ebk-l1 { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.ebk-l1 strong { overflow: hidden; text-overflow: ellipsis; }
.ebk-l2 { font-size: 10px; color: var(--text2); display: flex; justify-content: space-between; gap: 6px; }
.ebk-l2 > span { overflow: hidden; text-overflow: ellipsis; }
/* Diskret groent maerke, naar sagen har et link (sag_link). Hoejden passer i
   linjens 11 px: 9 px tekst + 2 px kant. */
.ebk-link { flex: 0 0 auto; font-size: 8px; line-height: 9px; font-weight: 700; letter-spacing: .3px;
  padding: 0 3px; border-radius: 3px; color: #16a34a; background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.35); text-decoration: none; }
.ebk-link:hover { background: rgba(22,163,74,0.25); }
.ebk-l3 { font-size: 10px; color: var(--text3); }
.ebk-tid { color: var(--text3); font-size: 10px; white-space: nowrap; flex: 0 0 auto; }
.ebk-del { color: var(--text3); }
.ebk-blokeret { position: absolute; left: 0; right: 0; box-sizing: border-box;
  background: repeating-linear-gradient(45deg, rgba(127,127,127,0.13),
    rgba(127,127,127,0.13) 6px, transparent 6px, transparent 12px);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 9px; color: var(--text3); padding: 1px 4px; overflow: hidden; }
.ebb-rk { display: flex; align-items: center; gap: 8px; padding: 5px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.ebb-rk:last-child { border-bottom: none; }
.ebb-rk-tekst { flex: 1; min-width: 0; }
.ebb-ny { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ebb-fejl { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 6px; }
.ebk-tom { padding: 40px 10px; text-align: center; color: var(--text3); }
.ebk-udenfor { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--border);
  border-radius: var(--radius-lg, 8px); display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; font-size: 12px; }
.ebk-udenfor .kg-chip { cursor: pointer; }

/* Prioritet: farven er signalet, baade paa chips og i vaelgeren.
   Den daempede roed i stedet for --red (#ef4444): den raa signalroed flimrer,
   naar den staar paa mange smaa flader ved siden af hinanden. Rangordenen
   baeres af vaegt og udfyldning, ikke af maettet farve. */
.prio-v0 { border-color: var(--prio-roed) !important; color: var(--prio-roed) !important;
  background: var(--prio-roed-flade) !important; font-weight: 700; }
.ebk-blok.prio-v0 { border-left-color: var(--prio-roed); border-left-width: 4px;
  background: var(--prio-roed-flade); color: var(--text); }
/* Fem niveauer: to trin over normal (roedlig), neutral midte, to trin under
   (blaalig). Trinene adskilles af styrke, ikke af fem forskellige farver. */
.prio-v1 { border-color: var(--prio-roed) !important; color: var(--prio-roed) !important;
  font-weight: 700; }
.prio-v2 { border-color: var(--prio-roed) !important; color: var(--prio-roed) !important; }
.prio-v4 { border-color: var(--prio-blaa) !important; color: var(--prio-blaa) !important; }
.prio-v5 { border-color: var(--prio-blaa) !important; color: var(--prio-blaa) !important;
  opacity: 0.8; }
.prio-select { font-size: 11px; padding: 2px 4px; border-radius: 6px; max-width: 112px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2); }
.prio-select.prio-v1 { font-weight: 700; }
.kg-chip-tid { cursor: pointer; border-color: var(--yellow); color: var(--text); }
.kg-chip-tid:hover { background: var(--yellow); color: #000; }
.kg-sep { display: inline-block; width: 1px; height: 11px; background: var(--border); margin: 0 3px; }
/* Tildeling pr. EB-ydelse i tid-popup'en */
.etp-ansvar-row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
/* Accept-popup'en: prioritet i efterbehandlingen pr. ydelse */
.at-prio-liste { border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); }
/* Scanningsfanens bundle-linje: bundlens øvrige sager (ikke i scanning) nedtonet */
.bundle-ovrig { color: var(--text3); opacity: 0.75; }
/* Rescan-popup'en: kort med sagens jordstykke og en tusch */
.afvis-kort { height: 340px; border: 1px solid var(--border2); border-radius: 10px; overflow: hidden;
  position: relative; background: var(--surface2); }
.afvis-kort-indl { display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text3); font-size: 13px; }
.afvis-kort-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.afvis-kort-hint { font-size: 11px; color: var(--text3); }
.afvis-pen-btn { background: var(--accent); color: #fff; border: none; }
.afvis-pen-btn.afvis-pen-aktiv { background: #16a34a; }
.bundle-ovrig-fase { display: block; font-family: inherit; font-size: 10px; font-style: italic; line-height: 1.2;
  white-space: nowrap; }
.at-prio-raekke { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.at-prio-raekke:last-child { border-bottom: none; }
.at-prio-navn { color: var(--text3); font-size: 12px; }
.etp-ansvar-row label { font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px; }
.etp-ansvar-row select { flex: 1; min-width: 0; }
.etp-ansvar-hint { font-size: 10px; color: var(--yellow); white-space: nowrap; }
.ejer-afvig { color: var(--red); cursor: help; font-size: 12px; font-weight: 800; margin-left: 3px; }
.scan-marker { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 1px 5px rgba(0,0,0,0.4); cursor: pointer; position:relative; }
/* ── Scanning planlægningspanel ── */
.scan-plan-panel { width:320px; flex-shrink:0; background:var(--card); border:1px solid var(--border); border-left:none; border-radius:0 var(--radius-lg) var(--radius-lg) 0; display:flex; flex-direction:column; overflow:hidden; }
.spp-header { padding:12px 14px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.spp-title { font-size:13px; font-weight:700; color:var(--text); }
.spp-count { background:#6366f1; color:#fff; font-size:11px; font-weight:700; min-width:22px; height:22px; border-radius:12px; padding:0 6px; display:flex; align-items:center; justify-content:center; }
.spp-list { flex:1; overflow-y:auto; padding:4px 0; }
.spp-empty { padding:30px 14px; text-align:center; color:var(--text3); font-size:12px; }
.spp-item { padding:7px 10px; border-bottom:1px solid var(--border); cursor:grab; font-size:12px; display:flex; gap:7px; align-items:flex-start; transition:background .15s; }
.spp-item:active { cursor:grabbing; }
.spp-item.dragging { opacity:0.35; background:var(--hover); }
.spp-item.drag-over { border-top:2px solid #6366f1; }
.spp-item:hover { background:var(--hover); }
.spp-num { background:#6366f1; color:#fff; font-size:10px; font-weight:700; width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }
.spp-info { flex:1; min-width:0; }
.spp-sagsnr { font-family:monospace; font-size:11px; color:var(--text3); }
.spp-ejendom { font-size:11px; color:var(--text2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spp-adresse { font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spp-ydelser { font-size:11px; color:var(--text3); }
.spp-weekend { color:#f97316; font-size:10px; font-weight:600; }
.spp-remove { cursor:pointer; color:var(--text3); font-size:14px; padding:2px; opacity:0.4; transition:opacity .15s; flex-shrink:0; }
.spp-remove:hover { opacity:1; color:var(--red); }
.spp-date-picker { padding:8px 10px; border-top:1px solid var(--border); }
.spp-date-label { font-size:10px; font-weight:600; color:var(--text3); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
.spp-week-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.spp-day { display:flex; flex-direction:column; align-items:center; padding:4px 2px; border-radius:6px; cursor:pointer; border:1.5px solid transparent; transition:all .15s; }
.spp-day:hover { background:var(--hover); }
.spp-day.selected { background:rgba(59,130,246,0.15); border-color:var(--accent); }
.spp-day.today { border-color:var(--border2); }
.spp-day-name { font-size:9px; color:var(--text3); font-weight:600; text-transform:uppercase; }
.spp-day-num { font-size:14px; font-weight:700; color:var(--text); line-height:1.3; }
.spp-day.selected .spp-day-num { color:var(--accent); }
.spp-day-month { font-size:8px; color:var(--text3); }
.spp-date-hint { font-size:10px; color:var(--yellow); margin-top:5px; text-align:center; }
.spp-estimate { padding:8px 10px; border-top:1px solid var(--border); font-size:11px; }
.spp-estimate-title { font-size:10px; font-weight:600; color:var(--text3); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }
.spp-estimate-rows { display:flex; flex-direction:column; gap:2px; }
.spp-estimate-row { display:flex; justify-content:space-between; color:var(--text2); }
.spp-estimate-row.total { font-weight:700; color:var(--text); border-top:1px solid var(--border); padding-top:3px; margin-top:2px; font-size:12px; }
.spp-estimate-loading { color:var(--text3); font-style:italic; font-size:10px; }
.spp-item-time { font-size:10px; color:var(--accent); font-weight:600; margin-top:1px; }
.spp-actions { padding:8px 10px; border-top:1px solid var(--border); display:flex; gap:6px; }
.spp-actions .btn { flex:1; }
.spp-actions .btn:disabled { opacity:0.35; cursor:not-allowed; }
.scan-plan-badge { position:absolute; top:-8px; right:-8px; background:#6366f1; color:#fff; font-size:9px; font-weight:700; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; border:1.5px solid #fff; z-index:1; pointer-events:none; }
.scan-popup { min-width: 220px; font-size: 12px; line-height: 1.5; }
.scan-popup .sp-kunde { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.scan-popup .sp-adresse { color: var(--text2); margin-bottom: 5px; }
.scan-popup .sp-row { display: flex; justify-content: space-between; gap: 8px; }
.scan-popup .sp-label { color: var(--text3); }
.scan-popup .sp-dates { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 5px; }
.scan-popup .sp-date-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.scan-popup .sp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ejer-label-wrap { overflow: visible !important; }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset:0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: translateY(12px) scale(0.98); opacity:0; } to { transform: none; opacity:1; } }
.modal-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top:0; background: var(--surface); border-radius: 20px 20px 0 0;
}
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.modal-close {
  background: none; border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px 26px; }
.modal-foot {
  padding: 14px 26px 22px;
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ── FORM ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg.span2 { grid-column: span 2; }
.fg label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3);
}
.fg input, .fg select, .fg textarea {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.fg textarea { min-height: 72px; resize: vertical; }
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.sec-hd {
  font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text3);
  margin: 20px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── MULTICHECK ── */
.multicheck { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 10px;
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.12s; user-select: none;
}
.mc-item input { display: none; }
.mc-item:has(input:checked) { border-color: var(--accent); background: var(--accent-g); color: var(--accent); }
.mc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border2); }
.mc-item:has(input:checked) .mc-dot { background: var(--accent); }

/* ── PHASE TRACK ── */
.phase-track {
  display: flex; gap: 0; background: var(--surface2);
  border-radius: 10px; padding: 3px; margin-bottom: 20px;
}
.pt-step {
  flex:1; text-align:center; padding: 7px 4px;
  border-radius: 8px; font-size: 11px; font-weight: 600;
  color: var(--text3); position: relative;
}
.pt-step.done { color: var(--green); }
.pt-step.active { background: var(--surface3); color: var(--text); }
.pt-step::after {
  content: '›'; position: absolute; right: -2px; top: 50%;
  transform: translateY(-50%); color: var(--text3); font-size: 14px;
}
.pt-step:last-child::after { display:none; }

/* ── ADMIN ── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.admin-card-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.stm-drag-handle { cursor:grab; color:var(--text3); font-size:14px; user-select:none; padding:0 2px; }
.stm-drag-handle:hover { color:var(--text); }
tr.stm-row.dragging { opacity:0.3; }
tr.stm-row.stm-drag-over td { border-top:2px solid var(--accent); }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.user-row:last-child { border-bottom: none; }

/* ── FANE BUILDER ── */
.fane-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.fane-item-ikon { font-size: 18px; }
.fane-item-info { flex:1; }
.fane-item-name { font-weight: 600; }
.fane-item-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }

.kol-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.kol-row:last-child { border-bottom: none; }
.kol-type {
  background: var(--surface2); color: var(--text2);
  border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}

/* ── DETALJE MODAL LAYOUT ── */
.det-sections { display:flex; flex-direction:column; gap:0; }
.det-sec {
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
}
.det-sec:last-child { border-bottom: none; }
.det-sec-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text2);
  margin-bottom: 12px;
}
.det-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.det-fg { display:flex; flex-direction:column; gap:4px; }
.det-fg.span2 { grid-column: span 2; }
.det-fg label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3);
}
.bbr-hent-btn {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s, transform .1s;
  margin-top: 2px;
}
.bbr-hent-btn:hover { opacity: .85; transform: translateY(-1px); }
.bbr-hent-btn:disabled { opacity: .5; cursor: wait; }
.det-fg.span3 { grid-column: span 3; }
.det-fg.span2 { grid-column: span 2; }
.det-inp {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 11px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.det-inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
textarea.bbr-hent-btn {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s, transform .1s;
  margin-top: 2px;
}
.bbr-hent-btn:hover { opacity: .85; transform: translateY(-1px); }
.bbr-hent-btn:disabled { opacity: .5; cursor: wait; }
.det-fg.span3 { grid-column: span 3; }
.det-fg.span2 { grid-column: span 2; }
.det-inp { min-height: 60px; resize: vertical; }
select.bbr-hent-btn {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s, transform .1s;
  margin-top: 2px;
}
.bbr-hent-btn:hover { opacity: .85; transform: translateY(-1px); }
.bbr-hent-btn:disabled { opacity: .5; cursor: wait; }
.det-fg.span3 { grid-column: span 3; }
.det-fg.span2 { grid-column: span 2; }
.det-inp { cursor: pointer; }
.det-ro {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px;
  font-size: 13px; color: var(--text2); min-height: 36px;
}
.det-tel-link {
  font-size: 12px; color: var(--accent);
  text-decoration: none; font-weight: 500;
}
.det-tel-link:hover { text-decoration: underline; }
.det-tel-link:empty { display: none; }

/* CHAT BESKEDER */
.chat-historik {
  max-height: 240px; overflow-y: auto; padding: 6px 0 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.chat-msg { display: flex; flex-direction: column; }
.chat-msg-me { align-items: flex-end; }
.chat-msg-them { align-items: flex-start; }
.chat-bubble {
  max-width: 82%; padding: 7px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg-me .chat-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-msg-them .chat-bubble {
  background: var(--surface2); color: var(--text1);
  border-bottom-left-radius: 3px;
}
/* Vedhæftede billeder i en besked — miniaturer, klik åbner i fuld størrelse */
.chat-billeder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chat-billeder img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block;
  background: #fff; border: 1px solid rgba(255,255,255,0.25); cursor: zoom-in;
}
.chat-msg-them .chat-billeder img { border-color: var(--border); }
.chat-meta { font-size: 10px; color: var(--text3); margin-top: 2px; padding: 0 4px; }
.chat-input-wrap { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-input {
  flex: 1; border: 1px solid var(--border2); border-radius: 8px;
  padding: 8px 11px; font-size: 13px; font-family: inherit;
  background: var(--bg); color: var(--text1);
  resize: none; min-height: 36px; max-height: 100px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.chat-send-btn {
  padding: 8px 16px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-weight: 600; white-space: nowrap; transition: opacity .15s;
}
.chat-send-btn:hover { opacity: .85; }
.chat-empty { color: var(--text3); font-size: 12px; padding: 6px 0; font-style: italic; }

/* Ejendomskort */
.det-map-wrap {
  position: relative; margin-top: 10px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  height: 240px;
}
.det-map { width: 100%; height: 100%; background: var(--surface2); }
.det-map-overlay {
  position: absolute; inset:0;
  display: flex; align-items:center; justify-content:center; gap:10px;
  background: var(--surface2); font-size:12px; color:var(--text3);
  pointer-events: none;
}

/* Info-felter (status historik) */
.det-sec-info { background: var(--surface2); margin: 0 -26px; padding: 14px 26px; }
.det-info-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.det-info-item {
  flex: 1; min-width: 100px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.det-info-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 5px;
}
.det-info-val {
  font-size: 13px; font-weight: 600;
}
.det-info-val.done { color: var(--green); }
.det-info-val.empty { color: var(--text3); }

/* Wider modal for detail */
.modal.wide { max-width: 780px; }

/* Plan review modal */
.modal.plan-review { max-width: 1340px; width: 1340px; height: 85vh; display: flex; flex-direction: column; }
.modal.plan-review .plan-review-body { flex: 1; min-height: 0; }
.modal.plan-review .plan-review-body .pr-map,
.modal.plan-review .plan-review-body .pr-embed { height: 100%; min-height: 0; }
.modal.plan-review .plan-review-body .pr-checklist { overflow-y: auto; }
.plan-review-nav { display:flex; align-items:center; gap:12px; padding:10px 18px; border-bottom:1px solid var(--border); }
.plan-review-nav button { background:none; border:1px solid var(--border); border-radius:8px; padding:6px 14px; font-size:18px; cursor:pointer; color:var(--text1); transition:background .15s; }
.plan-review-nav button:hover { background:var(--surface2); }
.plan-review-nav button:disabled { opacity:.3; cursor:default; }
.plan-review-nav .pr-title { flex:1; font-weight:600; font-size:15px; }
.plan-review-nav .pr-counter { font-size:13px; color:var(--text3); }
.pr-jump-input { width:3ch; text-align:center; background:var(--surface2); border:1px solid var(--border); border-radius:4px; color:var(--text1); font-size:13px; padding:1px 2px; font-family:inherit; }
.pr-jump-input:focus { outline:none; border-color:var(--primary); background:var(--surface1); }
.plan-review-body { display:grid; grid-template-columns:1fr 1fr 240px; gap:0; }
.plan-review-body .pr-map { border-right:1px solid var(--border); min-height:380px; position:relative; }
.plan-review-body .pr-embed { border-right:1px solid var(--border); min-height:380px; }
.plan-review-body .pr-embed iframe { width:100%; height:100%; border:none; border-radius:0; }
.plan-review-body .pr-checklist { padding:14px; display:flex; flex-direction:column; gap:10px; font-size:13px; }
.pr-checklist .pr-section-title { font-size:11px; text-transform:uppercase; color:var(--text3); font-weight:600; letter-spacing:.5px; }
.pr-checklist select { width:100%; padding:6px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text1); font-size:12px; }
.pr-checklist .btn { font-size:12px; padding:6px 14px; width:100%; }
.plan-review-bottom { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; padding:14px 18px; border-top:1px solid var(--border); }
.plan-review-bottom .pr-fg { display:flex; flex-direction:column; gap:3px; }
.plan-review-bottom .pr-fg label { font-size:11px; text-transform:uppercase; color:var(--text3); font-weight:500; }
.plan-review-bottom .pr-fg input, .plan-review-bottom .pr-fg select { padding:6px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text1); font-size:13px; }
.pr-ydelse-badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:2px; }
.pr-ydelse-badges span { display:inline-block; padding:2px 10px; border-radius:5px; font-size:12px; font-weight:500; background:rgba(59,130,246,0.12); color:#3b82f6; }

.scan-plan-green {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
}
.scan-plan-yellow {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(234,179,8,0.15);
  color: var(--yellow);
  border: 1px solid rgba(234,179,8,0.3);
}

/* Model popup */
.model-popup-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.model-popup {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 1100px;
  height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.model-popup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.model-popup-title { font-size: 15px; font-weight: 600; }
.model-popup-body { flex: 1; overflow: hidden; }
.model-iframe { width: 100%; height: 100%; border: none; display: block; background: #fff; }
.model-popup-foot {
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.btn-accent {
  background: var(--accent-g);
  border-color: rgba(59,130,246,0.3);
  color: var(--accent);
  font-weight: 600;
}
.btn-accent:hover { background: rgba(59,130,246,0.2); }

/* ── YDELSE LISTE (én per række) ── */
.ydelse-list {
  display: flex; flex-direction: column; gap: 3px;
}
.ydelse-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  user-select: none;
}
.ydelse-row:hover { background: var(--surface2); border-color: var(--border2); }
.ydelse-row.checked { background: rgba(59,130,246,0.07); border-color: rgba(59,130,246,0.25); }
.ydelse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border2); flex-shrink: 0;
  transition: background 0.15s;
}
.ydelse-dot.on { background: var(--accent); box-shadow: 0 0 6px rgba(59,130,246,0.5); }
.ydelse-lbl { flex: 1; font-size: 13px; color: var(--text2); }
.ydelse-row.checked .ydelse-lbl { color: var(--text); font-weight: 500; }
.ydelse-check { font-size: 12px; color: var(--accent); font-weight: 700; min-width: 14px; text-align: right; }

/* ── AUTOCOMPLETE DROPDOWN ── */
.ac-dropdown { display: none; }
.ac-item:last-child { border-bottom: none !important; }
.ac-item:hover { background: var(--surface2) !important; color: var(--text); }

/* ── EB YDELSE TABEL MED TIDSESTIMATER ── */
.eb-ydelser-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
/* EB Tid Popup */
.eb-tid-popup-bg { position:fixed;top:0;left:0;right:0;bottom:0;z-index:9998; }
.eb-tid-popup {
  position:fixed; z-index:9999; width:380px; max-height:80vh; overflow-y:auto;
  background:var(--surface); border:1px solid var(--border2); border-radius:12px;
  box-shadow:0 12px 40px rgba(0,0,0,.4); padding:0;
}
.eb-tid-popup .etp-head {
  padding:14px 16px 10px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.eb-tid-popup .etp-head h3 { font-size:14px; font-weight:700; color:var(--text); margin:0; }
.eb-tid-popup .etp-body { padding:12px 16px 16px; }
.eb-tid-popup .etp-est { font-size:12px; color:var(--text2); margin-bottom:12px; }
.eb-tid-popup .etp-done-row {
  display:flex; align-items:center; gap:8px; margin-bottom:14px;
  padding:8px 10px; background:var(--surface2); border-radius:8px;
}
.eb-tid-popup .etp-done-row label { font-size:13px; color:var(--text); cursor:pointer; display:flex; align-items:center; gap:8px; }
.eb-tid-popup .etp-add {
  display:flex; gap:8px; align-items:center; margin-bottom:14px;
}
.eb-tid-popup .etp-add input {
  flex:1; background:var(--surface2); border:1px solid var(--border2); border-radius:6px;
  padding:6px 10px; font-size:13px; color:var(--text);
}
/* Tid i to felter — timer og minutter — med datoen ved siden af. Bruges i
   popup'en og i dialogen "Registrér tid" ved færdigmelding uden tid. */
.etp-add-tid { display:flex; gap:8px; align-items:flex-end; }
.eb-tid-popup .etp-add.etp-add-tid { align-items:flex-end; }
.etp-felt { display:flex; flex-direction:column; gap:3px; font-size:10px; font-weight:700;
  color:var(--text3); text-transform:uppercase; letter-spacing:.5px; }
.etp-add-tid .etp-felt input { width:64px; flex:none; box-sizing:border-box; background:var(--surface2);
  border:1px solid var(--border2); border-radius:6px; padding:6px 8px; font-size:13px; color:var(--text); }
.etp-add-tid .etp-felt-dato { flex:1; min-width:0; }
.etp-add-tid .etp-felt-dato input { width:100%; }
.etf-tid .etp-felt input { width:90px; }
.etf-tid .etp-felt-dato input { width:100%; }
/* Sagens link i popup'en */
.etp-ansvar-row #etp-link { flex:1; min-width:0; background:var(--surface2); border:1px solid var(--border2);
  border-radius:6px; padding:5px 8px; font-size:12px; color:var(--text); }
.etp-link { font-size:12px; font-weight:600; color:#16a34a; text-decoration:none; white-space:nowrap; }
.etp-link:hover { text-decoration:underline; }
.etp-link-tekst { font-size:12px; color:var(--text3); min-width:0; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; }
.eb-tid-popup .etp-log { font-size:12px; }
.eb-tid-popup .etp-log-head {
  display:grid; grid-template-columns:60px 90px 1fr 28px; gap:4px; padding:4px 0;
  font-weight:700; color:var(--text3); text-transform:uppercase; font-size:10px; letter-spacing:.5px;
  border-bottom:1px solid var(--border);
}
.eb-tid-popup .etp-log-row {
  display:grid; grid-template-columns:60px 90px 1fr 28px; gap:4px; padding:5px 0;
  border-bottom:1px solid var(--border); align-items:center;
}
.eb-tid-popup .etp-log-row:last-child { border-bottom:none; }
.eb-tid-popup .etp-total {
  padding:8px 0 0; font-size:13px; font-weight:700; color:var(--text);
  border-top:2px solid var(--border2); margin-top:4px;
}
/* EB Statistik */
/* Efterbehandlingsrapport — matrix: sager x efterbehandlingsydelser */
.ebr-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.ebr-table th { font-size:10.5px; font-weight:700; color:var(--text3); text-transform:uppercase;
  letter-spacing:.5px; padding:8px 10px; text-align:center; border-bottom:1px solid var(--border2);
  position:sticky; top:0; background:var(--surface); z-index:1; }
.ebr-table th:first-child, .ebr-table td:first-child { text-align:left; }
.ebr-table td { padding:7px 10px; text-align:center; border-bottom:1px solid var(--border);
  vertical-align:middle; white-space:nowrap; }
.ebr-table tbody tr:hover { background:var(--surface2); }
.ebr-sub td { background:rgba(20,184,166,0.04); font-size:11.5px; }
.ebr-sub td:first-child { padding-left:26px; color:var(--text2); }
.ebr-sag { font-weight:600; color:var(--text); }
.ebr-meta { display:block; font-size:10.5px; color:var(--text3); font-weight:400; margin-top:1px; }
.ebr-celle { display:inline-flex; flex-direction:column; gap:1px; padding:3px 8px; border-radius:5px; min-width:74px; }
.ebr-brugt { font-weight:700; font-variant-numeric:tabular-nums; }
.ebr-est { font-size:10px; opacity:.8; font-variant-numeric:tabular-nums; }
.ebr-tom { color:var(--text3); }
.ebr-total td { border-top:2px solid var(--border2); font-weight:700; background:var(--surface2); }
.ebr-forklaring { display:flex; gap:14px; flex-wrap:wrap; font-size:11px; color:var(--text3); margin-top:14px; align-items:center; }
.ebr-forklaring span.p { display:inline-flex; align-items:center; gap:5px; }
.ebr-forklaring i { width:11px; height:11px; border-radius:3px; display:inline-block; }

.eb-stat-table { width:100%; border-collapse:collapse; font-size:13px; }
.eb-stat-table th, .eb-stat-table td {
  padding:8px 12px; text-align:center; border-bottom:1px solid var(--border);
}
.eb-stat-table th { font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; }
.eb-stat-table td:first-child, .eb-stat-table th:first-child { text-align:left; }
.eb-stat-table tr:last-child { font-weight:700; background:var(--surface2); }
.eb-stat-table .has-time { color:var(--text); }
.eb-stat-table .no-time { color:var(--text3); }
.eb-header, .eb-row {
  display: grid;
  grid-template-columns: 1fr 100px 110px 60px;
  align-items: center;
  gap: 0;
}
.eb-header {
  background: var(--surface2);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3);
}
.eb-row {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.eb-row:last-child { border-bottom: none; }
.eb-row.checked { background: rgba(59,130,246,0.04); }
.eb-row:hover { background: rgba(255,255,255,0.02); }

.eb-col-check { display: flex; align-items: center; }
.eb-col-est   { display: flex; flex-direction: column; gap:1px; }
.eb-col-reel  { display: flex; align-items: center; }
.eb-col-diff  { display: flex; align-items: center; justify-content: flex-end; }

.eb-check-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.eb-check-label input { display: none; }
.eb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border2); flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
}
.eb-dot.on {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(59,130,246,0.4);
}
.eb-type-name { font-size: 13px; color: var(--text2); }
.eb-type-name.active { color: var(--text); font-weight: 600; }

.eb-est { font-size: 12px; color: var(--text3); font-family: 'Fira Code', monospace; }
.eb-est.dim { opacity: 0.4; }
.eb-areal-hint { font-size: 10px; color: var(--text3); opacity: 0.6; }

.eb-reel-inp {
  width: 90px; font-size: 12px;
  font-family: 'Fira Code', monospace;
  padding: 4px 8px; border-radius: 6px;
}
.eb-reel-ro { font-size: 12px; color: var(--text2); font-family: 'Fira Code', monospace; }

.eb-diff { font-size: 11px; font-family: 'Fira Code', monospace; font-weight: 700; }
.eb-diff.over  { color: var(--red); }
.eb-diff.under { color: var(--green); }
.eb-diff.eq    { color: var(--text3); }

/* ── TIDSESTIMATER side ── */
.te-info-bar {
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 20px;
}
.te-input { font-family: inherit; }

/* ── YDELSESTYPER: interval-pris ──
   Rækken har både de fem prisfelter og en pladsholder; klassen yt-interval
   afgør, hvad der vises. Felterne skjules kun — værdierne bevares. */
#yt-tbody > tr:not(.yt-interval) > td.yt-interval-celle { display: none; }
#yt-tbody > tr.yt-interval > td.yt-pris-celle { display: none; }
.yt-interval-celle { white-space: nowrap; }
.yt-iv-resume { font-size: 11px; color: var(--text2); margin-left: 6px; }
.yt-iv-advtekst { color: var(--yellow); }
#yt-tbody > tr.yt-interval-row > td { background: var(--surface2); border-bottom: 1px solid var(--border); padding: 10px 16px 14px 44px; }
.yt-iv-boks { border-left: 2px solid var(--accent); padding-left: 14px; }
.yt-iv-tbl { width: auto; border-collapse: collapse; }
.yt-iv-tbl th { font-size: 11px; color: var(--text3); font-weight: 600; text-align: left; padding: 2px 8px 4px 0; background: none; border: none; }
.yt-iv-tbl td { padding: 2px 8px 2px 0; border: none; background: none; }
.yt-iv-nr { font-size: 11px; color: var(--text3); text-align: right; min-width: 18px; }
.yt-iv-knapper { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.yt-iv-status { font-size: 12px; color: var(--text3); }
.yt-iv-status.yt-iv-ugemt { color: var(--yellow); }
.yt-iv-status.yt-iv-ok    { color: var(--green); }
.yt-iv-status.yt-iv-fejl  { color: var(--red); font-weight: 600; }
.yt-iv-hjaelp { font-size: 11px; color: var(--text3); margin-top: 8px; max-width: 640px; }
.yt-iv-adv:empty { display: none; }
.yt-iv-adv { margin-top: 8px; font-size: 12px; color: var(--yellow); display: flex; flex-direction: column; gap: 2px; }

/* ── DRONEZONE POPUP ── */
#dz-popup {
  position: fixed; inset:0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.dz-box {
  width: min(1100px, 98%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  height: 95vh;
  max-height: 95vh;
  animation: modalIn 0.2s ease;
}

.dz-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.dz-head-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.08));
  border: 1px solid rgba(239,68,68,0.25);
  display: flex; align-items:center; justify-content:center;
  font-size: 18px; flex-shrink:0;
}
.dz-head-info { flex:1; min-width:0; }
.dz-head-title { font-size: 14px; font-weight: 700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dz-head-addr {
  font-size: 11px; color: var(--text2); margin-top: 2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.dz-head-actions { display:flex; gap:8px; flex-shrink:0; }

.dz-addr-bar {
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  font-size: 12px;
}
.dz-addr-bar label { color: var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:.8px; font-size:10px; white-space:nowrap; }
.dz-addr-input {
  flex:1;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text); font-family:inherit; font-size:12px;
  outline:none;
  font-family: 'Fira Code', monospace;
}
.dz-addr-input:focus { border-color: var(--accent); }
.dz-copy-btn {
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 7px; padding: 6px 12px;
  color: var(--text2); font-family:inherit; font-size:11px; font-weight:600;
  cursor:pointer; transition: all 0.15s; white-space:nowrap;
}
.dz-copy-btn:hover { color:var(--text); border-color:var(--accent); }
.dz-copy-btn.copied { color:var(--green); border-color:rgba(34,197,94,0.3); }

.dz-hint {
  padding: 8px 16px;
  background: rgba(234,179,8,0.06);
  border-bottom: 1px solid rgba(234,179,8,0.12);
  display: flex; align-items:center; gap: 8px;
  font-size: 11px; color: var(--yellow); flex-shrink:0;
}

.dz-map-area { flex:1; position:relative; min-height: 0; overflow:hidden; }
.dz-iframe { width:100%; height:100%; border:none; display:block; }
.dz-map-spinner {
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:12px; background:var(--surface2);
  font-size:12px; color:var(--text3);
}

.dz-status-bar {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items:center; gap:10px;
  font-size: 11px; color: var(--text3); flex-shrink:0;
}
.dz-status-dot {
  width:6px; height:6px; border-radius:50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* Dronezone knap i tabellen */
.dz-btn {
  display: inline-flex; align-items:center; gap: 5px;
  padding: 4px 9px; border-radius: 7px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.18);
  color: #fca5a5; font-size: 11px; font-weight: 600;
  cursor:pointer; transition: all 0.15s; font-family:inherit;
  white-space:nowrap;
}
.dz-btn:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.35);
  color: var(--red);
}
.dz-btn.no-restr {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.15);
  color: #86efac;
}
.dz-btn.no-restr:hover {
  background: rgba(34,197,94,0.12);
  color: var(--green);
}
.dz-btn.in-zone {
  background: rgba(234,179,8,0.15);
  border-color: rgba(234,179,8,0.5);
  color: #fde047;
  animation: dz-pulse 2.5s ease-in-out infinite;
}
.dz-btn.in-zone:hover {
  background: rgba(234,179,8,0.25);
  color: #facc15;
}
@keyframes dz-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,179,8,0); }
  50%       { box-shadow: 0 0 0 4px rgba(234,179,8,0.2); }
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom:20px; right:20px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  z-index: 9000; animation: slideUp 0.25s ease;
  max-width: 300px;
}
.toast.ok  { border-color: rgba(34,197,94,0.25); }
.toast.err { border-color: rgba(239,68,68,0.25); }
@keyframes slideUp { from { transform: translateY(16px); opacity:0; } to { transform:none; opacity:1; } }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  :root { --sidebar: 54px; }
  .nav-item span:not(.nav-icon) { display: none; }
  .nav-badge { display: none; }
  .sb-logo-sub, .sb-username, .sb-role { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .fg.span2 { grid-column: span 1; }
  .admin-grid { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }
.dimmed { opacity: 0.45; }

  /* Ejer-labels på kort */
  .ejer-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    position: absolute;
    top: 0; left: 0;
  }
  .ejer-label {
    color: #1e293b;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.3;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
    text-align: center;
    letter-spacing: 0.3px;
  }
  .ejer-navn {
    font-weight: 400;
    color: #94a3b8;
    font-size: 10px;
  }
  .ejer-loading-tip, .ejer-tip {
    background: rgba(15,23,42,0.85) !important;
    color: #e2e8f0 !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11px !important;
  }
  .ejer-tip-err { color: #f87171 !important; }
