/* Grunnútlit — allir litir og letur koma úr themes.css */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
body { min-height: 100vh; }
a { color: var(--pri); } a:hover { color: var(--pri-d); }
h1, h2, h3 { font-family: var(--font-d); font-weight: var(--h-weight); letter-spacing: var(--h-track); margin: 0; }
h1 { font-size: 30px; line-height: 1.1; } h2 { font-size: 18px; margin-bottom: 10px; }
code, .mono { font-family: var(--mono); font-size: 0.93em; }
.sub { color: var(--muted); font-size: 13px; } .muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.loading { padding: 40px; color: var(--muted); }
.error { color: var(--bad); }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; } .end { justify-content: flex-end; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack-sm { display: flex; flex-direction: column; gap: 6px; }
[hidden] { display: none !important; }

/* ---------- Form ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 400; }
.lbl { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--input-line); border-radius: var(--r); padding: 9px 11px; min-height: 42px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--pri); flex: none; }
input[type=color] { padding: 2px; width: 46px; height: 38px; min-height: 0; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-bottom: 16px; }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: auto; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: var(--r);
  border: var(--bw) solid var(--input-line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface2); color: var(--ink); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); font-weight: 600; }
.btn.primary:hover { background: var(--pri-d); border-color: var(--pri-d); color: var(--pri-ink); }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--pri); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); border: var(--bw) solid var(--nav-btn-line, transparent); background: transparent; color: var(--nav-btn-ink, var(--nav-ink)); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--nav-hover); color: var(--nav-btn-ink, var(--nav-active-ink)); }

/* ---------- Valmynd efst ---------- */
.topnav { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
  padding: 0 24px; min-height: 64px; background: var(--nav-bg); border-bottom: var(--bw) solid var(--nav-border, transparent); }
.nav-left, .nav-right { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; }
.nav-right { gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--nav-brand, #fff); text-decoration: none; font-family: var(--font-d); font-weight: var(--h-weight); font-size: 18px; }
.brand:hover { color: var(--nav-brand, #fff); }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--pri); color: var(--pri-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-family: var(--font-d); }
.logo-img { width: auto; max-width: 140px; height: 34px; object-fit: contain; background: none; border-radius: 0; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; align-self: stretch; }
.nav-links > a, .nav-links summary { display: flex; align-items: center; gap: 6px; padding: 0 13px; min-height: 64px; color: var(--nav-ink); text-decoration: none; font-weight: 500;
  text-transform: var(--nav-case); letter-spacing: var(--nav-track); font-size: 14.5px; cursor: pointer; list-style: none; white-space: nowrap; }
.nav-links summary::-webkit-details-marker { display: none; }
.nav-links > a:hover, .nav-links summary:hover { color: var(--nav-active-ink); background: var(--nav-hover); }
.nav-links > a.active { color: var(--nav-active-ink); background: var(--nav-active-bg); box-shadow: inset 0 -3px 0 var(--nav-line); font-weight: 600; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #111; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }
.menu { position: relative; }
.menu-pop { position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; z-index: 60; }
.menu-pop.right { left: auto; right: 0; }
.menu-pop a, .menu-pop button { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; text-transform: none; letter-spacing: 0; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface2); color: var(--ink); }
.menu-pop .dim { color: var(--muted); }
.user-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 5px; border-radius: 22px; border: var(--bw) solid var(--nav-btn-line, transparent); background: transparent; color: var(--nav-btn-ink, var(--nav-ink)); font: inherit; font-size: 14px; cursor: pointer; list-style: none; }
.user-btn::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pri); color: var(--pri-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* Sérkenni þema í valmynd */
[data-theme="klassiskt"], [data-theme="skilatafla"] { --nav-brand: #FFFFFF; }
[data-theme="vinnusedill"] { --nav-brand: var(--ink); --nav-border: var(--ink); --nav-btn-ink: var(--ink); --nav-btn-line: var(--ink); }
[data-theme="litaspjald"] { --nav-brand: var(--ink); --nav-btn-ink: var(--ink); --nav-btn-line: var(--ink); }
[data-theme="litaspjald"] .nav-links { background: #13213F; border-radius: 28px; padding: 4px; align-self: center; }
[data-theme="litaspjald"][data-mode="dark"] .nav-links { background: #22336E; }
[data-theme="litaspjald"] .nav-links > a, [data-theme="litaspjald"] .nav-links summary { min-height: 40px; border-radius: 22px; padding: 0 16px; }
[data-theme="litaspjald"] .nav-links > a.active { box-shadow: none; }
[data-theme="litaspjald"] .topnav { padding-top: 10px; padding-bottom: 10px; }
[data-theme="litaspjald"] .logo { border-radius: 10px 10px 7px 7px; }

main { outline: none; }
.page { padding: 26px 28px 60px; display: flex; flex-direction: column; gap: 20px; max-width: 1500px; margin: 0 auto; }
.page.narrow { max-width: 920px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
@media (max-width: 860px) { .topnav { padding: 6px 12px; } .nav-links > a, .nav-links summary { min-height: 44px; padding: 0 10px; } .page { padding: 18px 16px 48px; } }

/* ---------- Spjöld ---------- */
.card { background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 20px; }
.grow1 { flex: 1 1 360px; min-width: 0; } .grow2 { flex: 2 1 560px; min-width: 0; }
.pad { padding: 10px 0; }
.center-card { max-width: 440px; margin: 10vh auto; background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.center-card .logo-img { height: 56px; max-width: 220px; align-self: flex-start; }
.brand-lg { display: flex; align-items: center; gap: 12px; font-family: var(--font-d); font-weight: var(--h-weight); font-size: 20px; }
.notice { background: var(--pri-l); padding: 10px 12px; border-radius: var(--r); margin: 0; }

/* Yfirlit: kveðja og PDF-reitur */
.hero-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.hero { flex: 1.4 1 420px; background: var(--hero-bg); color: var(--hero-ink); border-radius: var(--r-lg); padding: 26px 30px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.hero .sub { color: var(--hero-sub); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { font-size: 44px; line-height: 1.03; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips a { padding: 5px 12px; border-radius: 14px; background: rgba(127,127,127,.18); color: inherit; text-decoration: none; font-size: 14px; font-weight: 600; }
[data-theme="vinnusedill"] .hero { padding-left: 0; }
.drop-card { flex: 1 1 340px; border: 2px dashed var(--pri); border-radius: var(--r-lg); background: var(--pri-l); padding: 22px 26px; display: flex; align-items: center; gap: 18px; cursor: pointer; color: var(--ink); }
.drop-card:hover, .drop-card.over { background: var(--surface2); }
.drop-card .doc { width: 58px; height: 70px; flex: none; position: relative; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); }
.drop-card .doc::before { content: ''; position: absolute; left: 9px; right: 9px; top: 13px; height: 3px; background: var(--ink); box-shadow: 0 9px 0 -1px var(--muted), 0 17px 0 -1px var(--muted); }
.drop-card .doc::after { content: 'PDF'; position: absolute; right: 5px; bottom: 4px; font: 600 10px var(--mono); color: var(--pri); }
.drop-card strong { font-family: var(--font-d); font-size: 21px; display: block; }
[data-theme="litaspjald"] .drop-card { background: var(--pri); color: var(--pri-ink); border-color: transparent; }
[data-theme="litaspjald"] .drop-card .sub { color: var(--pri-l); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: block; }
.kpi:hover { color: var(--ink); border-color: var(--pri); }
.kpi-l { font-size: 13px; color: var(--muted); } .kpi-v { font-family: var(--font-d); font-size: 36px; font-weight: var(--h-weight); line-height: 1.1; } .kpi-s { font-size: 13px; color: var(--muted); }
.kpi.late .kpi-v { color: var(--late); } .kpi.appr .kpi-v { color: var(--appr); } .kpi.muted .kpi-v { color: var(--muted); } .kpi.review .kpi-v { color: var(--pri); }
[data-theme="skilatafla"] .kpi-v { font-family: var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); color: var(--ink2); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-color: var(--pri); background: var(--pri-l); color: var(--pri-d); }

/* ---------- Töflur ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tbody tr { cursor: pointer; position: relative; }
.table tbody tr:hover td { background: var(--surface2); }
.table tbody tr.sel td { background: var(--pri-l); }
.table tbody tr.cur td { background: var(--pri-l); box-shadow: inset 0 0 0 0 transparent; }
.table tbody tr.cur td:first-child { box-shadow: inset 4px 0 0 var(--pri); }
.table .due, .table td.nowrap { white-space: nowrap; } .due.late { color: var(--late); font-weight: 600; } .due.soon { font-weight: 600; } .due.muted { color: var(--muted); }
[data-theme="skilatafla"] .table .due, [data-theme="skilatafla"] .case-no { font-family: var(--mono); }
.case-no { font-family: var(--mono); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.dimrow td { color: var(--muted); }
.td-ck { width: 36px; } .td-ck input { margin: 0; }
tr.drop-target td { background: var(--pri-l) !important; }
tr.drop-target td:first-child { box-shadow: inset 4px 0 0 var(--pri); }
.drop-hint { position: fixed; z-index: 90; pointer-events: none; background: var(--pri); color: var(--pri-ink); padding: 8px 14px; border-radius: var(--r); font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--neutral-l); color: var(--ink2); }
.st-review { background: var(--pri-l); color: var(--pri-d); } .st-data { background: var(--warn-l); color: var(--warn); } .st-design { background: var(--pri-l); color: var(--pri-d); }
.st-approval { background: var(--appr-l); color: var(--appr); } .st-changes { background: var(--bad-l); color: var(--bad); }
.st-ok { background: var(--ok-l); color: var(--ok); } .st-prod { background: var(--neutral-l); color: var(--ink2); } .st-done { background: var(--neutral-l); color: var(--muted); }
.tag-rush { font-size: 11px; font-weight: 700; color: #fff; background: var(--late); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.shade { display: inline-flex; align-items: flex-end; justify-content: center; width: 28px; height: 32px; padding-bottom: 3px; border-radius: 9px 9px 7px 7px; border: 1px solid rgba(0,0,0,.12); font: 600 11px var(--mono); color: #5B4A2A; box-sizing: border-box; }
.wd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar { width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: var(--pri-l); border: 1px solid var(--pri); }
.bar.today { background: var(--pri); } .bar.hot { background: var(--late); border-color: var(--late); }
.bar-n { font-size: 12px; font-weight: 600; } .bar-d { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.mini { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: var(--r); background: var(--surface2); text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.mini.warn { background: var(--warn-l); } .mini:hover { outline: 1px solid var(--line); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters .search { flex: 1 1 280px; } .filters label { flex-direction: row; align-items: center; gap: 8px; } .filters select { width: auto; }
.selbar { position: sticky; top: 64px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--ink); color: var(--bg); }
.selbar .btn { min-height: 36px; }

/* ---------- Skipt sýn: listi + hliðarspjald ---------- */
.split { display: flex; align-items: stretch; min-height: calc(100vh - 64px); }
.split-main { flex: 1; min-width: 0; }
.drawer { position: sticky; top: 64px; height: calc(100vh - 64px); flex: none; width: var(--drawer-w, 560px); max-width: calc(100vw - 120px); background: var(--bg); border-left: var(--bw) solid var(--card-line); display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.06); }
.drawer[hidden] { display: none; }
.drawer-grip { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 5; touch-action: none; }
.drawer-grip::after { content: ''; position: absolute; left: 4px; top: 50%; width: 2px; height: 48px; margin-top: -24px; border-radius: 2px; background: var(--line); }
.drawer-grip:hover::after, .drawer.resizing .drawer-grip::after { background: var(--pri); }
.drawer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-body .page { padding: 18px 20px 40px; max-width: none; }
.drawer-tab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: var(--r-lg) 0 0 var(--r-lg); background: var(--pri); color: var(--pri-ink); border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; writing-mode: vertical-rl; }
@media (max-width: 860px) {
  .drawer { position: fixed; inset: 0; top: 0; height: 100vh; width: 100vw !important; max-width: none; z-index: 80; }
  .drawer-grip { display: none; }
}

/* ---------- Verkspjald ---------- */
.crumb { font-size: 14px; color: var(--muted); }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.case-head > :first-child { flex: 1 1 300px; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink2); }
.due-box { background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); padding: 14px 18px; min-width: 250px; box-shadow: var(--shadow); border-left: 6px solid var(--wd, var(--card-line)); }
.due-big { font-family: var(--font-d); font-size: 21px; font-weight: var(--h-weight); } .due-big.late { color: var(--late); } .due-big.muted { color: var(--muted); }
.tat { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tat input { width: 64px; min-height: 32px; padding: 4px 8px; text-align: center; }
.tat button { width: 32px; height: 32px; border-radius: var(--r); border: 1px solid var(--input-line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 16px; }
.actions .status-sel { flex-direction: row; align-items: center; gap: 8px; } .actions select { width: auto; }
.banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); }
.banner.warn { background: var(--warn-l); } .banner.ok { background: var(--ok-l); } .banner.info { background: var(--pri-l); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.facts dt { font-size: 13px; color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.note-box { margin-top: 14px; padding: 12px; background: var(--surface2); border-radius: var(--r); white-space: pre-wrap; }
.note-box.internal { background: var(--warn-l); }
.reqs, .steps, .files, .events { list-style: none; margin: 0; padding: 0; }
.reqs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.seg { display: inline-flex; border: 1px solid var(--input-line); border-radius: var(--r); overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--surface); padding: 6px 9px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); min-height: 32px; }
.seg button + button { border-left: 1px solid var(--input-line); }
.seg button.on.missing { background: var(--warn-l); color: var(--warn); font-weight: 600; }
.seg button.on.ok { background: var(--ok-l); color: var(--ok); font-weight: 600; }
.seg button.on.na { background: var(--neutral-l); color: var(--ink2); font-weight: 600; }
.add-row { margin-top: 10px; } .add-row input { flex: 1; min-height: 36px; padding: 6px 10px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.steps li label { flex: 1; } .steps li.done span { text-decoration: line-through; color: var(--muted); }
.steps li.current > label span { font-weight: 600; } .steps li.behind .date-sm { border-color: var(--late); color: var(--late); }
.date-sm { width: 150px; min-height: 34px; padding: 4px 8px; font-size: 13px; }
.sel-sm { width: 120px; min-height: 34px; padding: 4px 8px; font-size: 13px; }
.files li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-zone { border: 1px dashed var(--muted); border-radius: var(--r); padding: 14px; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.drop-zone.over, .viewer-box.over { background: var(--pri-l); border-color: var(--pri); }
.appr { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.appr-resp { background: var(--surface2); border-radius: var(--r); padding: 10px; white-space: pre-wrap; }
.pins { margin: 6px 0; padding-left: 22px; }
.events li { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.ev-meta { font-size: 12px; color: var(--muted); } .ev-kind { font-weight: 600; color: var(--ink2); }
.ev-body { white-space: pre-wrap; font-size: 14px; max-height: 12em; overflow: auto; }
.ev-email .ev-kind { color: var(--pri-d); } .ev-approval .ev-kind { color: var(--appr); } .ev-data .ev-kind { color: var(--ok); }
details.set { border-top: 1px solid var(--line2); padding: 10px 0; } details.set summary { cursor: pointer; font-weight: 500; }
details.set form { margin-top: 10px; }

/* ---------- Yfirferð ---------- */
.review-card { display: flex; flex-direction: column; gap: 6px; }
.warn-list { margin: 4px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
.import-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.import-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface2); }
.import-list .ok { color: var(--ok); font-weight: 600; } .import-list .err { color: var(--bad); font-weight: 600; }
.global-drop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.global-drop > div { background: var(--surface); color: var(--ink); border: 3px dashed var(--pri); border-radius: var(--r-lg); padding: 40px 56px; text-align: center; font-family: var(--font-d); font-size: 26px; font-weight: var(--h-weight); }

/* ---------- Framleiðsla ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.lane { flex: 0 0 280px; background: var(--surface2); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; border: var(--bw) solid var(--line2); }
.lane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.lane-head .n { font-family: var(--font-d); font-size: 22px; }
.bcard { background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); border-left: 5px solid var(--wd, var(--line)); }
.bcard.behind { outline: 2px solid var(--late); }
.bcard a { color: var(--ink); text-decoration: none; } .bcard a:hover { text-decoration: underline; }

/* ---------- Tannkort ---------- */
.teeth-grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; margin-bottom: 3px; }
.teeth-grid .tooth:nth-child(8) { margin-right: 6px; }
.tooth { min-height: 34px; padding: 0; border: 1px solid var(--input-line); border-radius: 5px; background: var(--surface); font: inherit; font-size: 12px; cursor: pointer; color: var(--ink2); }
.tooth.on { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); font-weight: 600; }
.tooth.imp { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; border-radius: 17px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Stillingar ---------- */
.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: 64px; z-index: 10; background: var(--bg); padding: 8px 0; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.theme-card.on { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.theme-card .sw { display: flex; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.1); }
.theme-card .sw span { flex: 1; } .theme-card .sw span:last-child { flex: .5; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wd-grid label { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.layout-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 2px solid var(--line); border-radius: var(--r-lg); cursor: pointer; background: var(--surface); }
.layout-card.on { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.layout-card .thumb { height: 150px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: #fff; position: relative; }
.logo-prev { width: 180px; height: 80px; border: 1px dashed var(--line); border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: #fff; }
.logo-prev img { max-width: 160px; max-height: 64px; }

/* ---------- Tól og skoðari ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 10px; } .tool p { margin: 0; color: var(--ink2); }
.page.full { max-width: none; }
.viewer-wrap { display: flex; gap: 14px; flex-wrap: wrap; }
.viewer-box { flex: 1 1 600px; min-width: 0; height: 70vh; min-height: 360px; border-radius: var(--r-lg); border: 1px solid var(--line); background: #EEF1F4; position: relative; overflow: hidden; }
.viewer-wrap.in-modal .viewer-box { height: 62vh; }
.layers { flex: 0 1 240px; display: flex; flex-direction: column; gap: 8px; }
.drop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #556270; }
.viewer { position: relative; } .viewer canvas { display: block; touch-action: none; }
.viewer-labels { position: absolute; inset: 0; pointer-events: none; }
.pin-tag { background: #C2410C; color: #fff; font: 600 12px var(--font); border-radius: 10px; padding: 1px 7px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- Gluggar og tilkynningar ---------- */
dialog.modal { border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); background: var(--surface); color: var(--ink); }
dialog.modal-wide { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10,14,20,.5); }
.modal-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r); font-size: 14px; max-width: 420px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast-error { background: var(--bad); color: #fff; }

body.print-mode .topnav, body.print-mode .drawer-tab { display: none; }

/* ---------- Verkspjald: reitir, uppsetning ---------- */
.case-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.blk.full { grid-column: 1 / -1; }
.blk-plain { min-width: 0; }
.blk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > .blk-head { margin-bottom: 10px; }
.blk-toggle { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0; margin-right: auto; color: inherit; font: inherit; cursor: pointer; text-align: left; min-height: 32px; }
.blk-toggle h2 { margin: 0; }
.chev { display: inline-block; transition: transform .15s; color: var(--muted); font-size: 14px; }
.blk.collapsed .chev { transform: rotate(-90deg); }
.blk.collapsed .blk-body { display: none; }
.blk.collapsed > .blk-head { margin-bottom: 0; }
.grip { cursor: grab; color: var(--muted); letter-spacing: -2px; font-size: 14px; user-select: none; padding: 0 2px; }
.blk-tools, .act-tools { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mini-btn { min-height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--input-line); background: var(--surface); color: var(--ink2); font: inherit; font-size: 12px; cursor: pointer; }
.mini-btn:hover { background: var(--surface2); }
.editing .blk { outline: 2px dashed var(--line); outline-offset: 2px; }
.editing .blk-plain { padding: 8px; border-radius: var(--r-lg); }
.editing .blk-plain > .blk-head { margin-bottom: 8px; }
.editing .is-hidden { opacity: .45; }
.editing .blk.drop-before { box-shadow: 0 -4px 0 var(--pri); }
.editing .blk.drop-after { box-shadow: 0 4px 0 var(--pri); }
.act-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface2); }
.act-item.drop-before { box-shadow: -4px 0 0 var(--pri); } .act-item.drop-after { box-shadow: 4px 0 0 var(--pri); }
.act-item.is-hidden { opacity: .45; }

/* ---------- Sýnishorn skráa ---------- */
.fpreview { position: fixed; z-index: 1200; background: var(--surface); border: var(--bw) solid var(--card-line); border-radius: var(--r-lg); box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 8px; pointer-events: none; }
.fp-body { display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--r); background: var(--surface2); }
.fp-body img, .fp-body canvas { max-width: 100%; max-height: 100%; display: block; object-fit: contain; background: #fff; }
.fp-3d { width: 100%; height: 100%; position: relative; }
.fp-name { font-size: 12px; color: var(--muted); padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname[data-preview] { cursor: default; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }

/* ---------- Seðlahönnuður ---------- */
.dz-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.dz-side { flex: 0 0 290px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.dz-parts { display: flex; flex-direction: column; gap: 4px; }
.dz-side h2 { font-size: 15px; margin: 0; }
.dz-part { border-radius: 6px; padding: 2px 6px; margin: 0 -6px; }
.dz-part.sel { font-weight: 700; background: var(--pri-l); color: var(--ink); }
.dz-part.sel::after { content: ' ◂'; color: var(--pri); }
.dz-multi { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-top: 1px dashed var(--line); }
.dz-inst { text-align: left; background: none; border: 0; padding: 3px 8px 3px 20px; border-radius: 6px; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.dz-inst:hover { background: var(--surface2); } .dz-inst.sel { font-weight: 700; background: var(--pri-l); }
.dz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dz-color { display: flex; align-items: center; gap: 8px; font-size: 14px; } .dz-color span { flex: 1; }
.dz-color input[type=color] { width: 40px; height: 30px; padding: 0 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.dz-xywh { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.dz-props select, .dz-props input[type=range] { width: 100%; }
.dz-props h3 { font-size: 15px; margin: 6px 0 0; }
.dz-stage { flex: 1 1 500px; min-width: 0; display: flex; justify-content: center; padding: 16px; background: var(--surface2); border-radius: var(--r-lg); }
.dz-paper { box-shadow: 0 4px 24px rgba(0,0,0,.18); user-select: none; touch-action: none; }
.dz-item { cursor: move; outline: 1px dashed rgba(29,95,168,.35); }
.dz-item:hover { outline-color: rgba(29,95,168,.8); }
.dz-item.sel { outline: 2px solid #1D5FA8; z-index: 2; }
.dz-h { position: absolute; background: #1D5FA8; opacity: 0; z-index: 3; }
.dz-item.sel .dz-h, .dz-item:hover .dz-h { opacity: .9; }
.dz-h[data-h="e"] { right: 0; top: 30%; width: 6px; height: 40%; cursor: ew-resize; }
.dz-h[data-h="s"] { bottom: 0; left: 30%; height: 6px; width: 40%; cursor: ns-resize; }
.dz-h[data-h="se"] { right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; border-radius: 2px 0 0 0; }

/* ---------- Sími ---------- */
.nav-links .nav-m { display: none; }
@media (max-width: 860px) { .nav-links .nav-m { display: flex; } }
.m-page { max-width: 640px; }
.m-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: var(--bw) solid var(--card-line); color: var(--ink); text-decoration: none; min-height: 72px; box-shadow: var(--shadow); }
.m-tile strong { display: block; font-size: 17px; } .m-tile.primary { background: var(--pri); color: var(--pri-ink); border-color: var(--pri); } .m-tile.primary .sub { color: var(--pri-l); }
.m-ico { font-size: 26px; width: 36px; text-align: center; }
.m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-btn { min-height: 54px; font-size: 16px; white-space: normal; text-align: center; }
.m-head h1 { font-size: 24px; margin: 6px 0 2px; }
.m-due { font-family: var(--font-d); font-size: 20px; font-weight: var(--h-weight); margin-top: 6px; }
.m-due.late { color: var(--late); }
.m-step { font-size: 19px; }
.m-row { display: flex; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line2); color: var(--ink); text-decoration: none; min-height: 48px; }
.m-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-thumb { margin: 0; } .m-thumb img { width: 100%; border-radius: var(--r); border: 1px solid var(--line); display: block; }
.m-thumb figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.rv-docs { display: flex; flex-direction: column; gap: 10px; }
.rv-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rv-imgs img { width: 100%; max-height: 420px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--r); display: block; }

/* Verkstæði og starfsfólk */
.menu-lab { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-lab strong { font-size: 15px; }
.link-box { padding: 10px 12px; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); word-break: break-all; font-size: 12px; max-height: 120px; overflow: auto; user-select: all; }
.notice.sm { font-size: 13px; padding: 6px 10px; margin: 6px 0 10px; }
