/* Tecnodent bestilling og ukeplan. Oppsett: nøkkeltall først, så to uker med dagskort og prosent booket. */
:root{
  --bg:#FDFDFC; --surface:#FFFFFF; --soft:#E9F1EE; --line:#D6E2DD;
  --text:#22312D; --muted:#4C5F59; --green:#1D5248; --teal:#3E7C6F;
  --cta:#E07B1F; --cta-hover:#C4690F; --crit:#B3261E; --warn:#8A6100;
  --t-krone:#3E7C6F; --t-bro:#2F6690; --t-pmma:#B4522D; --t-helkjeve:#6B4E8E;
  --display:"Source Serif 4",Georgia,serif;
  --body:"Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0F1F1B; --surface:#162B26; --soft:#1C3832; --line:#2D4A42;
    --text:#EAF3EF; --muted:#BCD6CC; --green:#8FCDBB; --teal:#7FC1B0;
    --cta:#E07B1F; --cta-hover:#F08E35; --crit:#FF8A80; --warn:#F0C060;
    --t-krone:#6FBFAB; --t-bro:#7FB2DE; --t-pmma:#E8946F; --t-helkjeve:#B79BDD;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0F1F1B; --surface:#162B26; --soft:#1C3832; --line:#2D4A42;
  --text:#EAF3EF; --muted:#BCD6CC; --green:#8FCDBB; --teal:#7FC1B0;
  --cta:#E07B1F; --cta-hover:#F08E35; --crit:#FF8A80; --warn:#F0C060;
  --t-krone:#6FBFAB; --t-bro:#7FB2DE; --t-pmma:#E8946F; --t-helkjeve:#B79BDD;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--text);font-family:var(--body);font-size:16px;line-height:1.5}
.wrap{max-width:1100px;margin:0 auto;padding:20px 16px 56px;display:flex;flex-direction:column;gap:24px}
h1,h2,h3{font-family:var(--display);font-weight:600;color:var(--green);margin:0;text-wrap:balance}
h1{font-size:30px;line-height:1.15}
h2{font-size:22px}
h3{font-size:18px}
p{margin:0}
.eyebrow{font-size:13px;text-transform:uppercase;letter-spacing:.1em;color:var(--teal);font-weight:600}
.top{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;justify-content:space-between}
.top-title{display:flex;flex-direction:column;gap:4px}
.tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab{font:inherit;font-weight:600;padding:9px 16px;border-radius:8px;border:2px solid var(--green);color:var(--green);background:transparent;text-decoration:none;cursor:pointer}
.tab[aria-current="page"]{background:var(--green);color:var(--bg)}
.ghost{font:inherit;padding:9px 12px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--muted);cursor:pointer}
.note{background:var(--soft);border-radius:12px;padding:12px 16px;color:var(--muted);font-size:15px}
:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
section.view{display:flex;flex-direction:column;gap:24px}
section.view[hidden]{display:none}

.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}
.tile .big{font-size:24px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2}
.tile .sub{color:var(--muted);font-size:14.5px}
.tile.alert{border:2px solid var(--crit)}
.tile.alert .big{color:var(--crit)}

.week{display:flex;flex-direction:column;gap:10px}
.week-head{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:baseline;justify-content:space-between}
.load{display:flex;flex-direction:column;gap:4px}
.load-text{font-size:15px;color:var(--muted);font-variant-numeric:tabular-nums}
.load-text strong{color:var(--text)}
.bar{height:14px;border-radius:7px;background:var(--soft);position:relative;overflow:hidden;border:1px solid var(--line)}
.bar .buffer{position:absolute;right:0;top:0;bottom:0;width:30%;background:repeating-linear-gradient(135deg,transparent 0 5px,var(--line) 5px 8px)}
.bar .fill{position:absolute;left:0;top:0;bottom:0;background:var(--teal)}
.bar .fill.full{background:var(--green)}
.scroller{overflow-x:auto}
.grid{display:grid;grid-template-columns:repeat(5,minmax(136px,1fr));gap:8px;min-width:720px}
.day{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px}
.day.past{opacity:.45}
.day.shipday{border:2px solid var(--green)}
.day-head{display:flex;flex-direction:column;gap:2px;font-weight:600;font-size:15px}
.chiprow{display:flex;flex-wrap:wrap;gap:4px;min-height:22px}
.chip{display:inline-block;font-size:12.5px;font-weight:600;padding:1px 8px;border-radius:999px;background:var(--soft);color:var(--green);white-space:nowrap}
.chip.express{background:color-mix(in srgb,var(--t-pmma) 18%,var(--surface));color:var(--t-pmma)}
.slots{display:flex;flex-direction:column;gap:4px}
.blk{font:inherit;font-size:13.5px;line-height:1.25;text-align:left;color:var(--text);cursor:pointer;border:0;border-left:5px solid var(--tc);background:color-mix(in srgb,var(--tc) 15%,var(--surface));border-radius:6px;padding:4px 8px;overflow:hidden;display:flex;flex-direction:column;justify-content:center;gap:1px;width:100%}
.blk span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.blk .l1{font-weight:700}
.blk .l2{color:var(--muted)}
.blk.late{outline:2px solid var(--crit);outline-offset:-2px}
.blk:hover{background:color-mix(in srgb,var(--tc) 26%,var(--surface))}
.free{border:1px dashed var(--line);border-radius:6px;color:var(--muted);font-size:13px;display:flex;align-items:center;justify-content:center;font-variant-numeric:tabular-nums}
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:14px;color:var(--muted)}
.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;background:var(--tc);margin-right:6px;vertical-align:-1px}
.legend i.buf{background:repeating-linear-gradient(135deg,var(--soft) 0 4px,var(--line) 4px 7px);border:1px solid var(--line)}

