/*
 * AbuGo – designsprog fra den godkendte mockup (korebog/mockup.html, AbuLink-stil).
 * Farver, radius, knapper, felter, tabeller, sidemenu og login-kort er taget direkte derfra.
 * Ingen eksterne skrifttyper: Inter bruges, hvis den er installeret, ellers systemets skrift.
 */
:root {
    --navy: #082459; --primary: #086fda; --primary-2: #0797eb; --accent: #25a9ed; --pale: #eaf6ff;
    --ok: #2f8a52; --warn: #c77700; --bad: #d64545;
    --bg: #f3f8fe; --card: #fff; --text: #152848; --muted: #52677f; --line: #d6e6f5;
    --radius: 16px; --font: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --shadow: 0 5px 22px rgba(29, 84, 144, .05);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Mærke */
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -.04em; padding: 0 8px 14px; }
.brand-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(145deg, #0254bf, #06a1ee); color: #fff; font-size: 17px; letter-spacing: -.06em; }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #8cd8ff; margin-top: -2px; }

/* Web-skal: sidemenu, topbjælke, indhold */
.app { display: flex; min-height: 100vh; }
aside.side { width: 258px; flex: none; background: linear-gradient(180deg, #0b2d6b, #082459 60%, #071f4d); color: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: auto; }
.grp { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #8ea6c9; margin: 16px 10px 6px; }
nav.menu a { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; margin-bottom: 2px; }
nav.menu a:hover { background: rgba(255, 255, 255, .07); }
nav.menu a.on { background: linear-gradient(115deg, #0966d5, #1a8ff0); font-weight: 700; }
nav.menu .badge { margin-left: auto; background: rgba(255, 255, 255, .16); border-radius: 99px; font-size: 11px; padding: 1px 8px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 8px 0; font-size: 13px; color: #8ea6c9; }
.side-foot form { margin: 0; }
.side-foot button.link { display: block; margin-top: 6px; padding: 0; background: none; border: 0; box-shadow: none; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.shell { flex: 1; min-width: 0; }
header.top { background: #fff; border-bottom: 1px solid #dfeafa; padding: 16px 28px; display: flex; align-items: center; gap: 14px; }
header.top .co { font-size: 13px; color: var(--muted); }
header.top h1 { font-size: 22px; color: var(--navy); margin: 2px 0 0; letter-spacing: -.02em; font-weight: 800; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px 5px 5px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.chip i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; }
main.content { max-width: 1240px; padding: 24px 28px 60px; }
@media (max-width: 900px) { .app { display: block; } aside.side { position: static; width: auto; height: auto; } }

/* Byggesten */
h2 { font-size: 17px; margin: 0 0 12px; color: var(--navy); font-weight: 750; }
.sub { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.src { font-size: 12px; color: var(--muted); }
.sp { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.note { background: #fff1dc; border: 1px solid #f3d39b; border-radius: 12px; padding: 12px; font-size: 13.5px; color: #6b4300; }
.status { background: var(--pale); border: 1px solid #cce4f8; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #1f507b; margin: 0 0 14px; }
.error { color: var(--bad); font-size: 13.5px; margin: 6px 0 0; }
button { font: inherit; border: 0; border-radius: 11px; padding: 10px 14px; cursor: pointer; background: linear-gradient(115deg, #0966d5, #0797eb); color: #fff; font-weight: 700; box-shadow: 0 7px 16px rgba(6, 105, 217, .18); }
button.sec { background: #fff; color: var(--primary); border: 1px solid #b8d9f7; box-shadow: none; }
button.full { width: 100%; margin-top: 12px; }
input, select, textarea { font: inherit; width: 100%; padding: 10px; border: 1px solid #b9d5ea; border-radius: 10px; background: #fbfdff; color: var(--navy); }
input[type=checkbox], input[type=radio] { width: auto; }
label { display: block; font-size: 13px; color: #395772; font-weight: 650; margin: 10px 0 4px; }
input.otp { font-size: 24px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: 0 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .g2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--pale); color: #1f3f66; font-weight: 750; letter-spacing: .08em; font-size: 11.5px; text-transform: uppercase; white-space: nowrap; }

/* Login og andre sider uden menu */
body.guest { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(121deg, #071c4c, #0e3674); padding: 24px; }
.login-card { background: #fff; border-radius: 20px; max-width: 430px; width: 100%; padding: 30px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.login-card.wide { max-width: 760px; }
.login-card .brand { color: var(--navy); padding: 0 0 18px; }
.login-card .brand small { color: var(--primary); }
.login-card h1 { font-size: 17px; margin: 0 0 12px; color: var(--navy); font-weight: 750; }
.login-card .sub { font-size: 14.5px; }
.login-card form + form { margin-top: 8px; }
.links { margin-top: 14px; font-size: 13.5px; }
.login-card form h2 { margin-top: 18px; }

/* Politikker */
.policy { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 8px 0; max-height: 14rem; overflow: auto; background: #fbfdff; font-size: 14px; }
.policy table, .policy-text table { font-size: 13px; }
.policy th, .policy-text th { letter-spacing: .04em; }
.policy-text h1 { font-size: 22px; color: var(--navy); font-weight: 800; letter-spacing: -.02em; }
.policy-text h2 { margin-top: 22px; }

/* Toast som i mockuppen (.toast): navy, nederst i midten, skjules efter 2,8 sek. */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: 14px; animation: toast-hide 2.8s forwards; }
@keyframes toast-hide { 0%, 90% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation-duration: 0.01s; animation-delay: 2.8s; } }
.links button.link { padding: 0; background: none; border: 0; box-shadow: none; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.links button.link:hover { text-decoration: underline; }
form.links + p.links { margin-top: 8px; }

/* Kørsel (K4): tabeller, piller, modal og autoudfyld som i mockuppen. */
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; white-space: nowrap; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.p-ok { background: #e3f6ea; color: var(--ok); }
.p-warn { background: #fff1dc; color: var(--warn); }
.p-bad { background: #fde7e7; color: var(--bad); }
.p-mute { background: #eef3f9; color: var(--muted); }
.p-blue { background: var(--pale); color: #165492; }
.wrap { flex-wrap: wrap; }
button.small, a.button.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
a.button { display: inline-block; border-radius: 11px; padding: 10px 14px; font-weight: 700; text-decoration: none; }
a.button.sec { background: #fff; color: var(--primary); border: 1px solid #b8d9f7; }
a.button:not(.sec) { background: linear-gradient(115deg, #0966d5, #0797eb); color: #fff; }
button.bad { background: var(--bad); box-shadow: none; }
label.inl { display: flex; gap: 8px; align-items: center; color: var(--text); font-weight: 500; }
.ac { position: relative; }
.ac[hidden], .ac-list[hidden] { display: none; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; z-index: 5; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); max-height: 200px; overflow: auto; }
.ac-list div { padding: 9px 10px; font-size: 14px; cursor: pointer; }
.ac-list div:hover { background: #eef4fb; }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: 18px; max-width: 520px; width: 92%; padding: 22px; max-height: 90vh; overflow: auto; overscroll-behavior: contain; }
/* Låser siden bag en åben dialog (abugo.js). */
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.modal-bg { overscroll-behavior: contain; }
.dar-attribution { margin: 6px 0 0; font-size: 12px; }
.nw { white-space: nowrap; }
.decl { background: var(--pale); border: 1px solid #cce4f8; border-radius: 12px; padding: 12px; font-size: 13.5px; color: #1f507b; }
/* 60-dagsstatus som i mockuppen (.bar, .wp-card). */
.bar { height: 10px; background: #e4eef8; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }
.wp-card { border-left: 4px solid var(--ok); }
.wp-card.warn { border-left-color: var(--warn); }
.wp-card.bad { border-left-color: var(--bad); }
.bar > i.blue { background: var(--primary-2); }

/* Udlæg (K11): upload-feltet fra mockuppen og ikke færdige bilag. */
.upload { display: block; border: 2px dashed #9cc8f0; border-radius: 14px; padding: 18px; text-align: center; color: var(--primary); font-weight: 700; cursor: pointer; background: #f5faff; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.draft { gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #e6edf3); flex-wrap: wrap; }
.draft:first-of-type { border-top: 0; }
.draft form { margin: 0; }

/* Kørsel: Fra/Til som valg mellem Hjem og en anden adresse (Anders 26/11). */
fieldset.where { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
fieldset.where legend { font-size: 13px; color: #395772; font-weight: 650; margin: 10px 0 4px; padding: 0; }
.seg { display: flex; gap: 8px; margin-bottom: 8px; }
.seg label { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-weight: 600; color: var(--text); cursor: pointer; margin: 0; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--pale); color: var(--navy); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Kreditering af adressedata (CC BY 4.0) i sidefoden i stedet for i formularen. */
footer.foot { padding: 8px 28px 24px; font-size: 12px; }
/* Udlæg, årsoversigt: tabel på bred skærm, liste pr. måned på telefon (Anders 26/11). */
.year-list { display: none; }
.year-list .ym { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
.year-list .ym:last-child { border-bottom: 0; }
.year-list h3 { margin: 4px 0 6px; font-size: 15px; color: var(--navy); }
.year-list .yl { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.year-list .yl.sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 700; }
/* Udlæg i perioden: samme mønster som årsoversigten (Anders 26/11). */
.exp-list { display: none; margin-top: 12px; }
.exp-list .el { border-bottom: 1px solid var(--line); padding: 10px 0; }
.exp-list .el-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.exp-list .el-sub { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.exp-list .el-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; }
.exp-list .el-foot > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-list .el-foot form { margin: 0; }
.exp-list .yl { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.exp-list .yl.sum { margin-top: 6px; padding-top: 6px; font-weight: 700; }
@media (max-width: 600px) { .year-list, .exp-list { display: block; } .year-wide, .exp-wide { display: none; } }

/* Backend (K19, K20): nøgletal, login med Microsoft og trin som i mockuppen. */
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g4 { grid-template-columns: 1fr; } }
.big { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.03em; }
.kpi .muted { font-size: 13px; }
.ms-btn { background: #fff; color: #2f2f2f; border: 1px solid #8c8c8c; box-shadow: none; display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; font-weight: 600; }
.lg-steps { display: flex; gap: 8px; margin: 0 0 16px; }
.lg-steps span { flex: 1; font-size: 12.5px; font-weight: 650; padding: 7px 10px; border-radius: 9px; background: #eef3f9; color: var(--muted); }
.lg-steps span.on { background: var(--pale); color: var(--primary); }
.scroll { overflow: auto; }
