/* Senterpost · Åssiden Seniorsenter
   Farger fra logoen: rosa→rød gradient, signalfarge #D0043C.
   Store flater, stor tekst, høy kontrast — laget for å være lett å bruke. */

:root {
  --rod: #D0043C;
  --rod-dyp: #A50330;
  --rosa: #EE3B6F;
  --rosa-lys: #FDEEF3;
  --grad: linear-gradient(135deg, #EE3B6F 0%, #D0043C 100%);

  --ink: #221A1D;
  --ink-2: #5F5356;
  --ink-3: #8D7F83;
  --bg: #FAF6F4;
  --surface: #FFFFFF;
  --line: #EDE1E3;
  --gul-lys: #FDF3E6;
  --gronn: #17803D;
  --gronn-lys: #E8F6ED;

  --radius: 18px;
  --radius-s: 12px;
  --shadow-1: 0 1px 2px rgb(34 26 29 / .05), 0 2px 10px rgb(34 26 29 / .05);
  --shadow-2: 0 4px 10px rgb(208 4 60 / .10), 0 14px 36px rgb(34 26 29 / .12);
  --focus: 0 0 0 3px rgb(208 4 60 / .28);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; }
a { color: var(--rod); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

/* ---------------------------------------------------------------- Knapper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 16px/1.2 var(--font);
  padding: 13px 22px;
  border-radius: 13px;
  border: none; cursor: pointer;
  text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgb(208 4 60 / .28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow-1); }
.btn-secondary:hover { border-color: var(--rod); color: var(--rod); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--rod); background: var(--rosa-lys); }
.btn-ghost-danger { background: transparent; color: var(--ink-2); font-weight: 600; text-decoration: underline; }
.btn-ghost-danger:hover { color: var(--rod); }
.btn-danger { background: transparent; color: var(--rod); border: 1.5px solid var(--line); }
.btn-danger:hover { background: var(--rosa-lys); border-color: var(--rod); }
.btn-sm { padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.btn-xl { padding: 18px 30px; font-size: 18px; border-radius: 15px; }
.full { width: 100%; }

/* ---------------------------------------------------------------- Toppfelt */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; }
.brand img { display: block; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  padding: 9px 16px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: var(--ink-2);
  white-space: nowrap;
}
.nav a:hover { color: var(--rod); text-decoration: none; background: var(--rosa-lys); }
.nav a.aktiv { background: var(--rosa-lys); color: var(--rod); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-email { font-size: 13.5px; color: var(--ink-3); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container { max-width: 1120px; margin: 0 auto; padding: 34px 24px 80px; }
.admin-footer { text-align: center; color: var(--ink-3); font-size: 13px; padding: 26px 0 90px; }

/* ------------------------------------------------------------------- Toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-2);
  animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2), toast-out .4s ease 4.6s forwards;
}
.toast-ok { background: var(--ink); color: #fff; }
.toast-ok::before { content: '✓  '; color: #6EE7A0; }
.toast-err { background: var(--rod); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -16px); visibility: hidden; } }

/* ------------------------------------------------------------------ Sider */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.sub { color: var(--ink-2); margin: 6px 0 0; font-size: 15.5px; }
.section-title { margin: 34px 0 14px; font-size: 16px; color: var(--ink-2); font-weight: 800; }
.backlink { display: inline-block; font-weight: 700; font-size: 14.5px; margin-bottom: 14px; }
.mute { color: var(--ink-3); }
.small { font-size: 14px; }
.num { text-align: right; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 24px;
}

/* -------------------------------------------------------------- Dashboard */
.dash-top { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: stretch; }

.hero { display: flex; flex-direction: column; justify-content: center; padding: 28px 32px; }
.hero-row { display: flex; align-items: baseline; gap: 12px; margin: 2px 0; }
.hero-value { font-size: 64px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.hero-unit { font-size: 19px; font-weight: 700; color: var(--ink-2); }
.hero-live { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gronn); animation: puls 2s infinite; }
@keyframes puls { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.send-card { display: flex; flex-direction: column; gap: 14px; justify-content: center; padding: 26px; }
.send-card .btn { width: 100%; }
.send-meta { display: grid; gap: 5px; font-size: 14px; color: var(--ink-2); }
.send-meta a { font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--ink); text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #F3C2D0; }
.tile-label { font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.tile-label span { color: var(--ink-3); font-weight: 600; }
.tile-value { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.tile-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tile-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tile-dish {
  font-size: 12.5px; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pill {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--rosa-lys); color: var(--rod-dyp);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bump { animation: bump .55s cubic-bezier(.2,.9,.3,1.4); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); color: var(--rod); }
  100% { transform: scale(1); }
}

.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px 22px; }
.stat .tile-value { font-size: 34px; }

/* ------------------------------------------------------------------ Tabell */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-3);
  padding: 4px 12px 10px; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FDF9FA; }
.row-inaktiv { opacity: .55; }

.badge {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
}
.badge-par { background: var(--rosa-lys); color: var(--rod-dyp); }
.badge-annen { background: #F1ECED; color: var(--ink-2); }
.badge-av { background: #F1ECED; color: var(--ink-3); margin-left: 6px; }

.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 15.5px; }

/* ------------------------------------------------------------- Skjemafelt */
.field { display: flex; flex-direction: column; gap: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
.field > span, .field legend, .chips-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="number"], select {
  font: 500 16px/1.4 var(--font);
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus-visible, select:focus-visible { border-color: var(--rod); box-shadow: var(--focus); outline: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.time-pair { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- Ukeeditor */
.week-form { display: flex; flex-direction: column; gap: 16px; }
.daycard { padding: 22px 24px; }
.daycard-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.daycard-head h2 { color: var(--rod); font-size: 19px; }
.field-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 16px; margin-bottom: 16px; }
.field-grid .field { grid-column: span 2; }
.field-grid .field.span2 { grid-column: span 4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  transition: all .12s ease;
}
.chip:hover span { border-color: var(--rod); color: var(--rod); }
.chip input:checked + span { background: var(--rod); border-color: var(--rod); color: #fff; }
.chip input:focus-visible + span { box-shadow: var(--focus); }

.actionbar {
  position: sticky; bottom: 0; z-index: 40;
  margin: 8px -24px -80px; padding: 14px 24px 18px;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.actionbar-inner {
  max-width: 1072px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.actionbar-note { font-size: 14px; }
.actionbar-btns { display: flex; gap: 10px; }

/* --------------------------------------------------------------- Kontakter */
.contacts-grid { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 18px; }
.card-title { font-size: 17px; margin-bottom: 14px; }
.side-stack .btn { width: 100%; margin-top: 10px; }

/* --------------------------------------------------------- Offentlige sider */
.public { background: var(--bg); }
.public::before {
  content: ''; position: fixed; inset: 0 0 auto; height: 340px; z-index: -1;
  background: radial-gradient(700px 340px at 50% -80px, rgb(238 59 111 / .12), transparent 70%);
}
.pub-wrap {
  max-width: 600px; margin: 0 auto; padding: 40px 20px 60px;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.pub-logo img { display: block; }
.pub-card { width: 100%; padding: 36px 34px; font-size: 18px; }
.pub-card h1 { font-size: 31px; margin-bottom: 10px; }
.lead { font-size: 18.5px; color: var(--ink-2); margin: 0 0 22px; }
.center { text-align: center; }
.center .lead { margin-bottom: 14px; }
.pub-links { display: flex; justify-content: center; gap: 26px; margin-top: 22px; font-weight: 700; font-size: 15.5px; }
.pub-footer { color: var(--ink-3); font-size: 14px; text-align: center; }
.public .field > span, .public .field legend { font-size: 16px; color: var(--ink); }
.public input[type="text"], .public input[type="email"], .public input[type="password"] { font-size: 18px; padding: 15px 16px; }
.demo-hint { margin-top: 18px; }

.alert {
  background: var(--rosa-lys); color: var(--rod-dyp);
  border: 1.5px solid #F5B8CA; border-radius: var(--radius-s);
  padding: 13px 16px; font-weight: 700; font-size: 15.5px; margin-bottom: 18px;
}

.radio-cards { display: grid; gap: 10px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 14px 16px; cursor: pointer; background: var(--surface);
  transition: all .12s ease;
}
.radio-card:hover { border-color: var(--rod); }
.radio-card:has(input:checked) { border-color: var(--rod); background: var(--rosa-lys); box-shadow: inset 0 0 0 1px var(--rod); }
.radio-card input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--rod); flex: none; }
.radio-card strong { display: block; font-size: 17px; }
.radio-card small { color: var(--ink-2); font-size: 14.5px; }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 15px; color: var(--ink-2); line-height: 1.5;
  background: #FDF9FA; border-radius: var(--radius-s); padding: 14px 16px;
  cursor: pointer;
}
.consent input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--rod); flex: none; }

.checkmark {
  width: 74px; height: 74px; margin: 4px auto 18px;
  border-radius: 50%;
  background: var(--grad); color: #fff;
  font-size: 38px; font-weight: 800; line-height: 74px; text-align: center;
  box-shadow: 0 8px 24px rgb(208 4 60 / .3);
  animation: pop-in .45s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

.recap { margin: 0 0 22px; border: 1.5px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.recap-row { display: flex; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.recap-row:last-child { border-bottom: none; }
.recap-row dt { flex: 0 0 108px; font-weight: 700; color: var(--ink-3); font-size: 15px; padding-top: 1px; }
.recap-row dd { margin: 0; font-size: 17px; }
.recap-akt { background: var(--rosa-lys); }
.recap-akt dt { color: var(--rod-dyp); }

.status-ok {
  background: var(--gronn-lys); color: var(--gronn);
  border-radius: var(--radius-s); padding: 13px 16px;
  font-weight: 700; font-size: 16px; margin-bottom: 20px;
}
.status-ok::before { content: '✓ '; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin: -6px 0 4px; }
.step-btn {
  width: 62px; height: 62px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  font: 700 30px/1 var(--font); color: var(--rod);
  cursor: pointer; box-shadow: var(--shadow-1);
  transition: all .12s ease;
}
.step-btn:hover { border-color: var(--rod); background: var(--rosa-lys); }
.step-btn:active { transform: scale(.94); }
.stepper input {
  width: 96px; text-align: center;
  font-size: 34px; font-weight: 800; padding: 10px 0;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.center-label { align-items: center; }
.center-label span { font-size: 17px !important; }
.cancel-form { margin-top: 18px; }

/* ---------------------------------------------------------------- Plakater */
.print-page { background: #E8E0E2; }
.print-toolbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  background: rgb(255 255 255 / .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sheet {
  width: 210mm; min-height: 296mm;
  margin: 24px auto 60px;
  background: #fff;
  box-shadow: 0 10px 40px rgb(34 26 29 / .18);
  padding: 16mm 17mm;
  display: flex; flex-direction: column;
}
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ps-logo { height: 17mm; }
.ps-meta { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.6; }
.ps-band {
  margin-top: 8mm;
  background: var(--rod); color: #fff;
  border-radius: 10px;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 16px;
  font-weight: 800; font-size: 15.5px;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.ps-price { text-align: center; font-size: 15px; padding: 9px 0 0; color: var(--ink); }
.ps-days { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; padding: 4mm 0; }
.pd { padding: 3.2mm 0; border-bottom: 1px solid var(--line); }
.pd:last-child { border-bottom: none; }
.pd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pd-day { font-weight: 800; font-size: 17.5px; color: var(--rod); }
.pd-akt { font-weight: 800; font-size: 14px; color: var(--rod-dyp); background: var(--rosa-lys); padding: 3px 11px; border-radius: 999px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.pd-main { font-weight: 700; font-size: 15.5px; margin-top: 3px; }
.pd-dess { font-size: 14.5px; color: var(--ink-2); }
.pd-alg { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ps-foot { border-top: 1.5px solid var(--line); padding-top: 4mm; font-size: 11px; color: var(--ink-2); line-height: 1.55; }
.ps-foot p { margin: 0 0 4px; }

.qr-sheet { align-items: center; text-align: center; }
.qr-logo { height: 15mm; margin-top: 2mm; }
.qr-title { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin-top: 10mm; }
.qr-sub { font-size: 18px; color: var(--ink-2); max-width: 125mm; margin: 5mm 0 10mm; }
.qr-box {
  width: 78mm; height: 78mm; padding: 7mm;
  border: 2.5px solid var(--ink); border-radius: 8mm;
}
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-url { font-weight: 800; font-size: 17px; margin-top: 5mm; color: var(--rod); }
.qr-steps {
  list-style: none; counter-reset: steg; padding: 0;
  margin: 11mm 0 0; text-align: left;
  display: flex; flex-direction: column; gap: 4.5mm;
  font-size: 16.5px;
}
.qr-steps li { display: flex; align-items: center; gap: 14px; counter-increment: steg; }
.qr-steps li::before {
  content: counter(steg);
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--rod); color: #fff;
  font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.qr-foot { margin-top: auto; width: 100%; text-align: center; }

@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .sheet { margin: 0; box-shadow: none; width: auto; min-height: auto; padding: 6mm 4mm; }
  @page { size: A4; margin: 10mm; }
}

/* -------------------------------------------------------------- Responsivt */
@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .dash-top { grid-template-columns: 1fr; }
  .contacts-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid .field, .field-grid .field.span2 { grid-column: span 2; }
  .hero-value { font-size: 52px; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px; gap: 14px; }
  .user-email { display: none; }
  .container { padding: 22px 14px 80px; }
  .pub-card { padding: 28px 22px; }
  .statrow { grid-template-columns: 1fr; }
  h1 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
