/* Tokens fra replica/design/tokens.json. Komponenter bruger kun variablerne. */
/* Designsystem: neutral og lys SaaS-stil (godkendt 7/11). Komponenter bruger kun variablerne. */
:root {
  --bg: #ffffff; --surface: #f6f7f9; --surface-2: #eef0f3; --border: #e5e7eb; --border-input: #d1d5db;
  --text: #111827; --text-2: #374151; --muted: #6b7280;
  --accent: #0d5c63; --accent-hover: #08434a; --on-accent: #ffffff; --accent-soft: #e0f2f1;
  --danger: #991b1b; --danger-soft: #fee2e2; --success: #166534; --success-soft: #dcfce7;
  --warning: #92400e; --warning-soft: #fef3c7; --info: #1e40af; --info-soft: #dbeafe;
  --r-sm: 8px; --r-md: 12px; --shadow: 0 1px 2px rgba(17,24,39,.05);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/21px var(--font); color: var(--text); background: var(--surface); }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
h1 { font-size: 22px; line-height: 30px; margin: 0; font-weight: 700; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--bg); border-right: 1px solid var(--border); display: flex;
  flex-direction: column; gap: 4px; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.sidebar a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-weight: 500; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar .logo { font-weight: 700; color: var(--text); margin-bottom: 12px; }
.sidebar .logo:hover { background: none; }
.mark { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.nav-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 12px 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.me { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.me small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; line-height: 16px; }
.me form { margin: 0; } .me button { width: 100%; justify-content: flex-start; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header.top { display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: var(--bg); border-bottom: 1px solid var(--border); }
header.top form { margin: 0; flex: 1; max-width: 560px; }
header.top input { width: 100%; }
main { padding: 24px 32px; width: 100%; max-width: 1480px; }
.testbar { background: var(--warning-soft); color: var(--warning); padding: 6px 16px; font-size: 13px; border-bottom: 1px solid #fde68a; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; }

button, .btn { font: inherit; font-weight: 500; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--border-input); background: var(--bg); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .btn:hover { background: var(--surface-2); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.ghost { border-color: transparent; background: transparent; color: var(--accent); }
button.ghost:hover { background: var(--surface-2); }
button.danger { color: var(--danger); }
input, select, textarea { font: inherit; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-input);
  border-radius: var(--r-sm); background: var(--bg); color: var(--text); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }
input[type=color] { padding: 2px; }
textarea { width: 100%; min-height: 220px; resize: vertical; padding: 10px 12px; line-height: 21px; }
label { font-size: 13px; color: var(--text-2); font-weight: 500; display: block; margin: 8px 0 6px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-input);
  background: var(--bg); color: var(--text-2); text-decoration: none; font-weight: 500; }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.tabs .sep { width: 1px; background: var(--border); margin: 4px 4px; }

.layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.side a { display: block; padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); }
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.side h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 16px 12px 4px; }

