/* Omsorgspartner – visuell profil: dyp rød, varme gråtoner, kondensert fet overskrift */
:root {
  --red: #9b1f2b;
  --red-strong: #b41e29;
  --red-dark: #7a1722;
  --red-tint: #f8e9eb;
  --ink: #3d3e40;
  --ink-soft: #58595b;
  --muted: #7d7e80;
  --grey-1: #b0b0b0;
  --grey-2: #d9dad9;
  --grey-3: #ececeb;
  --bg: #f5f5f3;
  --card: #ffffff;
  --green: #2f7d4f;
  --green-bg: #e2f1e7;
  --green-line: #8ec7a2;
  --yellow: #8a6500;
  --yellow-bg: #fff3c4;
  --yellow-line: #e8c547;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --head: 'Roboto Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--bg); }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(30px, 4.4vw, 44px); }
h2 { font-size: clamp(24px, 3vw, 30px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
a { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Topp */
.preview-bar { background: #2b2c2e; color: #fff; font-size: 14px; text-align: center; padding: 7px 12px; }
.preview-bar b { color: #ffd7dc; }
header.site { background: #fff; border-bottom: 1px solid var(--grey-2); position: sticky; top: 0; z-index: 20; }
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand img { height: 60px; width: auto; display: block; }
.brand .tag { border-left: 1px solid var(--grey-2); padding-left: 14px; font-family: var(--head); font-weight: 700; font-size: 15px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; line-height: 1.2; }
nav.main { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a { font-family: var(--head); font-weight: 700; font-size: 17px; text-decoration: none; color: var(--ink-soft); padding: 9px 14px; border-radius: 999px; }
nav.main a:hover { background: var(--grey-3); color: var(--ink); }
nav.main a.active { color: var(--red); background: var(--red-tint); }
nav.main a.cta { background: var(--red); color: #fff; }
nav.main a.cta:hover { background: var(--red-dark); }
@media (max-width: 760px) {
  header.site .wrap { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 8px; }
  .brand img { height: 48px; }
  .brand .tag { display: none; }
  nav.main { margin-left: 0; width: 100%; }
  nav.main a { font-size: 15px; padding: 7px 11px; }
}

main { min-height: 60vh; padding-bottom: 60px; }
footer.site { border-top: 1px solid var(--grey-2); background: #fff; padding: 26px 0; font-size: 14px; color: var(--muted); }
footer.site .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
footer.site a { color: var(--ink-soft); }

/* Knapper */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid transparent; border-radius: 999px; padding: 11px 22px; font-family: var(--head); font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; line-height: 1.1; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: #fff; color: var(--red); border-color: var(--red); }
.btn-secondary:hover { background: var(--red-tint); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--grey-2); }
.btn-ghost:hover { border-color: var(--grey-1); color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 15px; }
.btn-danger { background: #fff; color: var(--red-strong); border-color: #e3b7bc; }
.btn-danger:hover { background: var(--red-tint); }
.btn-ok { background: var(--green); color: #fff; }
.btn-ok:hover { background: #24653f; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.btn-row.split { justify-content: space-between; }

/* Hero */
.hero { background: #fff; border-bottom: 1px solid var(--grey-2); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -120px; top: -80px; width: 420px; height: 420px; border-radius: 50%; background: var(--grey-3); z-index: 0; }
.hero::before { content: ''; position: absolute; right: 120px; bottom: -190px; width: 300px; height: 300px; border-radius: 50%; background: var(--red-tint); z-index: 0; }
.hero .wrap { position: relative; z-index: 1; padding-top: 44px; padding-bottom: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.eyebrow { font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; font-size: 14px; color: var(--red); font-weight: 700; margin-bottom: 8px; }
.hero p.lead { font-size: 19px; color: var(--ink-soft); max-width: 600px; }
.progress-card { background: #fff; border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.progress-num { font-family: var(--head); font-weight: 700; font-size: 46px; color: var(--green); line-height: 1; }
.progress-num span { font-size: 22px; color: var(--muted); }
.bar { height: 12px; background: var(--grey-3); border-radius: 999px; overflow: hidden; display: flex; margin: 14px 0 10px; }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--green); } .bar .y { background: var(--yellow-line); }
.counts { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; color: var(--ink-soft); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 22px; padding-top: 30px; } }

/* Seksjoner og kort */
section.block { padding: 34px 0 6px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.card { background: var(--card); border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.steps3 > .card, .grid2 > .card, .kpis > * { margin-top: 0 !important; }
.card h3 { margin-bottom: .35em; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; color: var(--ink-soft); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--grey-1); display: inline-block; background: #fff; }
.sw.g { background: var(--green-bg); border-color: var(--green-line); }
.sw.y { background: var(--yellow-bg); border-color: var(--yellow-line); }

/* Avdelingsruter */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { position: relative; text-align: left; background: #fff; border: 1.5px solid var(--grey-2); border-radius: var(--radius); padding: 14px 16px 15px; min-height: 118px; display: flex; flex-direction: column; gap: 4px; cursor: default; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tile .no { font-family: var(--head); font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.tile .nm { font-family: var(--head); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--ink); }
.tile .st { margin-top: auto; font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.tile .grp { font-size: 13px; color: var(--yellow); display: flex; gap: 5px; align-items: center; }
.tile.delivered { background: var(--green-bg); border-color: var(--green-line); }
.tile.delivered .st { color: var(--green); font-weight: 600; }
.tile.booked { background: var(--yellow-bg); border-color: var(--yellow-line); }
.tile.booked .st { color: var(--yellow); font-weight: 600; }
button.tile, a.tile { cursor: pointer; font: inherit; }
button.tile:hover, a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--grey-1); }
.tile.selectable.sel { border-color: var(--red); box-shadow: 0 0 0 3px rgba(155,31,43,.15); background: #fff; }
.tile.selectable.sel::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.tile[disabled] { opacity: .6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.tile .hint { font-size: 13px; color: var(--muted); }

/* Info */
.note { border-left: 5px solid var(--red); background: #fff; padding: 18px 20px; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }
.note.important { background: var(--red-tint); }
.note h3 { color: var(--red-dark); margin-bottom: .4em; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note ul { padding-left: 20px; margin: .3em 0 1em; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps3 .card { padding: 18px 20px; }
.steps3 .n { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--head); font-weight: 700; display: grid; place-items: center; margin-bottom: 10px; }
@media (max-width: 760px) { .steps3 { grid-template-columns: 1fr; } }

/* Stepper / wizard */
.wizard { padding-top: 30px; }
.stepper { display: flex; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: s; flex-wrap: wrap; }
.stepper li { flex: 1 1 0; min-width: 92px; font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--muted); border-top: 4px solid var(--grey-2); padding-top: 8px; }
.stepper li.done { color: var(--ink-soft); border-color: var(--grey-1); }
.stepper li.cur { color: var(--red); border-color: var(--red); }
.stepper li::before { counter-increment: s; content: counter(s) '. '; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { text-align: left; background: #fff; border: 2px solid var(--grey-2); border-radius: var(--radius); padding: 24px; cursor: pointer; display: flex; gap: 18px; align-items: flex-start; transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: var(--grey-1); box-shadow: var(--shadow); }
.choice.sel { border-color: var(--red); box-shadow: 0 0 0 3px rgba(155,31,43,.12); }
.choice .ic { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--red-tint); display: grid; place-items: center; }
.choice h3 { margin: 2px 0 4px; }
.choice p { margin: 0; color: var(--ink-soft); font-size: 16px; }
@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--red-tint); color: var(--red-dark); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 15px; }
.chip button { border: 0; background: rgba(155,31,43,.12); color: var(--red-dark); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }
.chip.plain { padding: 4px 12px; }
.for-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px dashed var(--grey-1); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-size: 15px; }
.for-bar b { font-family: var(--head); }

/* Skjema */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label.f { display: block; }
label.f > span { display: block; font-weight: 600; margin-bottom: 6px; }
label.f > span em { font-style: normal; color: var(--red); }
.hint-text { font-size: 14px; color: var(--muted); margin-top: 5px; display: block; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=time], select, textarea {
  width: 100%; border: 1.5px solid var(--grey-2); border-radius: 10px; padding: 11px 13px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(155,31,43,.12); }
textarea { min-height: 88px; resize: vertical; }
input.num { max-width: 150px; font-size: 22px; font-family: var(--head); font-weight: 700; text-align: center; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span { display: inline-block; padding: 9px 16px; border: 1.5px solid var(--grey-2); border-radius: 999px; background: #fff; font-weight: 600; }
.pills input:checked + span { border-color: var(--red); background: var(--red-tint); color: var(--red-dark); }
.pills input:focus-visible + span { box-shadow: 0 0 0 3px rgba(155,31,43,.2); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--red); flex: none; margin-top: 2px; }
.q-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--grey-3); }
.q-row:first-of-type { border-top: 0; }
.q-row .qt { font-weight: 600; }
.q-row .qd { font-size: 14px; color: var(--muted); font-weight: 400; }
.q-row.highlight { background: linear-gradient(90deg, var(--red-tint), transparent); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
@media (max-width: 560px) { .q-row { grid-template-columns: 1fr; } }
.dept-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.dept-head h3 { margin: 0; font-size: 24px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--grey-3); color: var(--ink-soft); white-space: nowrap; }
.badge.red { background: var(--red-tint); color: var(--red-dark); }
.badge.g { background: var(--green-bg); color: var(--green); }
.badge.y { background: var(--yellow-bg); color: var(--yellow); }

/* Opplasting */
.drop { border: 2px dashed var(--grey-1); border-radius: var(--radius); padding: 18px; text-align: center; background: #fafaf9; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-tint); }
.drop input { display: none; }
.drop b { color: var(--red); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--grey-3); aspect-ratio: 1; border: 1px solid var(--grey-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .sz { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .rm { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--red-dark); font-weight: 700; cursor: pointer; }
.thumb.busy::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.quota { font-size: 14px; color: var(--muted); margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.quota .bar { flex: 1; height: 7px; margin: 0; max-width: 220px; }
.quota .bar i { background: var(--red); }

/* Kalender */
.cal { user-select: none; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.cal-head h3 { margin: 0; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--grey-2); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 18px; color: var(--ink-soft); }
.icon-btn:hover { border-color: var(--grey-1); color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-family: var(--head); font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 64px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; padding: 6px; text-align: left; font: inherit; color: var(--grey-1); display: flex; flex-direction: column; gap: 3px; }
.cal-day .d { font-family: var(--head); font-weight: 700; font-size: 17px; }
.cal-day .s { font-size: 12px; line-height: 1.2; }
.cal-day.out { visibility: hidden; }
.cal-day.today .d { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.cal-day.open, .cal-day.recommended { background: #fff; border-color: var(--grey-2); color: var(--ink); cursor: pointer; }
.cal-day.open .s { color: var(--green); font-weight: 600; }
.cal-day.recommended { border-color: var(--green-line); background: var(--green-bg); }
.cal-day.recommended .s { color: var(--green); font-weight: 700; }
.cal-day.open:hover, .cal-day.recommended:hover { border-color: var(--red); }
.cal-day.area { background: repeating-linear-gradient(-45deg, #f1f1f0, #f1f1f0 6px, #e7e7e5 6px, #e7e7e5 12px); color: var(--muted); }
.cal-day.full, .cal-day.past { background: var(--grey-3); color: var(--muted); }
.cal-day.sel { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(155,31,43,.18); }
.cal-day.chosen { outline: 3px solid var(--red); outline-offset: -3px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.cal-legend span { display: inline-flex; gap: 6px; align-items: center; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--grey-2); background: #fff; }
.cal-legend i.rec { background: var(--green-bg); border-color: var(--green-line); }
.cal-legend i.area { background: repeating-linear-gradient(-45deg, #f1f1f0, #f1f1f0 3px, #ddd 3px, #ddd 6px); }
.cal-legend i.full { background: var(--grey-3); }
.slots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.slot { border: 1.5px solid var(--grey-2); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 700; font-family: var(--head); font-size: 17px; }
.slot:hover { border-color: var(--red); }
.slot.sel { background: var(--red); border-color: var(--red); color: #fff; }
.pick-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 860px) { .pick-layout { grid-template-columns: 1fr; } }
.daypanel { background: #fafaf9; border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 16px 18px; }
.daypanel h4 { margin: 0 0 4px; font-size: 19px; }
.chosen-line { display: flex; gap: 10px; align-items: center; background: var(--green-bg); border: 1px solid var(--green-line); color: var(--green); border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-top: 12px; }
.area-msg { background: #fff; border: 1px solid var(--grey-2); border-radius: 10px; padding: 10px 14px; color: var(--ink-soft); font-size: 15px; }

/* Offentlig kalender – månedsoversikt med tider */
.pub-cal .cal-day { min-height: 110px; color: var(--grey-1); }
.pub-cal .cal-day.has { background: #fff; border-color: var(--grey-2); color: var(--ink); }
.pub-cal .cal-day.has.area { background: repeating-linear-gradient(-45deg, #fafaf9, #fafaf9 6px, #efefed 6px, #efefed 12px); }
.pub-cal .cal-day.has.recommended { border-color: var(--green-line); }
.pub-cal .row { font-size: 12.5px; line-height: 1.25; padding: 3px 5px; border-radius: 5px; background: var(--green-bg); color: var(--green); display: flex; gap: 5px; overflow: hidden; }
.pub-cal .row b { font-family: var(--head); flex: none; }
.pub-cal .row.bk { background: var(--yellow-bg); color: #6e5000; }
.pub-cal .row.bk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-cal .row.na { background: var(--grey-3); color: var(--muted); }
.pub-cal .tag { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) {
  .pub-cal .cal-dow { display: none; }
  .pub-cal .cal-grid { grid-template-columns: 1fr; }
  .pub-cal .cal-day:not(.has) { display: none; }
  .pub-cal .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .pub-cal .cal-day .d { width: 100%; }
  .pub-cal .row { font-size: 14px; }
}

/* Oppsummering / bekreftelse */
.sum-list { display: grid; gap: 12px; }
.sum-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.sum-item .when { font-family: var(--head); font-weight: 700; font-size: 19px; color: var(--red-dark); text-align: right; }
.sum-item .meta { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.success { text-align: center; padding: 30px 10px 10px; }
.success .ok { width: 74px; height: 74px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; font-size: 38px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: #fafaf9; border: 1px dashed var(--grey-1); border-radius: 10px; padding: 8px 8px 8px 14px; font-size: 14px; word-break: break-all; text-align: left; }
.linkbox code { flex: 1; }
.progress-up { height: 8px; background: var(--grey-3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-up i { display: block; height: 100%; background: var(--red); width: 0; transition: width .2s; }

/* Varsler */
.alert { border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-weight: 600; }
.alert.err { background: #fdecee; color: #8a1621; border: 1px solid #f2c4ca; }
.alert.ok { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
.alert.info { background: #fff; border: 1px solid var(--grey-2); color: var(--ink-soft); font-weight: 400; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b2c2e; color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 100; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: 92vw; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--grey-2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(30,30,32,.45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }

/* Admin */
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 26px 0 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--grey-2); margin-bottom: 22px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 16px; font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.cur { color: var(--red); border-bottom-color: var(--red); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 16px 18px; }
.kpi .v { font-family: var(--head); font-weight: 700; font-size: 34px; line-height: 1; }
.kpi .l { font-size: 14px; color: var(--muted); margin-top: 6px; }
.kpi.g .v { color: var(--green); } .kpi.y .v { color: #b08400; } .kpi.r .v { color: var(--red); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
table.t th { text-align: left; font-family: var(--head); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px; border-bottom: 2px solid var(--grey-2); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--grey-3); vertical-align: top; }
table.t tr.expand td { background: #fafaf9; }
table.t td.num { text-align: right; font-family: var(--head); font-weight: 700; font-size: 17px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--grey-2); border-radius: var(--radius); }
.route { border: 1px solid var(--grey-2); border-radius: var(--radius); background: #fff; margin-bottom: 14px; overflow: hidden; }
.route-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; background: #fafaf9; border-bottom: 1px solid var(--grey-2); flex-wrap: wrap; }
.route-head h3 { margin: 0; }
.stop { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--grey-3); align-items: start; }
.stop:first-of-type { border-top: 0; }
.stop .tm { font-family: var(--head); font-weight: 700; font-size: 20px; color: var(--red-dark); }
.stop .km { font-size: 13px; color: var(--muted); }
.stop .who { font-size: 14px; color: var(--ink-soft); }
.stop.done { opacity: .6; }
@media (max-width: 640px) { .stop { grid-template-columns: 60px 1fr; } .stop .acts { grid-column: 1 / -1; } }
.admin-cal .cal-day { min-height: 84px; cursor: pointer; color: var(--ink-soft); border-color: var(--grey-3); background: #fff; }
.admin-cal .cal-day.past { cursor: default; }
.admin-cal .cal-day.isopen { border-color: var(--green-line); background: var(--green-bg); color: var(--ink); }
.admin-cal .cal-day.hasbk { border-color: var(--yellow-line); }
.admin-cal .cal-day:hover:not(.past) { border-color: var(--red); }
.admin-cal .cal-day .s b { color: #8a6500; }
.wd-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-pick label span { padding: 7px 12px; }
.slot-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.slot-edit .chip { background: var(--grey-3); color: var(--ink); }
.slot-edit .chip.locked { background: var(--yellow-bg); color: #6e5000; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery a { display: block; }
.toggle { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--grey-2); border-radius: 999px; transition: background .15s; cursor: pointer; }
.toggle span::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::before { transform: translateX(20px); }
.login { max-width: 420px; margin: 50px auto; }
.inline { display: inline-flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { min-height: 104px; padding: 11px 12px; }
  .tile .nm { font-size: 18px; }
  .tile .st, .tile .grp { font-size: 12.5px; }
}

/* Ny PC – bilder fra Medarbeider-PC-guiden */
.note .usb { background: #fff; border: 1.5px dashed var(--red); border-radius: 10px; padding: 10px 14px; color: var(--red-dark); }
.newpc figure { margin: 16px 0 0; }
.newpc img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--grey-3); }
.newpc figcaption { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; }
.newpc.compact { padding: 16px 18px; }
.newpc.compact figure { display: grid; grid-template-columns: minmax(0, 1fr); }
.check.warn { color: var(--red-dark); }
.check + .check { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grey-3); }
.reminder { display: flex; gap: 12px; align-items: flex-start; background: var(--red-tint); border: 1px solid #ecc4c9; color: var(--red-dark); border-radius: 10px; padding: 12px 16px; font-weight: 600; text-align: left; }
.cal-head h3::first-letter, .daypanel h4::first-letter, .route-head h3::first-letter, .modal h3::first-letter { text-transform: uppercase; }

/* Bildeopplasting med merking */
.upload-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--grey-3); }
.upload-block .qt { font-weight: 600; }
.upload-block .qd { font-size: 14px; color: var(--muted); }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.ptile { border: 1.5px solid var(--grey-2); border-radius: 12px; padding: 6px; background: #fff; }
.ptile.missing { border-color: var(--red-strong); box-shadow: 0 0 0 3px rgba(180,30,41,.12); }
.ptile .thumb { border: 0; }
.tagrow { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.tag { border: 1.5px solid var(--grey-2); background: #fff; border-radius: 8px; padding: 6px 4px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink-soft); line-height: 1.1; }
.tag:hover { border-color: var(--red); }
.tag.on { background: var(--red); border-color: var(--red); color: #fff; }
.tagmiss { font-size: 12px; color: var(--red-strong); font-weight: 700; text-align: center; margin-top: 4px; }
