/* Style C — HUD (registreret design-style; SSOT: 03_Resources/Architecture/design_styles.yaml) */
:root {
  --bg: #060913;
  --bg-soft: #090e1a;
  --card: rgba(11, 17, 32, 0.85);
  --card-hover: rgba(20, 30, 52, 0.9);
  --line: rgba(56, 189, 248, 0.2);
  --text: #f8fafc;
  --text-main: #cbd5e1;
  --text-dim: #64748b;
  --accent: #00f5d4;
  --accent-dark: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --sidebar-w: 260px;
  --mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

/* KRITISK: `hidden`-attributten skal vinde over display-regler (ellers vises modal/login altid) */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; font-family: var(--mono); }

/* ---------------- login ---------------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
}
.login-brand { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }
.login-card label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.login-card input {
  width: 100%;
  min-height: 48px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
  margin-bottom: 14px;
}
.login-msg { font-size: 13px; color: var(--text-dim); min-height: 18px; margin: 12px 0 0; }

/* ---------------- layout ---------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(-100%);
  transition: transform .22s ease;
  z-index: 40;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-icon { font-size: 24px; }
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-dim); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}
.nav-item:hover, .nav-item.active { background: var(--card); color: var(--text); }
.nav-item .count {
  margin-left: auto;
  background: var(--line);
  color: var(--text);
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  padding: 2px 7px;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.stamp { font-size: 12px; color: var(--text-dim); text-align: center; }
.health { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.health.warn .dot { background: var(--warn); }
.health.bad .dot { background: var(--danger); }

/* google-adgang (ADR-15) — administrativt kort nederst i sidebaren, ved log-ud */
.gaccess {
  display: flex; flex-direction: column; gap: 6px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.gaccess-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.gaccess-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.gaccess.warn .dot { background: var(--warn); }
.gaccess.bad .dot { background: var(--danger); }
.gaccess-text { line-height: 1.3; }
.gaccess-bar { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gaccess-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.gaccess.warn .gaccess-bar i { background: var(--warn); }
.gaccess.bad .gaccess-bar i { background: var(--danger); }

.main {
  padding: 0 16px 60px;
  max-width: 1500px;
  margin: 0 auto;
}
.cols { display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
}
.topbar-title { font-size: 17px; font-weight: 650; flex: 1; }

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  font-size: 17px;
  cursor: pointer;
}
.icon-btn:active { background: var(--card-hover); }

.banner {
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.35);
  color: #fde68a;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------------- hero ---------------- */
.hero {
  background: linear-gradient(145deg, #10202a, #121a24);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}
.hero-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.hero-title { font-size: 22px; margin-top: 6px; line-height: 1.25; }
.hero-meta { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

/* ---------------- hurtige links ---------------- */
.quick-links {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 2px 0 14px;
}
.quick-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text-main);
  text-decoration: none; font-size: 13px; font-weight: 500;
}
.quick-link:hover { border-color: var(--accent); color: var(--text); }

.head-right { display: flex; align-items: center; gap: 8px; }

/* ---------------- område-filter + tag-chips ---------------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pill {
  min-height: 30px; padding: 0 11px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-dim);
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active { background: var(--card-hover); border-color: var(--accent); color: var(--text); }
.pill .n { opacity: .65; margin-left: 4px; }

.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: rgba(0, 245, 212, .12); color: var(--accent);
  border: 1px solid rgba(0, 245, 212, .25);
}
.task-row { display: flex; align-items: flex-start; gap: 10px; }
.task-main { flex: 1; min-width: 0; }
.task-edit {
  min-width: 30px; min-height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  cursor: pointer; font-size: 13px; line-height: 1;
}
.task-edit:hover { border-color: var(--accent); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--text-dim);
  font-size: 13px;
}
.chip[aria-pressed="true"] { background: rgba(0,245,212,.14); border-color: var(--accent); color: var(--text); }

/* opmaerksomheds-panel (b:4) */
.attention {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 10px 12px; margin: 0 0 14px;
}
.attention-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.attention-head strong { font-size: 14px; color: var(--text); font-family: var(--mono); }
.attention-head .icon-btn { min-width: 30px; min-height: 30px; font-size: 13px; }
.attention-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.attention-list li { font-size: 13px; line-height: 1.35; }
.a-kilde {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); border: 1px solid rgba(0,245,212,.3);
  border-radius: 999px; padding: 0 6px; margin-right: 6px; vertical-align: 1px;
}
.a-tekst { color: var(--text); }
.a-hvorfor { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.attention-ro { margin: 8px 0 0; font-size: 12px; color: var(--text-dim); }
.attention-ro:empty { display: none; }

/* ---------------- sections ---------------- */
.section { margin-bottom: 18px; scroll-margin-top: 64px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.section-head h2 {
  font-size: 16px; text-transform: none; letter-spacing: 0;
  color: var(--text); font-weight: 650;
}
.section-sub { font-size: 12px; color: var(--text-dim); }

.list { display: flex; flex-direction: column; gap: 6px; }

/* aabent notefelt (venstre kolonne, under Opgaver) */
.note-input {
  width: 100%; min-height: 92px; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit;
  line-height: 1.45;
}
.note-input::placeholder { color: var(--text-dim); }
.note-input:focus { outline: none; border-color: var(--accent); }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.note-foot .hint { font-size: 11px; }

/* system-status i sidebar (OptiPlex mem/disk) */
.sysinfo {
  font-size: 11.5px; color: var(--text-dim); text-align: center;
  padding: 6px 4px; border-top: 1px solid var(--line); line-height: 1.35;
  cursor: help;
}
/* ugentligt triage-forslag */
.triage {
  font-size: 12px; line-height: 1.45;
  background: rgba(0, 245, 212, .06); border: 1px dashed rgba(0, 245, 212, .35);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; color: var(--text-main);
}
.triage .dim { color: var(--text-dim); }
.triage.guard { background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.45); }
.triage.guard .triage-head { color: #fca5a5; }
.triage-head { font-weight: 650; color: var(--text); margin-bottom: 2px; }
.triage-row { color: var(--text-dim); font-size: 11.5px; }
.triage-sec { margin-top: 7px; }
.triage-label { font-weight: 600; color: var(--accent); font-size: 11.5px; margin-bottom: 3px; }
.triage ul { margin: 0 0 5px; padding-left: 16px; }
.triage li { margin-bottom: 3px; }
.triage .btn { min-height: 26px; font-size: 11.5px; padding: 0 8px; }
.triage-log { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 11px; }

/* ---------------- cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
}
.card.handle { border-left-color: var(--accent); }
.card.read { border-left-color: #60a5fa; }
.card.wait { border-left-color: var(--line); }
.card.overdue { border-left-color: var(--danger); }

/* klikbarheds-indikator på kort der ER links */
a.card { position: relative; text-decoration: none; color: inherit; }
a.card::after {
  content: "↗"; position: absolute; top: 7px; right: 10px;
  font-size: 11px; color: var(--text-dim); opacity: 0; transition: opacity .15s;
}
a.card:hover::after { opacity: 1; }

.day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 2px 0;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.day-row:first-child { margin-top: 0; }
.day-row::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ev { display: flex; gap: 12px; align-items: flex-start; }
.ev-time { min-width: 64px; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--accent); font-weight: 600; }
.ev-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.ev-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.mail-top { display: flex; align-items: baseline; gap: 8px; }
.mail-from { font-weight: 650; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-age { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.mail-subject { font-size: 13px; margin-top: 2px; }
.mail-snippet { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; }
.mail-reason { font-size: 11px; color: var(--accent); margin-top: 4px; }
.mail-reason.read { color: #93c5fd; }
.mail-reason.wait { color: var(--text-dim); }

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); color: #04120c; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-small { min-height: 32px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }

.task { display: flex; gap: 12px; align-items: flex-start; }
.task-check {
  min-width: 44px; min-height: 44px; margin-top: -6px;
  border-radius: 8px; border: 1.5px solid var(--line); background: transparent;
  color: transparent; cursor: pointer; font-size: 14px;
}
.task-check:hover { border-color: var(--accent); color: var(--accent); }
.task-title { font-size: 14px; line-height: 1.35; }
.task-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.task-meta .overdue { color: var(--danger); }

.empty { color: var(--text-dim); font-size: 13px; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------------- "mere"-menu (kompakt kort) ---------------- */
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 15;
  display: flex; flex-direction: column; gap: 6px; min-width: 168px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.more-panel .btn { width: 100%; justify-content: flex-start; }
.mail-snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.65);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1; justify-content: center; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.hint { font-size: 12px; color: var(--text-dim); }

/* ---------------- toast ---------------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  background: #1b2531; border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 12px; font-size: 13px;
  animation: pop .18s ease;
}
.toast.ok { border-color: rgba(52,211,153,.5); }
.toast.err { border-color: rgba(248,113,113,.6); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- desktop ---------------- */
@media (max-width: 899px) {
  .btn, .quick-link, .icon-btn, .pill, .chip, .task-edit, .task-check { min-height: 44px; }
  .card { padding: 11px 12px; border-radius: 12px; }
  .list { gap: 8px; }
}

/* ---------------- WEB-FIRST (desktop er primær) ---------------- */
@media (min-width: 900px) {
  .sidebar { transform: none; }
  .backdrop { display: none !important; }
  .main { margin-left: var(--sidebar-w); padding: 0 32px 72px; }
  .topbar { background: var(--bg); min-height: 64px; }
  #btnMenu { display: none; }
  body { font-size: 16px; }
  .card { padding: 10px 13px; transition: border-color .15s ease, background .15s ease; }
  .card:hover { background: var(--card-hover); }
  .section { margin-bottom: 20px; }
  .section-head h2 { font-size: 17px; }
  .ev-title { font-size: 15px; }
  .mail-subject { font-size: 14px; }
  .mail-snippet { font-size: 12.5px; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 18px; max-width: 640px; }
  .login-card { max-width: 420px; }
}

/* To-kolonne kommanderum fra 1100px: agenda | mail, opgaver | stjernemarkerede */
@media (min-width: 1100px) {
  .cols {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 26px 30px;
    align-items: start;
  }
  /* Højre kolonne: kommende aftaler ØVERST, derefter vigtige mails */
  #sec-agenda { grid-area: 1 / 2; }
  #sec-mail { grid-area: 2 / 2; }
  #sec-tasks { grid-area: 1 / 1; }
  #sec-note { grid-area: 2 / 1; }     /* Bob 2026-10-19: lige under Opgaver */
  #sec-hermes { grid-area: 3 / 1; }
  #sec-starred { grid-area: 4 / 1; }
  #sec-drafts { grid-area: 3 / 2; }
}

@media (min-width: 1500px) {
  .cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr); gap: 30px 36px; }
}

/* ---------------- boot (ingen blank skærm) ---------------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; background: var(--bg); color: var(--text-dim);
  font-size: 14px; z-index: 90;
}
.boot.hidden { display: none; }
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