.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); }
.scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .03em; }
table.list td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #fafafb; }
table.list a.row { color: var(--text); text-decoration: none; font-weight: 600; }
table.list a.row:hover { color: var(--accent); }
tr.unread a.row::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 18px; font-weight: 500; padding: 1px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.accent, .badge.ai { background: var(--accent-soft); color: var(--accent); }
.badge.danger, .badge.s-spam { background: var(--danger-soft); color: var(--danger); }
.badge.success, .badge.s-lukket { background: var(--success-soft); color: var(--success); }
.badge.warning, .badge.s-venter_leverandoer { background: var(--warning-soft); color: var(--warning); }
.badge.info, .badge.s-aaben { background: var(--info-soft); color: var(--info); }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--warning); font-weight: 600; }
.error { color: var(--danger); font-weight: 600; }
.notice { padding: 12px 16px; border-radius: var(--r-sm); background: var(--warning-soft); color: var(--warning); margin: 0 0 12px; }
.notice form, form.notice { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.case { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .msg, .stack > .panel, .stack > .older { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); }
.stack > .older > .msg { border-top: 1px solid var(--border); }
aside.stack > .panel { padding: 16px 20px; }
.msg { padding: 16px 20px; }
.msg.ud { background: #fbfcfc; }
.msg.note { background: #fffbeb; border-color: #fde68a; }
.msg .meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.msg .meta strong { color: var(--text); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 22px; }
.panel { padding: 16px 20px; }
.panel h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
#svar { border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ai-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-size: 13px; margin: 8px 0; }
.fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 12px; }
.order { border-top: 1px solid var(--border); padding: 10px 0; }
.order:first-of-type { border-top: 0; }
.order ul { margin: 4px 0; padding-left: 18px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.product { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.product a { font-weight: 600; text-decoration: none; }
.product .price { font-weight: 700; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.row-actions form { margin: 0; display: flex; gap: 8px; align-items: center; }
.login input { width: 100%; margin-bottom: 12px; }
.login button { width: 100%; }

@media (max-width: 900px) {
  .layout, .case { grid-template-columns: minmax(0, 1fr); }
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 16px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .logo span:last-child, .nav-h, .me small { display: none; }
  .sidebar .logo { margin: 0; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; }
  header.top, main { padding-left: 16px; padding-right: 16px; }
  .fields { grid-template-columns: 1fr; }
}
.fields select, .fields input { width: 100%; min-width: 0; }
.note-area { min-height: 80px; }
label.inline { display: inline; }
.settings { padding: 20px; margin-bottom: 16px; }
.settings h2 { font-size: 17px; margin: 0 0 4px; }
.setting-row { border-top: 1px solid var(--border); padding: 12px 0; }
.settings details { margin-top: 8px; }
.settings table.list input:not([type=checkbox]) { width: 100%; min-width: 8em; }
.editor { min-height: 220px; padding: 12px; border: 1px solid var(--border-input); border-radius: var(--r-sm);
  background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.editor img { max-width: 100%; max-height: 400px; display: block; margin: 4px 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumbs img { max-width: 220px; max-height: 160px; border: 1px solid var(--border); border-radius: var(--r-sm); }
label.btn { display: inline-flex; margin: 0; font-size: 14px; color: var(--text); }
.older > summary { padding: 12px 20px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.sig-editor { min-height: 120px; white-space: normal; overflow-wrap: normal; font: 12pt/normal Aptos, Calibri, sans-serif; color: #000; } .sig-editor:empty::before { content: attr(data-placeholder); color: var(--muted, #888); } .sig-editor img { display: inline; max-height: none; margin: 0; } .sig-code { margin-top: 8px; } .sig-code textarea { width: 100%; font-family: monospace; }
.sig-editor p { margin: 0; }
.sig-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; } .sig-tools { padding: 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fafafb; } .sig-tools button, .sig-tools select, .sig-tools .btn { min-height: 36px; padding: 0 10px; font-size: 13px; border-color: transparent; background: transparent; } .sig-tools input[type=color] { width: 28px; height: 20px; padding: 0; border: 0; vertical-align: middle; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.settings h2 { font-size: 18px; font-weight: 600; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
main > h1 { margin-bottom: 16px; } main > h1 + .muted { margin-top: -8px; }
.card:has(table.list) { overflow-x: auto; }
aside .panel select, aside .panel input:not([type=checkbox]) { width: 100%; }
.sidebar { align-self: flex-start; }
/* Logget ud: login, glemt og nulstil */
img.mark { background: none; display: block; }
body:has(.auth) { display: flex; flex-direction: column; min-height: 100vh; }
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-main { display: flex; flex-direction: column; padding: 32px 48px; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 26px; line-height: 32px; font-weight: 700; margin: 0; }
.brand img.mark { width: 56px; height: 56px; }
.sidebar .logo img.mark { width: 36px; height: 36px; }
.login { width: 100%; max-width: 380px; margin: auto; padding: 32px 0; }
.login h1 { font-size: 28px; line-height: 36px; margin-bottom: 20px; }
.login button { margin-top: 8px; }
.auth-foot { margin: 0; }
.auth-side { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 56px;
  background: var(--accent); color: var(--on-accent); }
.auth-bg { position: absolute; right: -10%; top: -8%; width: 65%; filter: brightness(0) invert(1); opacity: .07; }
.auth-side h2 { font-size: 36px; line-height: 44px; font-weight: 700; margin: 0 0 24px; max-width: 14em; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 16px; line-height: 24px; }
.auth-side li { display: flex; gap: 12px; }
.auth-side li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--accent-soft); }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-side { display: none; } .auth-main { padding: 24px 16px; } .login { margin: 32px 0 auto; } }