.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px 20px;display:flex;flex-direction:column;gap:12px}
.ships{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
.ship h3{font-size:17px}
.ship ul{margin:0;padding-left:18px}
.ship li{margin:2px 0}
.later{font-size:15px;color:var(--muted)}

.order{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:760px){.order{grid-template-columns:1fr}}
form{display:flex;flex-direction:column;gap:12px}
label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:15px}
label small{font-weight:400;color:var(--muted)}
select,input{font:inherit;padding:9px 10px;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--text);width:100%}
.cta{font:inherit;font-weight:700;color:#fff;background:var(--cta);border:0;border-radius:8px;padding:14px 28px;cursor:pointer;align-self:flex-start}
.cta:hover{background:var(--cta-hover)}
.cta:disabled{opacity:.5;cursor:not-allowed}
.calm{font-size:14px;color:var(--muted)}
.proposal{border:2px solid var(--green)}
.steps{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.steps dt{color:var(--muted)}
.steps dd{margin:0;font-weight:600}
.steps dd.key{font-size:20px;color:var(--green)}
.warnline{color:var(--warn);font-weight:600}
.okline{color:var(--teal);font-weight:600}
.tablewrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;min-width:740px;font-size:15px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--teal)}
td.num{font-variant-numeric:tabular-nums}
.pill{display:inline-block;padding:1px 10px;border-radius:999px;font-size:13px;font-weight:600;background:var(--soft);color:var(--green)}
.pill.work{background:color-mix(in srgb,var(--t-bro) 18%,var(--surface));color:var(--t-bro)}
.pill.exp{background:color-mix(in srgb,var(--t-pmma) 18%,var(--surface));color:var(--t-pmma)}
.pill.late{background:color-mix(in srgb,var(--crit) 16%,var(--surface));color:var(--crit)}
dialog{border:1px solid var(--line);border-radius:14px;padding:22px 24px;background:var(--surface);color:var(--text);max-width:min(480px,calc(100% - 32px));width:100%}
dialog::backdrop{background:rgba(10,25,21,.55)}
.dlg{display:flex;flex-direction:column;gap:12px}
.dlg dl{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:0}
.dlg dt{color:var(--muted)}
.dlg dd{margin:0;font-weight:600}
.qr{display:flex;flex-wrap:wrap;gap:20px;align-items:center}
.qr-code{background:#fff;padding:8px;border-radius:10px;border:1px solid var(--line);line-height:0}
.qr-code svg{width:148px;height:148px;display:block}
.qr ol{margin:0;padding-left:20px}
.btn2{font:inherit;font-weight:600;display:inline-block;padding:9px 16px;border-radius:8px;border:2px solid var(--green);color:var(--green);background:transparent;text-decoration:none;cursor:pointer;align-self:flex-start}
.phone{max-width:460px;margin:0 auto;width:100%;display:flex;flex-direction:column;gap:16px}
.slotgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.slot{border:2px dashed var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px;min-height:176px;justify-content:space-between}
.slot.filled{border-style:solid;border-color:var(--teal)}
.slot .nm{font-weight:600;font-size:15px}
.slot img{width:100%;height:104px;object-fit:cover;border-radius:8px}
.acts{display:flex;flex-direction:column;gap:6px}
.sbtn{font:inherit;font-size:14.5px;font-weight:600;padding:8px;border-radius:8px;border:1px solid var(--line);background:var(--soft);color:var(--green);cursor:pointer}
.thumbs{display:flex;flex-wrap:wrap;gap:6px}
.thumbs img{width:72px;height:72px;object-fit:cover;border-radius:6px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

.pct{display:flex;align-items:baseline;gap:8px;font-variant-numeric:tabular-nums}
.pct b{font-size:22px;line-height:1.1}
.pct span{font-size:13px;color:var(--muted)}
.pct.over b{color:var(--crit)}
.daybar{height:8px;border-radius:4px;background:var(--soft);overflow:hidden;border:1px solid var(--line)}
.daybar i{display:block;height:100%;background:var(--teal)}
.daybar i.full{background:var(--green)}
.daybar i.over{background:var(--crit)}
.sec{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--teal);font-weight:600;margin-top:4px}
.blk{height:auto;padding:5px 8px}
.oth{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:13.5px;line-height:1.25;border-left:5px solid var(--muted);background:var(--soft);border-radius:6px;padding:5px 6px 5px 8px}
.oth span{overflow-wrap:anywhere}
.x{font:inherit;border:0;background:transparent;color:var(--muted);cursor:pointer;padding:0 4px;font-size:16px;line-height:1}
.dayfoot{display:flex;flex-direction:column;gap:4px;margin-top:auto;padding-top:6px}
.daybtn{font:inherit;font-size:13px;padding:5px 6px;border-radius:6px;border:1px dashed var(--line);background:transparent;color:var(--green);cursor:pointer;text-align:left}
.day.closed{background:var(--soft)}
.freeline{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.teethwrap{overflow-x:auto}
.teeth{display:grid;grid-template-columns:repeat(16,minmax(30px,1fr));gap:3px;min-width:520px}
.tooth{font:inherit;font-size:12.5px;font-variant-numeric:tabular-nums;padding:7px 0;border-radius:6px;border:1px solid var(--line);background:var(--bg);color:var(--text);cursor:pointer}
.tooth[aria-pressed="true"]{background:var(--teal);border-color:var(--teal);color:var(--bg);font-weight:700}
.teeth .gapl{margin-left:6px}
.radios{display:flex;gap:16px;flex-wrap:wrap;font-weight:400}
.radios label,.check{flex-direction:row;align-items:center;gap:8px;font-weight:400}
.radios input,.check input{width:auto}
fieldset{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
legend{font-weight:600;font-size:15px;padding:0;margin-bottom:4px}
textarea{font:inherit;padding:9px 10px;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--text);width:100%;min-height:64px;resize:vertical}
.adj{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.adj button{font:inherit;font-weight:700;width:34px;height:30px;border-radius:6px;border:1px solid var(--line);background:var(--soft);color:var(--green);cursor:pointer}
.dlg select,.dlg input{max-width:100%}
.blk.hl{outline:3px solid var(--green);outline-offset:1px;background:color-mix(in srgb,var(--tc) 34%,var(--surface))}
.blk.dim{opacity:.4}
.day.hlship{box-shadow:0 0 0 3px var(--green)}
.day.hlship .chip{background:var(--green);color:var(--bg)}
.blk[draggable="true"]{cursor:grab}
.day.drop{box-shadow:0 0 0 3px var(--teal)}
/* ---- App-tillegg ---- */
.tabs{align-items:center}
button.tab{font:inherit;font-weight:600}
.hvem{color:var(--muted);font-size:14.5px;margin-left:6px}
.gate{max-width:440px;margin:24px auto;width:100%}
.err{color:var(--crit);font-weight:600;min-height:1.4em}
.lenke{font:inherit;background:none;border:0;padding:0;color:var(--green);text-decoration:underline;cursor:pointer;text-align:left}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);background:var(--green);color:var(--bg);padding:10px 18px;border-radius:10px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:calc(100% - 32px);z-index:50}
.toast.vis{opacity:1;transform:translateX(-50%)}
.toast.feil{background:var(--crit);color:#fff}
@media (prefers-reduced-motion:reduce){.toast{transition:none}}
.ukenav{display:flex;gap:8px;flex-wrap:wrap}
.ghost.valgt{border-color:var(--green);color:var(--green);font-weight:600}
.chip.idag{background:var(--green);color:var(--bg)}
.blk.ferdig{opacity:.5}
.blk.ferdig .l1{text-decoration:line-through}
.pill.ok{background:var(--soft);color:var(--muted)}
tr.rad{cursor:pointer}
tr.rad:hover td{background:var(--soft)}
dialog{max-width:min(640px,calc(100% - 24px));max-height:calc(100% - 24px)}
.dlg h3{margin-top:8px}
.dlg-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.x.stor{font-size:26px;padding:0 6px}
.datoer{background:var(--soft);border-radius:10px;padding:10px 12px}
.labbox{border:1px solid var(--line);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px}
.to{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:520px){.to{grid-template-columns:1fr}}
.knapper{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.cta.liten{padding:10px 18px}
.thumb{position:relative;display:inline-block}
.thumb .x{position:absolute;top:2px;right:2px;background:var(--surface);border-radius:50%;width:22px;height:22px;line-height:20px}
.slot a{display:block;line-height:0}
.qrboks summary{cursor:pointer;color:var(--green);font-weight:600}
.qrboks .qr{margin-top:10px}
.chat{display:flex;flex-direction:column;gap:8px;max-height:260px;overflow-y:auto;padding:4px 2px}
.msg{align-self:flex-start;max-width:85%;background:var(--soft);border-radius:10px;padding:7px 11px;display:flex;flex-direction:column;gap:2px}
.msg.min{align-self:flex-end;background:color-mix(in srgb,var(--teal) 18%,var(--surface))}
.hvem2{font-size:12.5px;color:var(--muted)}
.tekst{white-space:pre-wrap;overflow-wrap:anywhere}
.mform{flex-direction:row;align-items:flex-end;gap:8px}
.mform textarea{min-height:44px}
.celle{padding:6px 8px;min-width:120px}
.celle.smal{min-width:70px;width:80px}
input[type=checkbox].celle{min-width:0;width:auto}
.rad4{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}
.rad4 button{justify-self:start}
.enkel{margin:0;padding-left:18px}
code{background:var(--soft);padding:2px 6px;border-radius:4px;overflow-wrap:anywhere}

