/* Kiloo Properties: sort/hvid, cremefarvet baggrund, Fahkwang til overskrifter, Helvetica til tekst */
:root {
  --bg: #FAF8F2; --panel: #F5F3E9; --card: #FFFFFF; --ink: #000000; --muted: #4D4B42;
  --line: #D9D6CA; --line-soft: #ECE9DF; --busy: #E4E1D5; --danger: #9B2C1F; --ok: #2F5D3A; --warn: #8A6100; --diet: #FFF4D6;
  --serif: 'Fahkwang', Georgia, serif; --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
a { color: inherit; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.spacer { flex: 1; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: #fff; padding: 8px; }

label { font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 0;
  padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: #000; padding: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; cursor: pointer; }

.btn {
  font: 500 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink); padding: 11px 20px; min-height: 44px; cursor: pointer; border-radius: 0; white-space: nowrap;
}
.btn:hover { background: #222; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--panel); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 12px; }
.link { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 0; color: var(--ink); }
.icon-btn:hover { border-color: var(--ink); }
.msg { min-height: 1.5em; margin: 0; color: var(--danger); font-size: 14px; }
.hint { color: var(--muted); margin: 6px 0 16px; max-width: 64em; font-size: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; font: 600 10.5px/1.6 var(--sans); letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 1px 7px; vertical-align: 1px; white-space: nowrap; }
.tag.warn { background: var(--warn); } .tag.ok { background: var(--ok); } .tag.off { background: var(--danger); } .tag.soft { background: var(--busy); color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 18px; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--ink); padding: 6px 8px; white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.diet { background: var(--diet); padding: 2px 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-photo { background: url(/building.jpg) center / cover no-repeat; }
.login-panel { padding: 56px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; gap: 18px; justify-content: center; max-width: 560px; }
.login-panel .logo { margin-bottom: 8px; }
.lead { margin: 0; color: var(--muted); }
.login-panel form p { margin: 0 0 8px; }
#code { font-size: 24px; letter-spacing: .3em; }

/* ---------- Ramme ---------- */
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 6px clamp(16px, 4vw, 40px); background: var(--ink); color: #fff; flex-wrap: wrap; }
.demo-bar select { width: auto; min-height: 32px; padding: 4px 8px; background: #222; color: #fff; border-color: #555; }
.demo-bar a, .demo-bar label { color: #ddd; }
.demo-tag { font: 600 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; border: 1px solid #fff; padding: 2px 6px; }
.top { display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.top-title { min-width: 0; }
.eyebrow { margin: 0; font: 400 20px var(--serif); }
.top-title p { margin: 0; }
.top-nav { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.top-nav a { text-decoration: none; padding: 8px 12px; font-size: 14px; color: var(--muted); }
.top-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.wrap { padding: 24px clamp(16px, 4vw, 40px) 64px; max-width: 1320px; margin: 0 auto; outline: none; }

/* ---------- Kalender ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { margin: 0 8px; font-size: 22px; min-width: 9em; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { background: var(--card); border: 0; padding: 8px 14px; font: 13px var(--sans); cursor: pointer; min-height: 40px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--card); border: 1px solid var(--line); min-height: 220px; display: flex; flex-direction: column; }
.cal-day header { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.cal-day header b { font: 400 20px var(--serif); }
.cal-day header span { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.cal-day.is-today header b { text-decoration: underline; text-underline-offset: 5px; }
.cal-day.is-closed { background: repeating-linear-gradient(135deg, var(--panel) 0 6px, #EFECE1 6px 12px); }
.cal-day.is-past .add { display: none; }
.cal-day .items { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cal-day .add { margin: 6px; border: 1px dashed var(--line); background: transparent; color: var(--muted); padding: 8px; cursor: pointer; font: 13px var(--sans); }
.cal-day .add:hover { border-color: var(--ink); color: var(--ink); }
.ord { text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--ink); background: var(--bg); padding: 6px 8px; cursor: pointer; font: 12.5px/1.35 var(--sans); color: var(--ink); width: 100%; }
.ord:hover { background: var(--panel); }
.ord b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.ord .meta { color: var(--muted); }
.ord.st-draft { border-left-style: dashed; border-left-color: var(--muted); background: #fff; }
.ord.st-locked, .ord.st-delivered, .ord.st-invoiced { border-left-color: var(--muted); }
.ord.st-cancelled { opacity: .55; text-decoration: line-through; border-left-color: var(--danger); }
.ord.other { border-left-color: var(--line); }
.month-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.month-grid .cal-day { min-height: 110px; }
.month-grid .cal-day header b { font-size: 16px; }
.month-grid .out { opacity: .45; }
.month-grid .ord { padding: 3px 6px; font-size: 11.5px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-left: 3px solid var(--ink); margin-right: 5px; vertical-align: -1px; }
.legend .l-draft { border-left: 3px dashed var(--muted); }
.legend .l-locked { border-left-color: var(--muted); }

.mine { margin-top: 32px; }
.olist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.olist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.olist .when { flex: 1; min-width: 0; }
.olist .when b { display: block; font-weight: 500; }
.olist .when span { display: block; color: var(--muted); font-size: 13px; }
.date-chip { width: 52px; text-align: center; border: 1px solid var(--line); background: var(--card); padding: 4px 0; flex: none; }
.date-chip b { display: block; font: 400 22px/1.1 var(--serif); }
.date-chip span { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--ink); border-radius: 0; padding: 26px; width: min(640px, calc(100vw - 20px)); max-height: calc(100vh - 20px); background: var(--bg); color: var(--ink); }
dialog.wide { width: min(980px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin-bottom: 6px; }
.actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
fieldset { border: 1px solid var(--line); background: var(--card); padding: 8px 12px 12px; margin: 4px 0; min-width: 0; }
legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.prod { display: grid; grid-template-columns: 1fr 84px 140px 32px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.prod:last-of-type { border-bottom: 0; }
.prod .pname b { font-weight: 500; display: block; }
.prod .pname small { color: var(--muted); font-size: 12px; }
.prod input { min-height: 38px; padding: 7px 8px; }
.prod .rm { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.diet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.diet-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 14px; }
.diet-grid input { width: 64px; min-height: 36px; padding: 6px; text-align: right; }
.dates { display: flex; gap: 6px; flex-wrap: wrap; }
.dates .chip { display: inline-flex; gap: 6px; align-items: center; background: var(--ink); color: #fff; padding: 4px 4px 4px 10px; font-size: 13px; }
.dates .chip button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 0 4px; }
.summary { background: var(--panel); padding: 10px 12px; font-size: 14px; }
.summary table { width: 100%; border-collapse: collapse; }
.summary td { padding: 2px 0; }
.summary .num { text-align: right; white-space: nowrap; }
.summary tfoot td { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 600; }
.sugg { position: relative; }
.sugg-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--ink); max-height: 240px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.sugg-list li { padding: 8px 10px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--line-soft); }
.sugg-list li[aria-selected="true"], .sugg-list li:hover { background: var(--panel); }
.sugg-list small { color: var(--muted); display: block; }
.statusline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.loglist { font-size: 12.5px; color: var(--muted); margin: 0; padding-left: 18px; }

/* ---------- Ugeliste / køkken ---------- */
.days { display: flex; flex-direction: column; gap: 26px; }
.k-day h3 { border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.k-sum { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.k-sum b { color: var(--ink); font-weight: 500; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.k-order { background: var(--card); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.k-order.is-new { border: 2px solid var(--ink); }
.k-order.is-cancelled { opacity: .6; }
.k-order.is-cancelled .k-lines { text-decoration: line-through; }
.k-order header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.k-order header b { font-weight: 500; }
.k-order p { margin: 0; }
.k-lines { list-style: none; margin: 2px 0; padding: 0; }
.k-lines li { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.k-lines li:last-child { border-bottom: 0; }
.k-lines .ctl { display: flex; gap: 6px; align-items: center; }
.k-lines .t { margin-left: 4px; }
.k-lines .dev { display: block; }
.k-lines .q { min-width: 2.2em; font-weight: 600; font-variant-numeric: tabular-nums; }
.k-lines .t { color: var(--muted); font-size: 13px; }
.k-lines .dev { color: var(--danger); font-size: 13px; }
.k-lines .contents { display: block; color: var(--muted); font-size: 12px; }
.late { color: var(--danger); font-weight: 500; }
.sentline { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 20px; font-size: 14px; max-width: calc(100vw - 32px); }

@media (max-width: 900px) {
  .cal { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
  .month-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .month-grid .ord .meta { display: none; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-photo { min-height: 160px; }
  .login-panel { padding: 24px 16px 40px; }
  h1 { font-size: 26px; }
  .top { gap: 8px 12px; padding: 10px 16px; }
  .top .logo { width: 40px; }
  .top-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top-nav a { white-space: nowrap; padding: 8px 8px; }
  .wrap { padding: 16px 16px 48px; }
  .row, .row3 { grid-template-columns: 1fr; }
  .prod { grid-template-columns: 1fr 70px 32px; }
  .prod .ptime { grid-column: 1 / 3; }
  dialog { padding: 16px; }
  .cal-nav h2 { min-width: 0; font-size: 18px; }
  .month-grid { gap: 2px; }
  .month-grid .cal-day { min-height: 70px; }
  .month-grid .ord b { font-size: 10.5px; }
}
/* Ugeliste som tabel (som Excel-arket) */
.wl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.wl th, .wl td { text-align: left; vertical-align: top; padding: 4px 8px; }
.wl tr.wl-first td { border-top: 1px solid #E2DED0; padding-top: 7px; }
.wl tbody tr:last-child td { padding-bottom: 7px; }
.wl thead th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #4D4B42; border-bottom: 2px solid var(--ink); }
.wl .wl-day th { background: var(--panel, #F5F3E9); font-size: 15px; padding-top: 10px; border-bottom: 1px solid var(--ink); }
.wl .wl-sum { font-weight: 400; font-size: 13px; color: #4D4B42; margin-left: 12px; }
.wl .num { text-align: right; }
.wl .nowrap { white-space: nowrap; }
.wl .wl-note { max-width: 260px; font-size: 13px; }
.wl tr.is-cancelled td { text-decoration: line-through; color: #8A877C; }
.wl tr.is-cancelled td .tag { text-decoration: none; }
.wl .tag { font-size: 11px; vertical-align: 1px; }
.print-only { display: none; }
@media screen { .screen-hidden { display: none !important; } }
.empty-week { margin: 12px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media print {
  @page { size: A4 landscape; margin: 9mm; }
  .demo-bar, .top, .toolbar .group, .no-print, .k-order .btn, .k-lines label, #nav, .site-head, header.top { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .wrap { padding: 0; max-width: none; }
  .print-only { display: inline; }
  p.print-only { display: block; margin-top: 6px; }
  .days { display: none !important; }
  .toolbar { margin: 0 0 6px; }
  .toolbar h2 { font-size: 16px; margin: 0; }
  .scroll { overflow: visible !important; }
  .wl { font-size: 9.5pt; }
  .wl th, .wl td { padding: 1px 5px; }
  .wl tr.wl-first td { border-top: .5pt solid #999; padding-top: 2px; }
  .wl thead th { font-size: 8pt; border-bottom: 1pt solid #000; }
  .wl .wl-day th { background: #EEE !important; font-size: 10pt; padding-top: 4px; border-bottom: .5pt solid #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wl .wl-sum { font-size: 9pt; }
  .wl tbody { break-inside: avoid; }
  .wl .wl-note { max-width: none; font-size: 9pt; }
  .wl .wl-prod { white-space: nowrap; }
}
.new-banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-color: var(--ink); }
.new-banner .link { color: #fff; }
.k-lines .dq { width: 56px; min-height: 32px; padding: 4px 6px; text-align: right; }
.milk input { width: 90px; text-align: right; }
