/* AMU SYD QR – design-tokens fra amusyd.dk/designguide */
:root {
    --c-grey: #394346;        /* AMU SYD grå, primær */
    --c-grey-700: #2c3537;
    --c-grey-500: #6b7578;
    --c-grey-300: #c9cfd1;
    --c-grey-200: #e2e5e6;
    --c-red: #e4000a;         /* AMU SYD rød, knapper/links */
    --c-red-700: #b8000a;
    --c-light: #f0f0f0;       /* sidebaggrund */
    --c-white: #ffffff;
    --c-green: #1f7a3a;
    --c-green-bg: #e6f4ea;
    --c-red-bg: #fde8e9;
    --c-blue-bg: #e8f0f5;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(57, 67, 70, .08);
    --font: "Open Sans", Calibri, "Segoe UI", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
    --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--c-grey);
    background: var(--c-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--c-red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--c-grey); }
.h1 { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--c-grey-500); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.wrap { overflow-wrap: anywhere; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.link { color: var(--c-red); cursor: pointer; }

/* ---------- Topbar ---------- */
.topbar { background: var(--c-grey); color: var(--c-white); }
.topbar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 16px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.topbar__nav { display: flex; gap: 4px; }
.topbar__link {
    color: var(--c-white);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    opacity: .85;
}
.topbar__link:hover { opacity: 1; text-decoration: none; background: rgba(255, 255, 255, .08); }
.topbar__link.is-active { opacity: 1; box-shadow: inset 0 -3px 0 var(--c-red); border-radius: 6px 6px 0 0; }
.topbar__user { display: flex; align-items: center; gap: 14px; }
.topbar__name { font-size: 14px; opacity: .9; }
.topbar__logo img { display: block; height: 36px; width: auto; }
.topbar .btn--ghost { color: var(--c-white); border-color: rgba(255, 255, 255, .35); }
.topbar .btn--ghost:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 48px; width: 100%; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.crumb { display: inline-block; font-size: 13px; margin-bottom: 6px; }
.footer { text-align: center; color: var(--c-grey-500); font-size: 12px; padding: 16px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
.stack { display: grid; gap: 20px; align-content: start; }
@media (max-width: 820px) {
    .grid--2 { grid-template-columns: 1fr; }
    .topbar__name { display: none; }
}

/* ---------- Cards ---------- */
.card { background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card--table { padding: 0; overflow-x: auto; }
.card--narrow { max-width: 560px; margin: 40px auto; }
.card--danger { border-left: 4px solid var(--c-red); }
.empty { text-align: center; padding: 48px 20px; color: var(--c-grey-500); }
.empty .btn { margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--c-red); color: var(--c-white); }
.btn--primary:hover { background: var(--c-red-700); }
.btn--secondary { background: var(--c-white); color: var(--c-grey); border-color: var(--c-grey-300); }
.btn--secondary:hover { border-color: var(--c-grey); }
.btn--ghost { background: transparent; color: var(--c-grey); border-color: transparent; }
.btn--ghost:hover { background: var(--c-grey-200); }
.btn--danger { background: var(--c-white); color: var(--c-red); border-color: var(--c-red); }
.btn--danger:hover { background: var(--c-red); color: var(--c-white); }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--block { width: 100%; }
.btn.is-done { background: var(--c-green-bg); color: var(--c-green); border-color: var(--c-green); }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form--wide { max-width: 680px; }
.form__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form__row > input, .form__row > select { flex: 1 1 160px; }
.form__row--tight { gap: 6px; }
.form__actions { display: flex; gap: 8px; }
.form__links { text-align: center; font-size: 14px; margin: 0; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { font-weight: 600; font-size: 14px; }
.field__help { font-size: 13px; color: var(--c-grey-500); }
.field__inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field__inline input { flex: 1 1 160px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.radio input { accent-color: var(--c-red); width: 16px; height: 16px; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select, textarea {
    font: inherit;
    color: var(--c-grey);
    background: var(--c-white);
    border: 1px solid var(--c-grey-300);
    border-radius: 6px;
    padding: 9px 12px;
    width: 100%;
    min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
    outline: 2px solid var(--c-red);
    outline-offset: 1px;
    border-color: var(--c-red);
}
input[readonly] { background: var(--c-light); }
.input--sm { padding: 5px 8px; font-size: 13px; width: auto; }
select.input--sm { width: auto; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary.link::after { content: " ▴"; }
summary.link::after { content: " ▾"; }
.inline-details { display: inline-block; }
.inline-details[open] form { margin-top: 6px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; }

/* ---------- Flash ---------- */
.flash-list { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 6px; font-size: 14px; border-left: 4px solid; transition: opacity .5s; }
.flash.is-hiding { opacity: 0; }
.flash--success { background: var(--c-green-bg); color: var(--c-green); border-color: var(--c-green); }
.flash--error { background: var(--c-red-bg); color: var(--c-red-700); border-color: var(--c-red); }
.flash--info { background: var(--c-blue-bg); color: var(--c-grey); border-color: var(--c-grey-500); }

/* ---------- Tabs & filter ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--c-grey-200); margin-bottom: 14px; overflow-x: auto; }
.tab { color: var(--c-grey-500); padding: 8px 14px; font-weight: 600; margin-bottom: -2px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--c-grey); text-decoration: none; }
.tab.is-active { color: var(--c-grey); border-bottom-color: var(--c-red); }
.tab__count { display: inline-block; background: var(--c-grey-200); color: var(--c-grey); font-size: 12px; padding: 1px 7px; border-radius: 10px; margin-left: 4px; }
.tab.is-active .tab__count { background: var(--c-red); color: var(--c-white); }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filterbar__item { flex: 1 1 200px; }
.filterbar__item input, .filterbar__item select { width: 100%; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--c-grey-200); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-grey-500); font-weight: 600; background: #fafafa; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafa; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table__qr { width: 72px; }
.table__qr img { display: block; border-radius: 4px; }
.table__title { font-weight: 600; color: var(--c-grey); }
.table__url { max-width: 260px; }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions > * { margin-left: 4px; }
tr.is-inactive .table__qr img { opacity: .35; }
tr.is-inactive .table__title { color: var(--c-grey-500); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--c-grey-200); color: var(--c-grey); vertical-align: middle; }
.badge--all { background: var(--c-blue-bg); }
.badge--shared { background: var(--c-green-bg); color: var(--c-green); }
.badge--off { background: var(--c-red-bg); color: var(--c-red-700); }

/* ---------- QR-detaljer ---------- */
.qr-panel { display: grid; gap: 20px; align-content: start; }
.qr-panel__preview { background: var(--c-white); border: 1px solid var(--c-grey-200); border-radius: var(--radius); padding: 12px; display: flex; justify-content: center; }
.qr-panel__preview img { width: 220px; height: 220px; }
.qr-panel__link, .qr-panel__downloads { display: grid; gap: 8px; }
.dl-grid { display: grid; gap: 12px; }
.dl-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dl-group__title { flex: 0 0 100%; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, .1); }
.stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat__value { font-size: 32px; font-weight: 700; line-height: 1.1; }
.stat__value--sm { font-size: 18px; padding-top: 8px; }
.stat__label { font-size: 13px; color: var(--c-grey-500); }
.sharelist { list-style: none; margin: 0 0 12px; padding: 0; }
.sharelist__item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--c-grey-200); flex-wrap: wrap; }
.sharelist__right { display: flex; align-items: center; gap: 6px; }
.history { list-style: none; margin: 0; padding: 0; }
.history__item { padding: 8px 0; border-bottom: 1px solid var(--c-grey-200); }
.history__item:last-child { border-bottom: 0; }
.history__meta { font-size: 12px; color: var(--c-grey-500); }

/* ---------- Auth-sider ---------- */
.auth-body { background: var(--c-grey); }
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth__card { width: 100%; max-width: 400px; padding: 32px; }
.auth__logo { display: block; height: 51px; width: auto; margin: 0 auto 24px; }
.auth__title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.auth__foot { color: rgba(255, 255, 255, .6); font-size: 12px; margin-top: 16px; }
.debug { font-size: 12px; white-space: pre-wrap; background: var(--c-light); padding: 12px; border-radius: 6px; overflow: auto; }

@media (max-width: 600px) {
    .page-head { flex-direction: column; }
    .table th:nth-child(3), .table td:nth-child(3) { display: none; }
    .stat__value { font-size: 26px; }
    .auth__card { padding: 24px 20px; }
}
@media print {
    .topbar, .footer, .btn, form { display: none !important; }
}
.swatch--sort { background: #000; }
.swatch--graa { background: #394346; }
