/* Gemensam stil för backoffice och admin. Färger som tokens, ljust och mörkt läge. */
:root {
  --bg: #EDF0EE; --surface: #FFFFFF; --surface-2: #F4F6F5; --ink: #17201D; --muted: #5F6B67; --line: #D5DCD8;
  --accent: #1E5B4F; --accent-ink: #FFFFFF; --accent-soft: #DFEDE8;
  --draft: #8A5A00; --draft-soft: #FBEFD6; --live: #1E7A45; --live-soft: #DDF2E5;
  --warn: #9A3412; --warn-soft: #FCE6DA; --allergen: #7A3E00; --allergen-soft: #FDEBD3; --phone: #121816;
  --radius: 14px;
  --font: "Figtree", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614; --surface: #1A211E; --surface-2: #212A26; --ink: #E6ECE9; --muted: #9AA8A2; --line: #2F3A35;
    --accent: #5FB8A3; --accent-ink: #0B1714; --accent-soft: #1D3530;
    --draft: #E7B65A; --draft-soft: #3A2D12; --live: #6CCB92; --live-soft: #173323;
    --warn: #F09A72; --warn-soft: #3D2217; --allergen: #F2B979; --allergen-soft: #3A2814; --phone: #050706;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 600px; margin: 0 auto; padding: 0 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.app.wide { max-width: 1180px; }

/* Topprad */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; }
.brand .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--accent); font-weight: 800; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
select.pick { appearance: none; -webkit-appearance: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 34px 9px 12px; font-weight: 700; min-width: 0; max-width: 62vw;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; border: 0; background: none; border-radius: 9px; padding: 8px 7px; font-weight: 700; font-size: 12.5px; letter-spacing: -.01em; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Kort och fält */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2, .card h3 { margin: 0; font-size: 17px; }
.card h2 { font-size: 19px; }
.card p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], select.input, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 16px; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input:disabled, textarea:disabled, select:disabled { opacity: .6; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.btn { font-weight: 700; font-size: 15px; border-radius: 12px; padding: 11px 16px; border: 1px solid transparent; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.btn.sm { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.draft { background: var(--draft-soft); color: var(--draft); }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.none { background: var(--surface-2); color: var(--muted); }
.pill.info { background: var(--accent-soft); color: var(--accent); }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.empty h2 { margin: 0; font-size: 19px; }
.empty p { margin: 0; color: var(--muted); }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--surface-2); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.scroll-x { overflow-x: auto; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
.bottom .in { max-width: 568px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bottom .btn { flex: 1; }
.bottom .hint { font-size: 12px; color: var(--muted); max-width: 46%; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 50; max-width: min(90vw, 480px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.error { background: var(--warn); color: #fff; }

/* Inloggning */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; }
.auth h1 { margin: 0; font-size: 22px; }

/* Meny-redigering */
.weekrow { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.navbtn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; cursor: pointer; }
.weekinfo { text-align: center; }
.weekinfo .w { font-weight: 800; font-size: 20px; line-height: 1.1; }
.weekinfo .d { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.save { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dayhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dayhead .n { font-weight: 800; }
.dayhead .dt { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.dish { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dishtop { display: flex; gap: 8px; align-items: flex-start; }
.dishtop textarea { flex: 1; min-height: 46px; resize: none; overflow: hidden; background: var(--surface); font-weight: 600; }
.iconbtn { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--muted); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.chip.diet[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.alg[aria-pressed="true"] { background: var(--allergen-soft); border-color: var(--allergen); color: var(--allergen); }
.chip.more { border-style: dashed; color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--allergen-soft); color: var(--allergen); }
.add { border: 1px dashed var(--line); background: none; border-radius: 12px; padding: 10px; font-weight: 700; color: var(--accent); cursor: pointer; }
.lock { background: var(--phone); border-radius: 22px; padding: 14px; }
.notif { background: var(--surface); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.notif .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.notif .ic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.notif .t { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.notif .t span { font-weight: 400; color: var(--muted); }
.notif .m { font-size: 13px; line-height: 1.35; }
.suggest { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tpl { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.tpl ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.rotrow { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.rotrow .no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.logoedit { display: flex; gap: 14px; align-items: center; }
.logoedit .big { width: 88px; height: 88px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 28px; color: var(--accent); flex: none; }
.logoedit .big img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.codein { font-family: var(--mono); font-size: 24px !important; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
.stampres { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Admin-layout */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; }
.side button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; display: flex; justify-content: space-between; }
.side button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.side .count { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .side { position: static; flex-direction: row; overflow-x: auto; } .side button { white-space: nowrap; } }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: 24px; }
.status-lead { background: var(--surface-2); color: var(--muted); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.subtabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline .item { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; }
.timeline .item.task { border-left-color: var(--draft); }
.timeline .item.done { opacity: .6; }
.timeline .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.invrows td:last-child { text-align: right; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Lista över skickade notiser (läsbar i mobilen) */
.nlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nlist li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.nlist .nmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.nlist p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }

/* QR-kod i admin */
.qrrow { display: flex; gap: 16px; align-items: center; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.qrrow > div:last-child { flex: 1 1 220px; }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 8px; overflow: hidden; }
.qr svg { width: 100%; height: 100%; display: block; }

/* Veckomeny: verktygsrad, utfällbara dagar, spartillstånd */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select.input { flex: 1 1 200px; min-width: 0; }
.day { padding: 0; overflow: hidden; }
.daysum { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "dn chev" "ds chev" "dp chev"; gap: 2px 10px; align-items: center; text-align: left; background: none; border: 0; padding: 14px 16px; cursor: pointer; color: inherit; min-height: 56px; }
.daysum:hover { background: var(--surface-2); }
.daysum .dn { grid-area: dn; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.daysum .dt { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.daysum .ds { grid-area: ds; font-size: 13px; font-weight: 600; color: var(--live); }
.daysum .ds.closed { color: var(--muted); }
.daysum .ds.empty { color: var(--draft); }
.daysum .dp { grid-area: dp; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.daysum .chev { grid-area: chev; color: var(--muted); font-size: 14px; }
.daybody { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.copyday { flex-wrap: nowrap; padding-top: 4px; }
.copyday select.input { flex: 1; min-width: 0; }
.save.error { color: var(--warn); font-weight: 700; }
.save.saved { color: var(--live); }
.save.saving, .save.pending { color: var(--muted); }
.plan { font-size: 13px; border-radius: 10px; padding: 8px 12px; margin-top: 8px; background: var(--accent-soft); color: var(--accent); }
.plan.soon { background: var(--draft-soft); color: var(--draft); }
.plan.past { background: var(--surface-2); color: var(--muted); }
.dish textarea, .dishtop textarea { overflow-wrap: anywhere; }

/* Blad (dialog) */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(10,14,12,.45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .sheet { align-items: center; padding: 24px; } }
.sheetin { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 640px) { .sheetin { border-radius: 20px; padding: 22px; } }
.sheetin h2 { margin: 0; font-size: 20px; }
.sheetbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sheetactions { justify-content: flex-end; flex-direction: row-reverse; }
.sheetactions .btn { flex: 1 1 140px; }

/* Granskning */
.review { display: flex; flex-direction: column; gap: 10px; }
.review p { margin: 0; }
.rv-h { font-weight: 700; }
.rv-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-days li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; font-size: 14px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.rv-days li span { overflow-wrap: anywhere; }
.rv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.rv-row b { text-align: right; overflow-wrap: anywhere; }
.rv-n { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.rv-n p { font-size: 14px; }
.rv-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rv-facts { margin: 0; display: grid; gap: 0; }
.rv-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rv-facts dt { color: var(--muted); }
.rv-facts dd { margin: 0; font-weight: 700; text-align: right; }
.ok { font-weight: 700; color: var(--live); font-size: 17px; }

/* Gästförhandsvisning */
.gprev { background: #12302A; color: #F4EEDF; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.gh { display: flex; flex-direction: column; gap: 2px; }
.gh b { font-size: 18px; }
.gh span { font-size: 12px; opacity: .75; }
.gday { background: rgba(244,238,223,.08); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.gd { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }
.gdish { display: flex; flex-direction: column; gap: 2px; }
.gt { font-weight: 700; overflow-wrap: anywhere; }
.gs { font-size: 13px; opacity: .85; overflow-wrap: anywhere; }
.gv { font-size: 12px; color: #A8DDB0; font-weight: 600; }
.ga { font-size: 12px; color: #F2C98A; }
.gm { font-size: 13px; opacity: .7; }
.gf { font-size: 13px; opacity: .85; }

/* Stämpling */
.stamprow { flex-wrap: nowrap; }
.stamprow .codein { flex: 1; min-width: 0; }
@media (max-width: 420px) { .stamprow { flex-wrap: wrap; } .stamprow .codein { flex-basis: 100%; } .stamprow .btn { flex: 1; } }
.stampres { border: 1px solid transparent; }
.stampres.stamp { background: var(--live-soft); }
.stampres.undo { background: var(--surface-2); }
.sr-main { display: flex; flex-direction: column; gap: 2px; }
.sr-main b { font-size: 17px; }
.sr-count { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.scanner { position: relative; border-radius: 14px; overflow: hidden; background: #000; display: flex; flex-direction: column; }
.scanvideo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.scanframe { position: absolute; inset: 18% 18% auto; aspect-ratio: 1; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; pointer-events: none; }
.scanner .small { background: var(--surface); padding: 10px 0 0; }

/* Notiser */
.nplan { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.npreview { background: var(--phone); border-radius: 16px; padding: 12px; }
.npreview .np-app { font-size: 12px; font-weight: 700; color: #fff; opacity: .8; margin-bottom: 4px; }
.npreview .np-body { background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.senderr:empty { display: none; }
.senderr { color: var(--warn); }

/* Säljflöde i admin */
.salesform { display: flex; flex-direction: column; gap: 14px; }
.salesform input[type=color] { width: 46px; height: 42px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); flex: none; }
.salesform textarea { min-height: 220px; font-family: var(--mono); font-size: 13px; }
.hoursgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sp { width: 220px; border-radius: 16px; overflow: hidden; background: #F6F1E7; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-size: 13px; color: #1D2420; }
.sp-hd { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
.sp-hd img { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; background: #fff; }
.sp-hd b { font-family: Georgia, serif; font-size: 16px; color: var(--b); }
.sp-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--b); color: #fff; display: grid; place-items: center; font-weight: 700; }
.sp-lunch { margin: 0 10px 10px; background: var(--b); color: #F6F1E7; border-radius: 12px; padding: 10px 12px; display: grid; gap: 1px; }
.sp-lunch small { color: var(--a); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.sp-lunch b { font-family: Georgia, serif; font-size: 20px; }
.parsed { display: grid; gap: 6px; align-content: start; }
.pd { display: grid; grid-template-columns: 76px 1fr; gap: 8px; font-size: 14px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: f; }
.flow li { display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; counter-increment: f; }
.flow li::before { content: counter(f); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.flow li.done::before { content: "✓"; background: var(--live-soft); color: var(--live); }
.flow li.warn::before { background: var(--warn-soft); color: var(--warn); }
.flow li span { font-size: 13px; color: var(--muted); }
.linkrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.linkrow span { color: var(--muted); }
.linkrow a { overflow-wrap: anywhere; }
@media (max-width: 640px) { .linkrow { grid-template-columns: 1fr auto; } .linkrow span { grid-column: 1 / -1; } }
.mailprev { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mailprev > div { display: grid; grid-template-columns: 60px 1fr; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mailprev > div span { color: var(--muted); }
.mailprev pre { margin: 0; padding: 12px; white-space: pre-wrap; font: 14px/1.5 var(--font); max-height: 320px; overflow: auto; background: var(--surface-2); }

/* Kundens startsida */
.start { min-height: 100vh; display: flex; flex-direction: column; }
.st-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.st-brand { display: flex; gap: 10px; align-items: center; }
.st-brand .mark { width: 36px; height: 36px; border-radius: 10px; background: #1E4D3B; display: grid; place-items: center; flex: none; }
.st-brand .mark svg { width: 25px; height: 25px; display: block; }
.st-brand b { display: block; font-size: 16px; line-height: 1.1; }
.st-brand small { color: var(--muted); font-size: 12px; }
.st-steps { list-style: none; display: flex; gap: 6px; justify-content: center; margin: 18px auto 0; padding: 0 16px; flex-wrap: wrap; }
.st-steps li { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.st-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; }
.st-steps li.on { color: var(--ink); border-color: var(--accent); }
.st-steps li.on span { background: var(--accent); color: var(--accent-ink); }
.st-steps li.done span { background: var(--live-soft); color: var(--live); }
.st-main { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.st-main h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.st-main .lead { margin: -4px 0 4px; color: var(--muted); font-size: 16px; }
.st-app { flex-direction: row; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.st-appinfo { display: flex; gap: 14px; align-items: center; min-width: 0; }
.st-appinfo img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.st-appinfo b { display: block; font-size: 18px; }
.st-appinfo a { font-size: 14px; overflow-wrap: anywhere; }
.st-qrbox { display: grid; justify-items: center; gap: 6px; }
.st-qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--line); }
.st-qr svg, .qp-code svg { width: 100%; height: 100%; display: block; }
.st-actions { gap: 12px; }
.btn.big { padding: 14px 22px; font-size: 16px; }
.st-form { display: flex; flex-direction: column; gap: 14px; }
.st-form textarea { min-height: 84px; }
.st-price { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-price div { display: grid; gap: 2px; }
.st-price span { font-size: 13px; color: var(--muted); }
.st-price b { font-size: 18px; }
.st-price p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 560px) { .st-price { grid-template-columns: 1fr; } }
.st-agreement { max-height: 460px; overflow-y: auto; }
.agreement h2 { font-size: 20px; margin: 0 0 6px; }
.agreement h3 { font-size: 15px; margin: 14px 0 4px; }
.agreement p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.st-accept { align-items: flex-start; font-weight: 500; line-height: 1.45; }
.st-done { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 16px 0 6px; }
.st-check { width: 64px; height: 64px; border-radius: 50%; background: var(--live-soft); color: var(--live); display: grid; place-items: center; font-size: 32px; font-weight: 800; }
.sigblock { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.sigblock p { margin: 0 0 6px; overflow-wrap: anywhere; }
.st-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px; }
@media print {
  .no-print, .st-top, .st-foot, .st-steps, .toast { display: none !important; }
  body, .start, .st-main { background: #fff !important; color: #000 !important; }
  .st-agreement { max-height: none; overflow: visible; border: 0; box-shadow: none; }
}

/* QR-utskrift */
.qp-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2; }
.qp-wrap { max-width: 600px; margin: 60px auto; padding: 0 16px; }
.qp-page { width: 210mm; min-height: 297mm; margin: 20px auto; background: #fff; color: #111; box-shadow: 0 2px 12px rgba(0,0,0,.12); box-sizing: border-box; }
.qp-poster { padding: 22mm 18mm; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8mm; border-top: 10mm solid var(--b); }
.qp-poster h1 { font: 700 34pt/1.1 Georgia, serif; color: var(--b); margin: 0; }
.qp-logo { max-width: 90mm; max-height: 36mm; object-fit: contain; }
.qp-name { font: 700 22pt Georgia, serif; color: var(--b); }
.qp-sub { font-size: 15pt; margin: 0; max-width: 150mm; color: #333; }
.qp-code { width: 34mm; height: 34mm; }
.qp-code.big { width: 110mm; height: 110mm; }
.qp-foot { font-size: 13pt; color: #333; margin-top: auto; }
.qp-tents { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.qp-tent { border: 1px dashed #bbb; padding: 10mm 8mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4mm; border-top: 5mm solid var(--b); }
.qp-tent img { max-width: 55mm; max-height: 18mm; object-fit: contain; }
.qp-tent .qp-code { width: 50mm; height: 50mm; }
.qp-t1 { font: 700 15pt/1.15 Georgia, serif; color: var(--b); }
.qp-t2 { font-size: 9.5pt; color: #333; max-width: 70mm; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  .qp-page { margin: 0; box-shadow: none; page-break-after: always; break-after: page; height: 297mm; }
}
@media screen and (max-width: 840px) { .qp-page { transform-origin: top left; zoom: .45; } }

/* Pipeline */
.pipe-stages { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pipe-stage { flex: none; display: flex; gap: 8px; align-items: baseline; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px; }
.pipe-stage b { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.pipe-stage[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pipe-stage[aria-pressed="true"] b { color: inherit; }
.pipe-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 760px) { .pipe-filters { grid-template-columns: 1fr 1fr; } .pipe-filters > :first-child { grid-column: 1 / -1; } }
.pipe-table td { vertical-align: top; }
.pipe-name { min-width: 220px; max-width: 340px; }
.pipe-note { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pipe-contact { min-width: 170px; font-size: 14px; overflow-wrap: anywhere; }
.pipe-select { min-width: 170px; }
.pipe-date { min-width: 140px; }
.pipe-add { flex-wrap: wrap; align-items: center; }
.pipe-add .input { flex: 1 1 180px; }
.pipe-sender summary { cursor: pointer; font-weight: 700; }
.prio { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.prio.p1 { background: var(--live-soft); color: var(--live); }
.prio.p2 { background: var(--draft-soft); color: var(--draft); }
.prio.p3 { background: var(--surface-2); color: var(--muted); }
.warn-text { color: var(--warn); font-weight: 700; }
.kpi.plain { text-decoration: none; color: inherit; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Erbjudanden och rabatter per kund */
.offer-presets { margin-bottom: 12px; }
.offer-presets .chip { min-height: 34px; }
.offer-presets .chip:hover { border-color: var(--accent); color: var(--accent); }
.offer-form .field[hidden] { display: none; }
.offer-preview { min-height: 1.4em; margin: 4px 0 10px; color: var(--ink); }
.offer-list { display: flex; flex-direction: column; }
.offer-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.offer-item:first-child { border-top: 0; padding-top: 0; }
.offer-main { min-width: 0; }
.offer-desc { margin: 4px 0 0; }
tr.muted td { color: var(--muted); }
.st-offers { grid-column: 1 / -1; margin: 4px 0 0; padding-left: 18px; font-weight: 600; display: grid; gap: 4px; }
.offer-item > .btn { flex: none; white-space: nowrap; }
.st-pkgs { grid-column: 1 / -1; }
.st-pkgtable { width: 100%; border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; }
.st-pkgtable td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.st-pkgtable td:first-child { font-weight: 700; width: 30%; }
.st-pkgtable td.num { text-align: right; font-weight: 700; }
