/* Infinium Connect – biroja lapas izskats (zaļais stils, kā Zahner; bez ārējām bibliotēkām) */
:root {
  --bg: #f3f6f2;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d9dde3;
  --primary: #2e7d4f;
  --primary-dark: #1f5130;
  --danger: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; background: var(--primary-dark); color: #fff; padding: .75rem 1.25rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 700; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar .logout { display: flex; align-items: center; gap: .75rem; margin: 0; }
.topbar .logout button.link { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; cursor: pointer; }

main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.card.narrow { max-width: 380px; margin: 4rem auto; }

.toolbar { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .75rem; }
label .help { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .45rem .55rem; border: 1px solid var(--border); border-radius: 5px; font: inherit; background: #fff; }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin-right: .4rem; }
textarea { min-height: 4rem; }
.toolbar input, .toolbar select { width: auto; min-width: 12rem; }

button, .button { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: 5px; padding: .5rem 1rem; font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--primary-dark); }
.button.secondary { background: #e5e7eb; color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.grid .wide { grid-column: 1 / -1; }
.errorlist { color: var(--danger); margin: .25rem 0 0; padding: 0; list-style: none; font-size: .85rem; font-weight: 400; }
.message { padding: .6rem .9rem; border-radius: 5px; margin-bottom: 1rem; background: #e8f3ec; }
.message.success { background: #e7f6ec; color: var(--ok); }
.message.error { background: #fdecea; color: var(--danger); }
.message.warning { background: #fff4e5; color: #b54708; font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); background: #fafbfc; }
tr:hover td { background: #f7f9fb; }
.muted { color: var(--muted); }
.inactive td { color: var(--muted); text-decoration: line-through; }
.actions { display: flex; gap: .75rem; margin-top: 1rem; }

h3 { font-size: 1rem; margin: 0 0 .5rem; }
button.link { background: none; border: 0; color: var(--primary); padding: .25rem 0; font-weight: 400; text-decoration: underline; cursor: pointer; }
button.link:hover { background: none; color: var(--primary-dark); }
.subform { border: 1px dashed var(--border); border-radius: 6px; padding: .75rem 1rem; margin: .5rem 0 1rem; background: #fafbfc; }
.radio-row { display: flex; gap: 1.5rem; margin-bottom: .75rem; flex-wrap: wrap; }
label.inline { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin: 0; }
label.inline input { margin: 0; }
.radio-row ul.errorlist { flex-basis: 100%; }

.map { height: 420px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1rem; }
.map-number { background: var(--primary); color: #fff; border: 2px solid #fff; border-radius: 50%; text-align: center; line-height: 22px; font-weight: 700; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

#route tr[draggable] { cursor: grab; }
#route .handle { color: var(--muted); width: 1.5rem; }
#route tr.dragging td { background: #e8f3ec; opacity: .7; }

.grid-table td, .grid-table th { padding: .3rem .4rem; }
.grid-table .num { text-align: center; }
.grid-table input[type=number] { width: 3.6rem; margin: 0 auto; text-align: center; padding: .3rem; }
.grid-table input.price { width: 5.5rem; margin: 0 auto; text-align: right; padding: .3rem; }
.grid-table input.changed { background: #fff7d6; border-color: #e0b400; }
.grid-table input.invalid { background: #fdecea; border-color: var(--danger); }
.grid-table tr.weekend td { background: #f7f8fa; }
.grid-table tr.past td { color: var(--muted); }
.grid-table tr.past input { background: #f1f2f4; }
.grid-table tr.week-row td { background: #e8f3ec; }
.grid-table tr.week-row .link { margin-left: 1rem; }
.grid-table tr.totals-row td { background: #fafbfc; font-size: .85rem; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.columns .card { margin-bottom: 0; }
.columns + .card { margin-top: 1rem; }
.badge { display: inline-block; min-width: 1.4rem; text-align: center; padding: 0 .3rem; border-radius: 4px; font-size: .75rem; font-weight: 700; background: #dcefe2; color: var(--primary-dark); }
.badge.manual { background: #fff7d6; color: #8a6d00; }
.badge.cancelled { background: #fdecea; color: var(--danger); }

.search-wrap { position: relative; display: inline-block; }
.toolbar .search-wrap, label .search-wrap { display: block; }
.topbar-search { width: 12rem; margin: 0; padding: .35rem .6rem; border-radius: 5px; border: 0; }
.customer-suggestions { top: calc(100% + 2px); min-width: 22rem; color: var(--text); }
.customer-suggestions li { font-weight: 400; }
.customer-suggestions li.active { background: #e8f3ec; }
.customer-suggestions li.inactive-hit strong { text-decoration: line-through; color: var(--muted); }

.standing-table td.small { font-size: .82rem; white-space: nowrap; }

.chips { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-left: .5rem; }
.chip { background: #e5e7eb; color: var(--text); padding: .2rem .6rem; border-radius: 999px; font-size: .85rem; }
.chip:hover { background: #d1d5db; }
.chip.active { background: var(--primary); color: #fff; }

.address-search { position: relative; max-width: 640px; }
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 4.2rem; margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.suggestions li { padding: .5rem .7rem; cursor: pointer; }
.suggestions li:hover { background: #e8f3ec; }
.align-right .customer-suggestions { left: auto; right: 0; }
.audit td.small { font-size: .82rem; }
.audit .old { text-decoration: line-through; color: var(--muted); }
.audit tr.audit-delete td:nth-child(3), .audit tr.audit-login_failed td:nth-child(3) { color: var(--danger); }
.small { font-size: .8rem; }
.tour-list { break-inside: avoid-page; }

/* Drukāšana: bez izvēlnes un pogām, katra tūre uz savas lapas */
@media print {
  .topbar, .no-print, .message { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main { max-width: none; margin: 0; padding: 0; }
  .card { border: 0; padding: 0; margin: 0 0 1rem; }
  .tour-list { break-before: page; }
  a { color: inherit; text-decoration: none; }
  th, td { padding: .2rem .3rem; }
}
.handout-line { display: block; margin: .15rem 0 0; font-size: .82rem; font-weight: 600; color: #8a6d00; }
.handout-line button.link { font-size: 1rem; text-decoration: none; padding: 0; }
.progress { background: #e5e7eb; border-radius: 999px; height: .6rem; overflow: hidden; min-width: 8rem; }
.progress span { display: block; height: 100%; background: var(--ok); }
.tour-list textarea { width: 100%; min-height: 12rem; font-family: monospace; font-size: .85rem; }
.minus { color: var(--danger); }

/* Kvītis un rēķini: moderns A4 dokuments, katrs uz savas lapas */
.doc { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2rem 2.4rem; margin: 0 auto 1.5rem; max-width: 820px; font-size: 10.5pt; color: #1f2933; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: .9rem; margin-bottom: 1.4rem; border-bottom: 3px solid var(--primary); }
.doc-service { font-size: 1.45rem; font-weight: 800; color: var(--primary); letter-spacing: -.01em; }
.doc-seller { font-weight: 600; }
.doc-small { font-size: .85em; color: var(--muted); }
.doc-kind { font-size: 1.9rem; font-weight: 300; text-transform: uppercase; letter-spacing: .12em; color: var(--primary-dark); }
.doc-parties { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: 1.2rem; }
.doc-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .15rem; }
.doc-strong { font-weight: 700; font-size: 1.05rem; }
.doc-facts { display: grid; grid-template-columns: auto auto; gap: .15rem 1rem; margin: 0; font-size: .92em; }
.doc-facts dt { color: var(--muted); }
.doc-facts dd { margin: 0; text-align: right; }
.doc-lines { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.doc-lines th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: none; border-bottom: 2px solid #1f2933; padding: .35rem .4rem; }
.doc-lines td { border-bottom: 1px solid #edf0f3; padding: .3rem .4rem; background: #fff; }
.doc-lines tr.new-day td { border-top: 1px solid #c9d1da; }
.doc-lines .num, .doc-summary .num { text-align: right; white-space: nowrap; }
.doc-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.doc-summary { border-collapse: collapse; font-size: .9em; min-width: 50%; }
.doc-summary th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: none; border-bottom: 1px solid #c9d1da; padding: .25rem .4rem; }
.doc-summary td { padding: .2rem .4rem; border: 0; background: #fff; }
.doc-totalbox { min-width: 15rem; background: #f4f8f5; border-radius: 8px; padding: .8rem 1rem; }
.doc-totalrow { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; font-size: .92em; color: #4b5563; }
.doc-grand { border-top: 2px solid var(--primary); margin-top: .4rem; padding-top: .5rem; font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); }
.doc-foot { margin-top: 1.6rem; }
.doc-sign { margin: 1.4rem 0 .8rem; color: #4b5563; }
.doc-line { display: inline-block; width: 14rem; border-bottom: 1px solid #1f2933; margin: 0 .5rem; }
.doc-legal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; border-top: 1px solid #c9d1da; margin-top: 1rem; padding-top: .5rem; font-size: .78em; color: #6b7280; }
@media print {
  .doc { border: 0; border-radius: 0; padding: 0; margin: 0; max-width: none; break-after: page; }
  .doc:last-child { break-after: auto; }
  .doc-totalbox { background: #f4f8f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 14mm; }
  /* Kvītis: A5 (stāvus), katra savā lapā */
  .doc-a5 { page: a5; font-size: 8.5pt; }
  @page a5 { size: A5; margin: 8mm; }
}
/* Kvītis: A5 – arī ekrānā šaurākas, lai redz, kā izskatīsies */
.doc-a5 { max-width: 560px; padding: 1.2rem 1.4rem; font-size: 9pt; }
.doc-a5 .doc-head { padding-bottom: .5rem; margin-bottom: .8rem; }
.doc-a5 .doc-service { font-size: 1.15rem; }
.doc-a5 .doc-kind { font-size: 1.3rem; letter-spacing: .08em; }
.doc-a5 .doc-parties { gap: 1rem; margin-bottom: .7rem; }
.doc-a5 .doc-lines { margin: .3rem 0 .6rem; }
.doc-a5 .doc-lines td, .doc-a5 .doc-lines th { padding: .18rem .3rem; }
.doc-a5 .doc-bottom { gap: 1rem; }
.doc-a5 .doc-totalbox { min-width: 11rem; padding: .5rem .7rem; }
.doc-a5 .doc-grand { font-size: 1.05rem; }
.doc-a5 .doc-foot { margin-top: .8rem; }
.doc-a5 .doc-sign { margin: .8rem 0 .4rem; }
.doc-a5 .doc-line { width: 9rem; }
.doc-a5 .receipt-stop { font-size: 1.3rem; margin-bottom: .3rem; }

/* Vorbereitung */
.prep-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.prep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.prep-grid .card { margin: 0; }
.prep-facts { list-style: none; padding: 0; margin: .25rem 0 .75rem; font-size: .9rem; }
.prep-facts .warn { color: var(--danger); }
.prep-tour textarea { width: 100%; min-height: 10rem; font-family: monospace; font-size: .8rem; margin-top: .5rem; }

/* Izvēlne ar grupām */
.menu { display: flex; gap: .25rem; flex: 1; align-items: center; flex-wrap: wrap; }
.menu > a, .menu-group > span { padding: .35rem .6rem; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.menu > a:hover, .menu-group:hover > span, .menu-group:focus-within > span { background: rgba(255,255,255,.12); }
.menu-group { position: relative; outline: none; }
.menu-items { display: none; position: absolute; top: 100%; left: 0; z-index: 20; min-width: 14rem; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); padding: .3rem 0; }
.menu-items a { display: block; color: var(--text) !important; padding: .45rem .9rem; }
.menu-items a:hover { background: #e8f3ec; }
.menu-group:hover .menu-items, .menu-group:focus-within .menu-items { display: block; }

/* Porciju tabula: klikšķis +1, krāsas kā Zahner pasūtījuma lapā */
.qty-grid th.dish-head { color: #fff; background: var(--dish); text-transform: none; font-size: .82rem; font-weight: 700; border-right: 2px solid #fff; border-radius: 6px 6px 0 0; white-space: nowrap; }
.qty-grid td.qty-cell { padding: .2rem; cursor: pointer; user-select: none; }
.qty-grid input.qty { width: 100%; min-width: 3rem; height: 2.4rem; margin: 0; padding: 0; text-align: center; font-size: 1.1rem; font-weight: 700; border: 1.5px solid color-mix(in srgb, var(--dish, #94a3b8) 35%, #fff); border-radius: 8px; background: color-mix(in srgb, var(--dish, #94a3b8) 6%, #fff); color: var(--text); cursor: pointer; caret-color: transparent; transition: background .12s, transform .08s; -moz-appearance: textfield; }
.qty-grid input.qty::-webkit-inner-spin-button, .qty-grid input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-grid td.qty-cell:hover input.qty:not(:disabled) { border-color: var(--dish, #94a3b8); background: color-mix(in srgb, var(--dish, #94a3b8) 14%, #fff); }
.qty-grid td.qty-cell:active input.qty:not(:disabled) { transform: scale(.94); }
.qty-grid td.filled input.qty { background: var(--dish, var(--primary)); border-color: var(--dish, var(--primary)); color: #fff; }
.qty-grid td.filled:hover input.qty:not(:disabled) { background: color-mix(in srgb, var(--dish, var(--primary)) 85%, #000); color: #fff; }
.qty-grid input.qty:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.qty-grid input.qty:disabled { cursor: not-allowed; opacity: .45; }
.qty-grid tr.past td.qty-cell { cursor: not-allowed; }
.qty-grid td.na input.qty { background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #e4e7eb 6px 12px); border-color: #e4e7eb; cursor: not-allowed; }
.qty-grid td.na { cursor: not-allowed; }
.qty-grid td.na.conflict input.qty { background: #fdecea; border: 2px solid var(--danger); color: var(--danger); }
.checkbox-row > div, .checkbox-row ul { display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: 0; margin: .3rem 0 0; list-style: none; }
.checkbox-row label { font-weight: 400; display: inline-flex; align-items: center; }

/* Zettel scannen */
.scan-drop { border: 2px dashed var(--border); text-align: center; padding: 2rem 1rem; }
.scan-drop.over { border-color: var(--primary); background: #edf6ef; }
.scan-drop .button input { display: none; }
.scan-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); gap: 1rem; align-items: start; }
.scan-layout.zoomed { grid-template-columns: 1fr; }
.scan-image { margin: 0; position: sticky; top: .5rem; overflow: auto; max-height: calc(100vh - 1rem); }
.scan-layout.zoomed .scan-image { position: static; max-height: none; }
.scan-image img { width: 100%; height: auto; display: block; transition: transform .2s; }
.scan-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.scan-match { display: flex; gap: .5rem; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem; font-weight: 400; cursor: pointer; }
.scan-match input { margin-top: .2rem; }
.scan-match.chosen { border-color: var(--primary); background: #edf6ef; }
.qty-grid td.unsure input.qty { box-shadow: 0 0 0 3px #f5b400; }
.legend.unsure { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; box-shadow: 0 0 0 3px #f5b400; vertical-align: middle; margin-right: .2rem; }
@media (max-width: 900px) { .scan-layout { grid-template-columns: 1fr; } .scan-image { position: static; } }
.button.danger, button.danger { background: var(--danger); color: #fff; }
.button.danger:hover, button.danger:hover { background: #8f1c13; }
.scan-week { margin-bottom: 1.2rem; }
.scan-week .toolbar input { width: auto; display: inline-block; margin: 0; }
.scan-cancel { border-left: 4px solid var(--danger); }
/* Telefons: fotografēšana */
.scan-camera { display: none; text-align: center; }
.scan-camera-button { font-size: 1.2rem; padding: 1rem 1.6rem; border-radius: 12px; }
.scan-camera-button input { display: none; }
.scan-thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: .4rem; }
.scan-send .button { font-size: 1.1rem; padding: .8rem 1.4rem; }
@media (pointer: coarse), (max-width: 700px) {
  .scan-camera { display: block; }
  .scan-drop { padding: 1rem; }
  #scan-table th:nth-child(1), #scan-table td:nth-child(1), #scan-table th:nth-child(5), #scan-table td:nth-child(5) { display: none; }
  .scan-send .button { width: 100%; }
}

/* ---------- Ievades formas: moderns izskats ---------- */
input, select, textarea { border-radius: 8px; padding: .55rem .7rem; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #b8c0cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 125, 79, .15); }
.errorlist + input, label:has(.errorlist) input, label:has(.errorlist) select { border-color: var(--danger); }
button, .button { border-radius: 8px; transition: background .12s; }

.form-page { max-width: 880px; margin: 0 auto; }
.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.form-head h1 { margin: 0 0 .2rem; }
.form-head p { margin: 0; }
.form-section { padding: 1.4rem 1.5rem 1rem; border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.form-section h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; margin-bottom: 1rem; }
.step { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #e8f3ec; color: var(--primary); font-size: .85rem; font-weight: 700; }
.nice-form label { font-weight: 500; color: #374151; font-size: .85rem; margin-bottom: .9rem; }
.nice-form input, .nice-form select, .nice-form textarea { font-size: 1rem; color: var(--text); }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-street { grid-template-columns: 1fr 9rem; }
.field-row.cols-city { grid-template-columns: 8rem 1fr 6rem; }
.field { margin-bottom: .9rem; }
.field-label { display: block; font-size: .85rem; font-weight: 500; color: #374151; margin-bottom: .35rem; }
.help, .nice-form .help { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .25rem; }

/* Pogu izvēle (Anrede) */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: #f3f4f6; gap: 2px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .4rem 1rem; border-radius: 7px; font-weight: 500; color: #4b5563; }
.segmented label:hover span { background: #e5e7eb; }
.segmented input:checked + span { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); }

/* Kartītes (Zahlungsart) */
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice-card { position: relative; display: flex; gap: .6rem; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 10px; padding: .8rem .9rem; margin: 0; cursor: pointer; background: #fff; }
.choice-card:hover { border-color: #a3c2ac; }
.choice-card input { margin: .2rem 0 0; accent-color: var(--primary); }
.choice-card small { display: block; color: var(--muted); font-weight: 400; margin-top: .15rem; }
.choice-card:has(input:checked) { border-color: var(--primary); background: #f1f8f3; box-shadow: 0 0 0 3px rgba(46, 125, 79, .12); }

/* Slēdzis (Jemand anderes zahlt mit) */
.switch-row { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; margin: .2rem 0 .8rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: #d1d5db; position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { transform: translateX(1.1rem); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-row.disabled { opacity: .5; cursor: not-allowed; }
.partner-block { border-left: 3px solid #cde5d4; padding-left: 1rem; margin-bottom: .5rem; }

.address-search { max-width: none; margin-bottom: 1rem; }
.address-search .search-label { margin-bottom: 0; }
.address-search input { font-size: 1.05rem; padding: .7rem .9rem; background: #f8fafc; }
.address-search .suggestions { top: 3.3rem; }
.status-line { margin: -.3rem 0 1rem; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; background: #f3f4f6; color: var(--muted); }
.pill.ok { background: #e7f6ec; color: var(--ok); }

details.more { margin-top: .4rem; }
details.more summary { cursor: pointer; color: var(--primary); font-size: .9rem; margin-bottom: .8rem; }

.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .75rem; padding: .8rem 1rem; margin: 0 -1rem; background: rgba(243, 246, 242, .92); backdrop-filter: blur(4px); border-top: 1px solid var(--border); }
.sticky-actions button { padding: .6rem 1.6rem; font-weight: 600; }

@media (max-width: 640px) {
  .field-row.cols-2, .field-row.cols-street, .field-row.cols-city, .choice-cards { grid-template-columns: 1fr; }
  .form-section { padding: 1rem; }
}

.choice-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.partner-boxes { display: grid; gap: .75rem; }
.partner-box { border: 1px solid #cde5d4; background: #f7fbf8; border-radius: 10px; padding: .9rem 1rem .2rem; }
.partner-box h3 small { font-weight: 400; }
@media (max-width: 640px) { .choice-cards.cols-3 { grid-template-columns: 1fr; } }

/* ---------- Sākumlapa ---------- */
.dash { max-width: 1100px; margin: 0 auto; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.dash-head h1 { margin: 0; font-size: 1.7rem; }
.dash-date { margin: 0 0 .2rem; }
.quick { display: flex; gap: .6rem; flex-wrap: wrap; }
.quick-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.quick-btn span { color: var(--primary); font-size: 1.1rem; }
.quick-btn:hover { border-color: var(--primary); background: #f1f8f3; }

.tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.25rem; border-radius: 14px; background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: transform .1s, box-shadow .1s; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.tile-main { background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%); color: #fff; border: 0; }
.tile-label { font-size: .85rem; opacity: .8; }
.tile-value { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.tile-value small { font-size: .95rem; font-weight: 500; opacity: .8; }
.tile-days { display: flex; flex-wrap: wrap; gap: .35rem; font-size: 1rem; }
.tile-sub { font-size: .9rem; opacity: .85; }
.tile-link { margin-top: auto; padding-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--primary); }
.tile-main .tile-link { color: #fff; }
.pill.warn { background: #fff4e5; color: #b54708; }

.dash-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; }
.dash-card { border-radius: 14px; }
.dash-sub { margin-top: 1.2rem; font-size: .95rem; }
.todo { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid #eef0f3; }
.todo:last-child { border-bottom: 0; }
.todo-dot { flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: #9ca3af; }
.todo-urgent .todo-dot { background: var(--danger); }
.todo-warn .todo-dot { background: #f59e0b; }
.todo-info .todo-dot { background: var(--primary); }
.todo-text { flex: 1; }
.small-btn { padding: .3rem .8rem; font-size: .85rem; white-space: nowrap; }
.all-done { color: var(--ok); font-weight: 600; margin: .5rem 0; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 190px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; text-decoration: none; color: var(--text); }
.bar-n { font-size: .85rem; font-weight: 700; }
.bar-col { flex: 1; width: 100%; max-width: 2.6rem; display: flex; align-items: flex-end; background: #f3f4f6; border-radius: 8px; overflow: hidden; }
.bar-col span { display: block; width: 100%; min-height: 3px; background: #a8d5b5; border-radius: 8px; }
.bar.today .bar-col span { background: var(--primary); }
.bar:hover .bar-col span { background: #43a047; }
.bar-day { font-size: .8rem; text-align: center; line-height: 1.15; }
.bar.today .bar-day { font-weight: 700; color: var(--primary); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .25rem 0; }

@media (max-width: 860px) {
  .tiles, .dash-cols { grid-template-columns: 1fr; }
}
.partner-box .pays { margin: 0 0 .8rem; }
.partner-box #group-section label { margin-bottom: .8rem; }
#akz-section { margin-top: .2rem; }
.payer-search { position: relative; }
.payer-search .suggestions { top: calc(100% + 2px); max-height: 18rem; overflow-y: auto; }
.payer-search li.new-hit { color: var(--primary); font-weight: 600; border-top: 1px solid #eef0f3; }

/* ---------- Klienta sadaļa (galvene + cilnes) ---------- */
.hub-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.hub-title { display: flex; gap: .9rem; align-items: center; }
.hub-title h1 { margin: 0; font-size: 1.45rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hub-title p { margin: .2rem 0 0; }
.hub-number { font-size: .85rem; font-weight: 600; color: var(--muted); background: #eef1f5; padding: .1rem .5rem; border-radius: 999px; }
.hub-avatar { flex: none; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #43a047); color: #fff; font-size: 1.3rem; font-weight: 700; text-transform: uppercase; }
.hub-tabs { display: flex; gap: .2rem; box-shadow: inset 0 -2px 0 var(--border); margin-bottom: 1.2rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.hub-tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; border-radius: 6px 6px 0 0; }
.hub-tabs a:hover { color: var(--text); background: #eef1f5; }
.hub-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.home-search { border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.home-search label { font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: .4rem; }
.home-search input { font-size: 1.2rem; padding: .85rem 1rem; border-radius: 10px; background: #f8fafc; }
.home-search .customer-suggestions { min-width: 100%; font-size: 1rem; }
.home-search .customer-suggestions li { padding: .65rem .9rem; }
.home-search .search-wrap { display: block; }

/* Ikonas (Lucide) */
.icon { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; stroke-width: 2; }
.topbar .menu > a, .topbar .menu-group > span { display: inline-flex; align-items: center; gap: .4rem; }
.topbar .icon { opacity: .85; }
.home-search-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.home-search-head label { margin: 0; display: inline-flex; align-items: center; gap: .35rem; }
.home-search-head a { font-size: .85rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.tile-label { display: inline-flex; align-items: center; gap: .4rem; }
.all-done { display: flex; align-items: center; gap: .4rem; }
.who { display: inline-flex; align-items: center; gap: .45rem; }
.who-avatar { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); font-weight: 700; font-size: .85rem; text-transform: uppercase; }
/* Kompaktāka augšējā josla, lai izvēlne ietilpst vienā rindā */
.topbar { gap: .9rem; padding: .55rem 1rem; font-size: .92rem; }
.topbar .menu > a, .topbar .menu-group > span { padding: .4rem .5rem; gap: .35rem; }
.topbar .menu { gap: .1rem; }
.topbar-search { width: 10.5rem; }
.user-menu > span { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.user-menu:hover > span, .user-menu:focus-within > span { background: rgba(255,255,255,.12); }
.user-menu .menu-items { left: auto; right: 0; }
.menu-logout { display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left; background: none; color: var(--danger); padding: .5rem .8rem; border-radius: 0; font: inherit; }
.menu-logout:hover { background: #fdecea; }

/* Pieteikšanās lapa: mierīgs, nopietns zaļš fons bez zīmējumiem */
body.login-page { background: radial-gradient(1200px 600px at 15% 10%, rgba(255,255,255,.08), transparent 60%), linear-gradient(160deg, #173f26 0%, #1f5130 50%, #2e7d4f 100%); background-attachment: fixed; min-height: 100vh; }
body.login-page .card.narrow { box-shadow: 0 24px 60px rgba(0, 0, 0, .28); border: 0; border-radius: 14px; margin-top: 12vh; padding: 2rem 2rem 1.5rem; }

/* Wochenkontrolle */
.check-progress { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.check-progress .progress { flex: 1; max-width: 420px; height: .7rem; }
.week-check td { vertical-align: middle; }
.week-check .check-box { width: 1.3rem; height: 1.3rem; accent-color: var(--primary); cursor: pointer; }
.week-check tr.checked td { background: #eef7f0; }
.week-check .wc-cell { font-size: .82rem; white-space: nowrap; font-weight: 600; }
.week-check .wc-cell.auto { color: var(--muted); font-weight: 500; }
.week-check .wc-cell.cancelled { color: var(--danger); }
.week-check .check-by { display: block; color: var(--ok); }
.toolbar input[type=number], .toolbar input[type=checkbox], .toolbar input[type=radio] { min-width: 0; }
.toolbar label.inline { align-self: center; }

/* Rēķini: storno un darbības */
.inline-form { display: inline; margin: 0 0 0 .5rem; }
.actions-cell { white-space: nowrap; }
tr.inv-inactive td { color: var(--muted); }
tr.inv-inactive td:first-child { text-decoration: line-through; }

/* Sicherung fürs Büro */
.backup-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.backup-card h2 { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.backup-card p { margin: 0; max-width: 560px; }
.backup-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.backup-actions .button { display: inline-flex; align-items: center; gap: .4rem; }
.ok-text { color: var(--ok); }

/* Morgen vorbereiten (Schritt für Schritt) */
.wizard { max-width: 980px; margin: 0 auto; }
.stepper { list-style: none; display: flex; gap: 0; padding: 0; margin: 0 0 1rem; counter-reset: s; overflow-x: auto; }
.stepper li { flex: 1; position: relative; min-width: 6.5rem; }
.stepper li::before { content: ""; position: absolute; top: 1.05rem; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--primary); }
.stepper a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: var(--muted); font-size: .8rem; text-align: center; }
.step-dot { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--border); font-weight: 700; color: var(--muted); }
.stepper li.done .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper li.current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(46, 125, 79, .15); }
.stepper li.current .step-title { color: var(--text); font-weight: 700; }
.wizard-card { border-radius: 14px; padding: 1.6rem 1.8rem; }
.wizard-count { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); font-weight: 700; }
.wizard-card h2 { font-size: 1.35rem; margin: .2rem 0 .3rem; }
.wizard-nav { display: flex; align-items: center; gap: 1rem; margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.wizard-next { padding: .7rem 1.6rem; font-size: 1.05rem; font-weight: 700; }
.link-skip { color: var(--muted); font-size: .9rem; }
.wizard-links { margin-top: .8rem; font-size: .9rem; }
.wizard-finish { text-align: center; padding: 1rem 0; }
.finish-icon { width: 4rem; height: 4rem; margin: 0 auto .6rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 2rem; }
.finish-list { display: inline-block; text-align: left; margin: .6rem 0 1rem; }
.finish-list li { padding: .3rem 0; }
.wizard-nav .spacer { flex: 1; }

/* Pauze (slimnīca) */
.pause-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff4e5; border: 1px solid #f5c48a; color: #7a3e00; border-radius: 10px; padding: .8rem 1rem; margin-bottom: .8rem; }
.pause-resume { display: flex; align-items: end; gap: .6rem; margin: 0; }
.pause-resume label { margin: 0; font-size: .85rem; color: #7a3e00; }
.pause-resume input { width: auto; }
.pause-card summary { cursor: pointer; }

/* Kasse */
.cash-summary { display: flex; gap: 2rem; padding: 1rem 1.25rem; }
.cash-summary div { display: flex; flex-direction: column; }
.cash-summary strong { font-size: 1.4rem; }
.cash-table td { vertical-align: middle; }
.cash-table tr.cash-ok td { background: #eef7f0; }
.cash-table tr.cash-no td { background: #fff4e5; }
.cash-actions form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.cash-actions select { width: auto; margin: 0; padding: .3rem .4rem; font-size: .85rem; }
.doc-reprint { margin: -.6rem 0 1rem; padding: .4rem .7rem; border: 1.5px solid #b54708; color: #b54708; border-radius: 6px; font-weight: 600; }
/* Bestellung eingeben: meklēšana lapas vidū */
.pick-page { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.pick-page h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.pick-page .home-search { text-align: left; }
.pick-page section.card { text-align: left; }
.pick-links { margin-top: 1rem; display: flex; justify-content: center; gap: .8rem; }
.pick-links a { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 600; }
.entry-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.entry-head h1 { margin: 0; }
.entry-head p { margin: .2rem 0 0; }
.entry-head .spacer { flex: 1; }
.group-row th { background: #e8f3ec; color: var(--primary); text-align: left; font-size: .9rem; padding: .35rem .6rem; }
.week-check .wc-cell.diff { background: #fff4e5; outline: 2px solid #f59e0b; outline-offset: -2px; }
.week-check .wc-zettel-value { display: block; font-size: .72rem; font-weight: 600; color: #b54708; }
.week-check .wc-zettel { display: inline-block; margin-left: .3rem; font-weight: 600; }
.receipt-stop { display: block; width: max-content; margin: 0 0 .5rem auto; font-size: 1.6rem; font-weight: 700; border: 2px solid currentColor; border-radius: 8px; padding: .1rem .6rem; }
.receipt-tour { margin: 1.5rem 0 .5rem; }
.tour-split td { font-size: .82rem; color: var(--muted); padding-top: .1rem; padding-bottom: .1rem; }
.tiles-small { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tiles-small .tile-value { font-size: 1.5rem; }
.tour-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.tour-tabs a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); text-decoration: none; font-weight: 600; }
.tour-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tour-tabs a .pill { margin-left: .3rem; }
.menu-items a.menu-sep { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .6rem; }
.wizard-open { margin-top: 1rem; border-left: 4px solid #f59e0b; }
.wizard-open h3 { margin: 0 0 .4rem; }
.wizard-open li { padding: .2rem 0; }
/* Naudas aprēķins soli pa solim */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: .5rem 0; }
.calc { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; background: #fbfcfb; }
.calc h3 { margin: 0 0 .5rem; font-size: .95rem; color: var(--muted); }
.calc-row { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed #e3e7eb; font-variant-numeric: tabular-nums; }
.calc-row:last-child { border-bottom: 0; }
.calc-row small { color: var(--muted); font-weight: 400; }
.calc-row span:last-child { white-space: nowrap; font-weight: 600; }
.calc-sum { border-top: 2px solid #1f2933; border-bottom: 0; margin-top: .2rem; font-size: 1.1rem; font-weight: 700; }
.calc-row.ok span:last-child { color: var(--ok); }
.calc-row.bad span:last-child { color: var(--danger); }
.calc-row.warn span:last-child { color: #b54708; }
.money-table td.num, .money-table th.num { font-variant-numeric: tabular-nums; }
.money-table th.group { text-align: center; border-bottom: 1px solid var(--border); }
.money-table td small { font-weight: 400; }
.period-table tr.row-bad td { background: #fdf2f2; }
.period-table .center { text-align: center; }
.period-table .nk-box { width: 1.2rem; height: 1.2rem; accent-color: var(--danger); }
.quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: 0 0 .8rem; padding: .55rem .9rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.quick-links a { font-weight: 600; text-decoration: none; }
.quick-links a:hover { text-decoration: underline; }
/* Wochenliste je Tour (kā biroja Excel) */
.week-list { font-size: .78rem; border-collapse: collapse; }
.week-list th, .week-list td { padding: .15rem .3rem; border: 1px solid #e3e7eb; }
.week-list .wl-day { text-align: center; background: #e8f3ec; }
.week-list .wl-code { text-align: center; font-weight: 600; }
.week-list .wl-first { border-left: 2px solid #6b7280; }
.week-list .wl-area td { background: #f3f4f6; font-weight: 700; }
.week-list .wl-name { white-space: nowrap; }
.week-list .wl-street { white-space: nowrap; color: #4b5563; }
.week-list .wl-cell { text-align: center; font-weight: 700; min-width: 1.3rem; }
.week-list tr.wl-empty td.wl-name a { color: var(--danger); }
.week-list tfoot td { background: #e8f3ec; text-align: center; }
@media print {
  body.print-landscape { font-size: 9pt; }
  .week-list { font-size: 7pt; width: 100%; }
  .week-list a { color: inherit; text-decoration: none; }
}
.zahner-table tr.zahner-main td { border-bottom: 0; padding-top: .7rem; }
.zahner-table tr.zahner-sub td { background: #fafbfa; padding: .35rem .6rem .6rem; }
.zahner-doc-form { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-bottom: .2rem; }
.zahner-doc-form label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; }
.money-table tr.row-open td { background: #fffaf0; }
.money-table .center { text-align: center; }
.konto-result { font-size: 1.15rem; padding: .7rem 1rem; border-radius: 10px; margin: .5rem 0; }
.konto-result.warn { background: #fff4e5; color: #b54708; }
.konto-result.ok { background: #e7f6ec; color: var(--ok); }
.konto-table tr.konto-payment td { background: #eef7f0; font-weight: 600; }
.konto-table tr.konto-settled td { color: var(--muted); }
.zahner-files { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .25rem; }
.t-konto { border-collapse: collapse; margin: .4rem 0 1rem; min-width: 60%; }
.t-konto th { background: #5b9bd5; color: #fff; text-align: left; padding: .3rem .6rem; }
.t-konto td { padding: .25rem .6rem; border-bottom: 1px solid #dbe5f1; font-variant-numeric: tabular-nums; }
.t-konto tbody tr:nth-child(odd) td { background: #eaf1fb; }
.t-konto td:nth-child(2) { border-right: 2px solid #1f2933; }
.t-konto .t-mark { background: #ffff00 !important; font-weight: 600; }
.t-konto tfoot td { border-top: 2px solid #1f2933; }
/* Konto mit Zahner – rezultāts un divas kolonnas */
.konto-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.2rem 1.5rem; border-radius: 14px; margin: .6rem 0 1.2rem; }
.konto-hero.warn { background: linear-gradient(135deg, #fff7e6, #ffe8c2); border: 1px solid #f5c26b; }
.konto-hero.ok { background: linear-gradient(135deg, #ecf8f0, #d6f0df); border: 1px solid #9fd5b1; }
.konto-hero.zero { background: #f4f6f8; border: 1px solid var(--border); }
.konto-hero-label { font-size: .95rem; font-weight: 600; color: #4b5563; }
.konto-hero-amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.konto-hero.warn .konto-hero-amount { color: #b54708; }
.konto-hero.ok .konto-hero-amount { color: var(--ok); }
.konto-hero-sub { font-size: .9rem; color: #4b5563; }
.konto-pay { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.konto-pay label { display: flex; flex-direction: column; font-size: .8rem; color: #4b5563; margin: 0; }
.konto-pay input { width: 9rem; }
.konto-pay button { font-size: 1rem; padding: .6rem 1.2rem; }
.t-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.t-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.t-card-head { background: #1f4e79; color: #fff; padding: .7rem 1rem; font-size: 1.1rem; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.t-card-head.right { background: var(--primary); }
.t-card-head span { font-size: .78rem; font-weight: 500; opacity: .85; }
.t-line { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid #eef1f4; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.t-line span:last-child { font-weight: 600; white-space: nowrap; }
.t-highlight { background: #fff6c7; }
.t-highlight span { font-weight: 800 !important; color: #b42318; }
.t-sum { background: #f8fafc; font-weight: 800; border-top: 2px solid #1f2933; border-bottom: 0; font-size: 1.15rem; }
.t-check { color: var(--ok); font-weight: 600; margin: .6rem 0 1rem; }
.t-open { margin: .6rem 0 1rem; font-size: 1.05rem; }
/* Zahner lapa */
.z-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.z-head h1 { margin: 0; }
.z-head p { margin: .2rem 0 0; }
.z-month { display: flex; gap: .4rem; align-items: center; }
.z-month form { margin: 0; }
.z-status { margin-bottom: 1.5rem; }
.z-step { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.3rem; margin-bottom: 1.2rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.z-step-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .8rem; }
.z-step-head h2 { margin: 0; font-size: 1.15rem; }
.z-step-head p { margin: .15rem 0 0; }
.z-num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.z-num svg { width: 1rem; height: 1rem; }
.z-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .8rem; margin-bottom: .8rem; }
.z-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: #4b5563; margin: 0; }
.z-form label.button { flex-direction: row; align-items: center; color: #fff; font-size: .95rem; }
.z-form input[type=text], .z-form select { min-width: 8rem; }
.z-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.2rem; }
.z-grid .z-step { margin-bottom: 1.2rem; }
.z-compare { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.z-compare-head { display: flex; justify-content: space-between; align-items: center; padding: .4rem 1rem; background: #f8fafc; margin: 0; font-weight: 600; font-size: .85rem; }
.z-files summary { cursor: pointer; font-weight: 600; margin-bottom: .3rem; }
.z-archive { background: #fafbfa; }
.z-finished { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .8rem 1rem; border-radius: 10px; background: #e7f6ec; color: var(--ok); margin-bottom: 1rem; }
.z-archive-row { display: grid; grid-template-columns: 7rem 8rem 1fr auto; gap: 1rem; align-items: start; padding: .7rem 0; border-top: 1px solid #e5e7eb; }
.z-archive-amount { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.z-archive-actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
@media (max-width: 800px) { .z-archive-row { grid-template-columns: 1fr; } }

/* Rechnung für Fensterkuvert (DIN 5008 Form B, DIN lang gefaltet): Seite oben 10 mm, links 20 mm;
   Kopf 35 mm -> Fenster beginnt 45 mm von oben; Absenderzeile 17,7 mm, Anschrift 27,3 mm */
.doc-letter-top { height: 35mm; }
.doc-letter-top .doc-head { margin-bottom: 0; }
.doc-letter-row { display: flex; justify-content: space-between; gap: 8mm; min-height: 45mm; margin-bottom: 6mm; }
.doc-window { width: 85mm; flex: none; }
.doc-sender { height: 17.7mm; display: flex; align-items: flex-end; padding-bottom: 1.5mm; box-sizing: border-box;
  font-size: 7pt; color: #4b5563; text-decoration: underline; white-space: nowrap; overflow: hidden; }
.doc-recipient { height: 27.3mm; overflow: hidden; font-size: 10.5pt; line-height: 1.3; }
.doc-recipient .doc-strong { font-size: 10.5pt; }
.doc-letter-side { display: flex; flex-direction: column; gap: 3mm; padding-top: 2mm; min-width: 60mm; }
.doc-for { font-size: .92em; margin-bottom: 1mm; }
@media print {
  .doc-letter { page: letter; }
  @page letter { size: A4; margin: 10mm 15mm 12mm 20mm; }
}
.doc-grand span, .doc-totalrow span { white-space: nowrap; }
.doc-totalbox { min-width: 17rem; }

/* Rechnung: eine Zeile je Tag; bei vielen Tagen kompakter, damit alles auf eine A4-Seite passt */
.doc-days .doc-day { width: 24mm; white-space: nowrap; font-weight: 600; }
.doc-days td { padding: .22rem .4rem; }
.doc-days.dense { font-size: 8.5pt; }
.doc-days.dense td { padding: 0 .4rem; height: 3.9mm; line-height: 3.9mm; }
.doc-days.dense th { padding: .15rem .4rem; }
.doc-letter { max-width: calc(175mm + 4.8rem); }
.doc-letter .doc-letter-row { margin-bottom: 2mm; }
.doc-letter > p { margin: .3rem 0; }
.doc-letter .doc-summary td { padding: .05rem .4rem; }
.doc-letter .doc-foot { margin-top: .6rem; }
.doc-days.dense { font-size: 8pt; }
.doc-days.dense td { height: 3.2mm; line-height: 3.2mm; border-bottom-color: #f0f2f4; }
.doc-letter .doc-summary { font-size: .85em; }
.doc-letter .doc-summary td { padding: 0 .4rem; line-height: 1.35; }
.doc-letter .doc-letter-side { gap: 1.5mm; padding-top: 0; font-size: .9em; }
.doc-letter .doc-facts { gap: 0 1rem; }
.doc-letter .doc-foot p { margin: 0 0 .3rem; }
.doc-letter .doc-legal { margin-top: .3rem; padding-top: .3rem; }
.doc-days.dense td { height: 3mm; line-height: 3mm; }
.doc-letter > p { margin: 0 0 .2rem; line-height: 1.35; }
@media print { @page letter { size: A4; margin: 10mm 15mm 8mm 20mm; } }
.doc-days.medium { font-size: 8.5pt; }
.doc-days.medium td { padding: 0 .4rem; height: 3.9mm; line-height: 3.9mm; }
.doc-letter .doc-totalbox { flex: none; min-width: 0; width: 72mm; box-sizing: border-box; }
.doc-letter .doc-grand { font-size: 1.1rem; }

/* Rechnung, feste Struktur: jeder Tag eine Zeile mit fester Höhe, Wochen als Bänder, Wochensumme rechts;
   Zusammenfassung mit fester Höhe (bis 9 Gerichte) -> Summe und Fußzeile stehen immer an derselben Stelle */
.doc-days { width: 100%; border-collapse: collapse; font-size: 8.5pt; margin: .2rem 0 .5rem; table-layout: fixed; }
.doc-days th { text-align: left; font-size: 7pt; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; background: none;
  border-bottom: 2px solid var(--primary); padding: 1px 4px; }
.doc-days th:nth-child(1) { width: 8mm; } .doc-days th:nth-child(2) { width: 13mm; }
.doc-days th.num { width: 20mm; text-align: right; }
.doc-days td { height: 3.65mm; line-height: 3.65mm; padding: 0 4px; border: 0; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1f2933; }
.doc-days td.num { text-align: right; }
.doc-days tr.band td { background: #f4f7f5; }
.doc-days td.wd, .doc-days td.dt { color: #9aa5b1; }
.doc-days tr.has td.wd, .doc-days tr.has td.dt { color: #1f2933; font-weight: 600; }
.doc-days tr.weekend td.wd, .doc-days tr.weekend td.dt { font-style: italic; }
.doc-days td.wk { font-weight: 700; color: var(--primary-dark); }
.doc-days tr.week-end td { border-bottom: 1px solid #cfd8d3; }
.doc-days-bottom { align-items: flex-start; }
.doc-days-bottom .doc-summary { font-size: .82em; }
.doc-days-bottom .doc-summary td { padding: 0 .4rem; height: 3.6mm; line-height: 3.6mm; }
.doc-days-bottom { height: 42mm; overflow: hidden; }
.doc-letter .doc-totalbox { flex: none; min-width: 0; width: 72mm; box-sizing: border-box; }
@media print {
  .doc-days tr.band td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.doc-days td { height: 3.5mm; line-height: 3.5mm; }
.doc-days th:nth-child(n) { width: auto; }

/* Essenslieferung für: eine Zeile direkt unter dem Fenster (ab 90 mm, im Kuvert verdeckt) */
.doc-for-line { margin: 0 0 2mm; font-size: 9pt; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-for-line .doc-label { display: inline; margin-right: 2mm; }
.doc-letter .doc-letter-row { margin-bottom: 1mm; }
/* Beträge zurückhaltender */
.doc-days td:nth-child(4) { color: #6b7280; }
.doc-days td.wk { color: #374151; font-weight: 600; }
.doc-letter .doc-totalbox { background: none !important; border: 1px solid #d5dbe1; padding: .3rem .8rem; }
.doc-letter .doc-grand { font-size: .95rem; font-weight: 700; color: #1f2933; border-top: 1px solid #c9d1da; }
.doc-days td { height: 3.4mm; line-height: 3.4mm; }
.doc-for-line { margin-top: 3mm; }
.doc-days td { height: 3.3mm; line-height: 3.3mm; }

/* Rechnung, Mitte neu: Gerichte als kleine Etiketten, Woche als eigener Block (KW + Summe) */
.doc-days td.dishes { padding-top: 0; padding-bottom: 0; }
.doc-days .chip { display: inline-block; margin-right: 1.2mm; padding: 0 1.4mm; height: 2.8mm; line-height: 2.8mm; border-radius: 1.4mm;
  background: #e8f3ec; color: #1f5135; font-size: 7pt; vertical-align: middle; }
.doc-days .chip b { font-weight: 700; }
.doc-days td.wk { vertical-align: middle; text-align: right; background: #fff !important; border-left: 2px solid var(--primary);
  border-bottom: 1px solid #cfd8d3; padding: 0 2mm; }
.doc-days td.wk .kw { display: block; font-size: 6.5pt; letter-spacing: .06em; color: #9aa5b1; font-weight: 400; line-height: 1.2; }
.doc-days td.wk .ws { display: block; font-size: 9pt; font-weight: 600; color: #1f2933; line-height: 1.3; }
.doc-days td.wk .ws.none { color: #c4ccd4; }
@media print {
  .doc-days .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* KW vor jeder Woche (links, über alle Tage der Woche) */
.doc-days td.kwcell { vertical-align: middle; text-align: center; background: #fff !important; border-right: 2px solid var(--primary);
  border-bottom: 1px solid #cfd8d3; font-size: 10pt; font-weight: 700; color: var(--primary-dark); padding: 0; }

/* Essenslieferung für rechts neben dem Fenster, gleich wie die Anschrift; Rechnungsdaten als Zeile darunter */
.doc-letter-row { justify-content: flex-start; gap: 0; }
.doc-for-window { margin-left: 20mm; width: 70mm; }
.doc-for-window .doc-sender { text-decoration: none; text-transform: uppercase; letter-spacing: .06em; }
.doc-facts-line { display: flex; flex-wrap: wrap; gap: 0 6mm; margin: 3mm 0 2mm; padding: 1.2mm 0; border-top: 1px solid #d5dbe1;
  border-bottom: 1px solid #d5dbe1; font-size: 8.5pt; color: #1f2933; }
.doc-facts-line i { font-style: normal; color: #6b7280; margin-right: 1mm; }
.doc-facts-line { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; gap: 0 4.5mm; font-size: 8pt; margin: 2mm 0 1.5mm; }

/* Jedes Gericht in seiner eigenen Spalte: Etiketten stehen sauber untereinander */
.doc-days th.dishcol { text-transform: none; letter-spacing: 0; font-size: 7pt; color: #4b5563; text-align: center; padding: 1px 0; }
.doc-days td.slot { text-align: center; padding: 0 .6mm; }
.doc-days td.slot .chip { margin: 0; display: block; text-align: center; }

/* Rechte Spalte näher an der Anschrift (ab 117 mm, Fenster endet bei 105 mm): Rechnungsdaten + Essenslieferung für */
.doc-for-window { margin-left: 12mm; width: 78mm; height: 45mm; display: flex; flex-direction: column; justify-content: space-between; }
.doc-facts-right { font-size: 8pt; line-height: 1.3; gap: 0 4mm; margin-top: 1mm; grid-template-columns: auto 1fr; }
.doc-facts-right dd { text-align: left; }
.doc-for-block { font-size: 10.5pt; line-height: 1.3; }
.doc-for-label { font-size: 7pt; color: #4b5563; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5mm; }
.doc-letter .doc-letter-row { margin-bottom: 4mm; }
/* Rechnungsdaten kompakt in zwei Paaren je Zeile; Essenslieferung-Name auf Höhe des Empfängernamens */
.doc-for-window { justify-content: flex-start; }
.doc-facts-right { grid-template-columns: auto auto auto auto; height: 14.2mm; align-content: start; margin-top: 0; }
.doc-for-block { margin-top: 0; }

/* Rechnungsdaten untereinander; rechte Spalte beginnt etwas höher (unter dem Kopf), Name bleibt auf Höhe des Empfängers */
.doc-for-window { margin-top: -6mm; height: 51mm; }
.doc-facts-right { grid-template-columns: auto 1fr; height: 20mm; font-size: 8pt; line-height: 1.25; }

/* Linie zwischen den Tagen; Menge (2×) links in der Etikette, der Name bleibt genau untereinander */
.doc-days tbody td.wd, .doc-days tbody td.dt, .doc-days tbody td.slot, .doc-days tbody td:last-child { border-bottom: 1px solid #e3e8e5; }
.doc-days tr.week-end td { border-bottom: 1px solid #b9c6bf; }
.doc-days td.slot .chip { position: relative; }
.doc-days td.slot .chip b.qty { position: absolute; left: .8mm; top: 0; font-weight: 700; color: #0f3d24; }

/* Rechnungsdaten ganz rechts oben; Essenslieferung für näher an der Anschrift (ab 112 mm, Fenster bis 105/110 mm) */
.doc-letter-row { position: relative; }
.doc-facts-abs { position: absolute; right: 0; top: -6mm; height: auto; }
.doc-for-window { margin-left: 7mm; margin-top: 0; height: 45mm; width: 83mm; padding-top: 14.1mm; box-sizing: border-box; }

/* Etiketten gleich breit und ohne Lücken nebeneinander; etwas Farbe je Art (Menü / Salat / Dessert) */
.doc-days td.dishes { border-bottom: 1px solid #e3e8e5; padding: 0 1mm; }
.doc-days td.dishes .chip { position: relative; display: inline-block; width: 18mm; margin: 0 1mm 0 0; padding: 0; text-align: center; }
.doc-days .chip b.qty { position: absolute; left: .8mm; top: 0; font-weight: 700; }
.doc-days .chip.menu { background: #dcefe3; color: #14532d; }
.doc-days .chip.salat { background: #eef5d6; color: #4d5b12; }
.doc-days .chip.dessert { background: #fbe7ec; color: #8a2846; }
.doc-days td.kwcell { color: #ffffff; background: var(--primary) !important; border-bottom-color: #fff; }
.doc-days td.kwcell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Essenslieferung für: noch etwas näher, gleiche Schrift wie die Anschrift */
.doc-for-window { margin-left: 3mm; }
.doc-for-block, .doc-for-block .doc-strong { font-size: 10.5pt; line-height: 1.3; }

/* Rechnung druckfreundlich: Text und Linien schwarz, Etiketten in ruhigen Beigetönen (Menü in der Mitte) */
.doc-letter, .doc-letter .doc-recipient, .doc-letter .doc-for-block, .doc-letter .doc-facts dd, .doc-letter .doc-facts dt,
.doc-letter .doc-summary td, .doc-letter .doc-totalrow, .doc-letter .doc-grand, .doc-letter p { color: #000; }
.doc-letter .doc-sender, .doc-letter .doc-for-label, .doc-letter .doc-label { color: #000; }
.doc-days th, .doc-letter .doc-summary th { color: #000; border-bottom: 1.5px solid #000; }
.doc-days td, .doc-days td.wd, .doc-days td.dt { color: #000; }
.doc-days tr:not(.has) td.wd, .doc-days tr:not(.has) td.dt { color: #555; font-weight: 400; }
.doc-days tbody td.wd, .doc-days tbody td.dt, .doc-days tbody td.dishes { border-bottom: 1px solid #bbb; }
.doc-days tr.week-end td { border-bottom: 1px solid #000; }
.doc-days tr.band td { background: #f3f3f1; }
.doc-days td.kwcell { background: #fff !important; color: #000; border-right: 1.5px solid #000; border-bottom: 1px solid #000; }
.doc-days .chip.menu { background: #e6e1d3; color: #000; }
.doc-days .chip.salat { background: #f1ede2; color: #000; }
.doc-days .chip.dessert { background: #dcd5c3; color: #000; }
.doc-days .chip b.qty { color: #000; }
.doc-letter .doc-totalbox { border-color: #000; }
.doc-letter .doc-grand { border-top-color: #000; }
.doc-letter .doc-legal { color: #000; border-top-color: #000; }
/* Essenslieferung für noch etwas weiter links (ab 105 mm = Fensterkante nach DIN 5008) */
.doc-for-window { margin-left: 0; }
/* Druck: Seitenrand 0 -> der Browser druckt keine Kopf-/Fußzeile (Datum, Titel, Adresse);
   den Rand übernimmt die Rechnung selbst (oben 10, rechts 15, unten 8, links 20 mm) */
@media print {
  @page letter { size: A4; margin: 0; }
  .doc-letter { padding: 10mm 15mm 8mm 20mm !important; box-sizing: border-box; width: 210mm; max-width: none; }
}
/* Mit vollständigen Firmendaten: Fußzeile und Zusammenfassung kompakter, damit es bei einer Seite bleibt */
.doc-days-bottom { height: 35mm; }
.doc-letter .doc-foot { margin-top: 1mm; font-size: 8.5pt; line-height: 1.3; }
.doc-letter .doc-foot p { margin: 0 0 1mm; }
.doc-letter .doc-legal { font-size: 6.8pt; line-height: 1.25; margin-top: 1mm; padding-top: 1mm; gap: 3mm; }
.doc-letter .doc-head .doc-small { font-size: 7.5pt; }
.doc-days-bottom { height: 39.5mm; }

/* Quittung (A5) im Stil der Rechnung: schwarz, Tage mit Etiketten, Zusammenfassung + Betrag */
.doc-receipt, .doc-receipt p, .doc-receipt .doc-facts dt, .doc-receipt .doc-facts dd, .doc-receipt .doc-summary td,
.doc-receipt .doc-totalrow, .doc-receipt .doc-grand, .doc-receipt .doc-for-label, .doc-receipt .doc-small { color: #000; }
.receipt-parties { display: flex; justify-content: space-between; align-items: flex-start; gap: 6mm; margin: 2mm 0 3mm; }
.receipt-customer { font-size: 10pt; line-height: 1.3; }
.receipt-customer .doc-strong { font-size: 10.5pt; }
.doc-receipt .doc-facts-right { height: auto; }
.doc-receipt .doc-days td { height: 4.6mm; line-height: 4.6mm; }
.doc-receipt .doc-days td.dishes .chip { width: 17mm; }
.doc-receipt .doc-days-bottom { height: auto; margin-top: 2mm; }
.doc-receipt .doc-days-bottom .doc-summary td { height: 3.6mm; line-height: 3.6mm; }
.doc-receipt .doc-totalbox { flex: none; width: 52mm; min-width: 0; border: 1px solid #000; background: none !important; padding: .25rem .6rem; }
.doc-receipt .doc-grand { font-size: .95rem; font-weight: 700; border-top: 1px solid #000; }
.doc-receipt .doc-sign { color: #000; margin: 6mm 0 2mm; }
.doc-receipt .doc-line { border-bottom-color: #000; }
.doc-receipt .doc-head { border-bottom-color: var(--primary); }
.receipt-stop { color: #000; border-color: #000; }
.doc-receipt .doc-days-bottom { gap: 4mm; }
.doc-receipt .doc-days-bottom .doc-summary { flex: 1; min-width: 0; }
.doc-receipt .doc-summary th { color: #000; border-bottom: 1.5px solid #000; font-size: 7pt; }
.doc-receipt .doc-totalbox { width: 48mm; }
.doc-receipt .doc-totalbox { box-sizing: border-box; } .doc-receipt .doc-days-bottom { overflow: visible; }
/* A5-Druck ohne Browser-Kopf-/Fußzeile: Seitenrand 0, Rand (8 mm) in der Quittung */
@media print {
  @page a5 { size: A5; margin: 0; }
  .doc-a5 { padding: 8mm !important; box-sizing: border-box; width: 148mm; max-width: none; }
}

/* Zahlungsbox auf der Rechnung: Bankdaten groß und fett */
.doc-paybox { border: 1.5px solid #000; border-radius: 2mm; padding: 1.5mm 3mm; margin: 0 0 1.5mm; color: #000; }
.doc-paybox-head { font-size: 9pt; margin-bottom: .8mm; }
.doc-paybox-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: .3mm 3mm; align-items: baseline; }
.doc-paybox-grid span { font-size: 8.5pt; }
.doc-paybox-grid b { font-size: 11.5pt; font-weight: 800; letter-spacing: .02em; }
.doc-letter .doc-days td { height: 3.05mm; line-height: 3.05mm; }
.doc-letter .doc-days td.dishes .chip { height: 2.65mm; line-height: 2.65mm; }

/* Firmendaten unten in einer Zeile; Etiketten dürfen die Zeilenhöhe nicht vergrößern */
.doc-letter .doc-legal-line { display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-letter .doc-days td.dishes { line-height: 0; }
.doc-letter .doc-days td.dishes .chip { vertical-align: middle; }
.doc-letter .doc-foot > p { margin: 0 0 .5mm; }
.doc-receipt .doc-foot { margin-top: 5mm; }

/* Brīdinājums pirms automātiskās izlogošanas */
.idle-warning { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1000; max-width: 90vw;
  background: #7a2e0e; color: #fff; padding: .8rem 1.2rem; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600; }
@media print { .idle-warning { display: none; } }

/* Sākumlapa (07.10.2026): galva ar sveicienu, pulksteni, laiku; galvenās darbības; skaitļi */
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-radius: 16px;
  padding: 1.4rem 1.8rem; margin-bottom: 1rem; box-shadow: 0 6px 20px rgba(20, 70, 40, .18); }
.home-hero h1 { color: #fff; margin: .1rem 0 .4rem; font-size: 1.9rem; }
.home-hero-date { margin: 0; opacity: .85; font-weight: 600; letter-spacing: .02em; }
.home-saying { margin: 0; font-style: italic; opacity: .92; max-width: 46rem; }
.home-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.home-clock { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.home-weather { display: flex; align-items: center; gap: .6rem; background: rgba(255, 255, 255, .14); border-radius: 12px; padding: .45rem .8rem; }
.home-weather .muted { color: rgba(255, 255, 255, .8); }
.home-weather-icon { font-size: 1.8rem; line-height: 1; }
.home-weather b { font-size: 1.2rem; }
.home-weather small { display: block; opacity: .85; font-size: .8rem; }
.home-main { border-radius: 16px; padding: 1.2rem 1.4rem; margin-bottom: 1rem; }
.home-main h2 { margin: 0 0 .8rem; font-size: 1.25rem; }
.home-main .home-search { padding: 0; margin: 0 0 1rem; border: 0; box-shadow: none; }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.home-action { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.home-action:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(20, 70, 40, .12); transform: translateY(-1px); }
.home-action-icon { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; background: #e8f3ec; color: var(--primary-dark); }
.home-action-icon svg { width: 1.3rem; height: 1.3rem; }
.home-action strong { display: block; font-size: 1.05rem; }
.home-action small { color: var(--muted); }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.home-stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; display: flex; flex-direction: column; }
.home-stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.home-stat-value { font-size: 2rem; font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.home-stat-sub { font-size: .85rem; color: var(--muted); }
.home-week { display: flex; align-items: flex-end; gap: 4px; height: 2.6rem; margin-top: .2rem; }
.home-week-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.home-week-bar i { display: block; width: 100%; min-height: 2px; background: #b9dcc5; border-radius: 3px 3px 0 0; }
.home-week-bar.today i { background: var(--primary); }
.home-week-bar b { font-size: .65rem; color: var(--muted); font-weight: 600; }
@media (max-width: 800px) {
  .home-actions, .home-stats { grid-template-columns: 1fr 1fr; }
  .home-hero-side { align-items: flex-start; }
}
@media (max-width: 520px) { .home-actions, .home-stats { grid-template-columns: 1fr; } }

/* Biroja piezīmes sākumlapā */
.notes { margin-bottom: 1rem; }
.notes h2 { display: flex; align-items: center; gap: .4rem; }
.note-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.note-add input[type=text] { flex: 1; min-width: 14rem; }
.note-add label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; }
.note-add button { display: inline-flex; align-items: center; gap: .3rem; }
.note { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem .6rem; border-radius: 10px; background: #fffbea; border: 1px solid #f3e6a6; margin-bottom: .45rem; }
.note.overdue { background: #fdecec; border-color: #f2b8b5; }
.note.due-today { background: #fff4e0; border-color: #f5c77e; }
.note.done { background: #f4f6f5; border-color: #e3e8e5; opacity: .75; }
.note.done .note-text { text-decoration: line-through; }
.note-check { width: 1.4rem; height: 1.4rem; border-radius: 6px; border: 2px solid #9aa5b1; background: #fff; padding: 0; cursor: pointer; flex: none; margin-top: .1rem; }
.note-check:hover { border-color: var(--primary); background: #e8f3ec; }
.note-check.checked { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 800; line-height: 1; }
.note-body { flex: 1; }
.note-text { font-size: 1rem; white-space: pre-wrap; }
.note-meta { font-size: .78rem; color: var(--muted); }
.note-del { font-size: 1.3rem; line-height: 1; color: #9aa5b1; }
.notes-done summary { cursor: pointer; margin: .3rem 0; }

/* Sākumlapas statistika pa mēnešiem */
.home-chart { margin-bottom: 1rem; }
.home-chart-head { display: flex; align-items: center; gap: .5rem; }
.home-chart-head h2 { margin: 0; }
.home-chart-kpis { display: flex; gap: 2rem; flex-wrap: wrap; margin: .8rem 0 .4rem; }
.home-chart-kpis div { display: flex; flex-direction: column; color: var(--muted); font-weight: 600; font-size: .9rem; }
.home-chart-kpis b { font-size: 1.8rem; color: #1f2933; font-weight: 800; }
.kpi-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.kpi-dot.gross, .kpi-dot.portions { background: #16a34a; }
.kpi-dot.commission { background: #ea580c; }
.home-chart-kpis div > span { display: inline; }
.home-chart-canvas svg { width: 100%; height: auto; display: block; }
.home-chart-canvas .ax { font-size: 12px; fill: #6b7280; }

/* Sākumlapa uz plata ekrāna: piezīmes kreisajā malā (tukšajā vietā), citādi zem satura */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1500px) {
  .home-layout { grid-template-columns: 340px minmax(0, 1100px); justify-content: center; align-items: start; }
  .home-aside { grid-column: 1; grid-row: 1; position: sticky; top: 1rem; }
  .home-center { grid-column: 2; grid-row: 1; margin: 0; }
  .home-notes .note-add { flex-direction: column; align-items: stretch; }
  .home-notes .note-add input[type=text] { min-width: 0; }
}
@media (max-width: 1499px) { .home-aside { max-width: 1100px; margin: 0 auto; width: 100%; } }

/* Sākumlapa pilnā platumā: kreisi piezīmes, vidū darbs, labi statistika */
@media (min-width: 1500px) {
  .home-layout { grid-template-columns: minmax(300px, 1fr) minmax(0, 1000px) minmax(300px, 1fr); justify-content: stretch; gap: 1rem; padding: 0 .5rem; }
  .home-aside { grid-column: 1; grid-row: 1; position: sticky; top: .75rem; height: calc(100vh - 6rem); display: flex; }
  .home-aside .home-notes { flex: 1; display: flex; flex-direction: column; margin: 0; overflow: hidden; }
  .home-aside .home-notes > .note, .home-aside .home-notes > details, .home-aside .home-notes > p { flex: none; }
  .home-notes { overflow-y: auto !important; }
  .home-center { grid-column: 2; grid-row: 1; max-width: none; }
  .home-right { grid-column: 3; grid-row: 1; position: sticky; top: .75rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
}
@media (max-width: 1499px) { .home-right { max-width: 1100px; margin: 0 auto; width: 100%; } }
body.home-wide main { max-width: none; }
.home-side-card { margin-bottom: 1rem; }
.home-right .home-chart-kpis { gap: 1rem; }
.home-right .home-chart-kpis b { font-size: 1.25rem; }
.tour-chart { padding: .5rem 0; border-bottom: 1px solid #eef0f3; }
.tour-chart:last-child { border-bottom: 0; }
.tour-chart-head { display: flex; justify-content: space-between; font-size: .9rem; }
.tour-chart-head span { color: var(--muted); }
.tour-chart-canvas svg { width: 100%; height: auto; display: block; }
.tour-chart-canvas .ax { font-size: 9px; fill: #9aa5b1; }

/* Sveiciena josla pašā augšā, virs izvēlnes, visā platumā */
.home-hero-top { border-radius: 0; margin: 0; box-shadow: none; padding: 1rem 2rem; }
.home-hero-top h1 { font-size: 1.7rem; }
.home-hero-top .home-clock { font-size: 2.6rem; }
@media print { .home-hero-top { display: none; } }

/* Galvenie rīki izcelti: lielas krāsainas flīzes, meklēšana ar ēnu */
.home-main { box-shadow: 0 10px 30px rgba(20, 70, 40, .10); border: 1px solid #e3ece6; }
.home-main .home-search input { font-size: 1.3rem; padding: 1rem 1.2rem; border: 2px solid #d5e3da; background: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.04); }
.home-main .home-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(46, 125, 80, .15); outline: none; }
.home-actions { gap: 1rem; }
.home-action { border: 0; color: #fff; padding: 1.2rem 1.2rem; border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.home-action small { color: rgba(255,255,255,.85); }
.home-action strong { font-size: 1.2rem; }
.home-action-icon { width: 3.2rem; height: 3.2rem; border-radius: 14px; background: rgba(255,255,255,.2); color: #fff; }
.home-action-icon svg { width: 1.6rem; height: 1.6rem; }
.home-action:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.18); border: 0; }
.act-order { background: linear-gradient(135deg, #1f7a4a, #2fa064); }
.act-change { background: linear-gradient(135deg, #c2620f, #e48a2a); }
.act-customer { background: linear-gradient(135deg, #1f5f9e, #3a84c9); }
.tour-chart-empty { margin: .3rem 0 .2rem; font-size: .82rem; color: var(--muted); font-style: italic; }

/* Klienta meklēšana izcelta: gaiši zaļš panelis, liela lupa laukā */
.home-main .home-search-hero { background: linear-gradient(135deg, #eaf6ee, #f5fbf7); border: 1px solid #cfe6d7; border-radius: 16px; padding: 1rem 1.2rem 1.1rem; }
.home-search-hero label { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); margin-bottom: .5rem; }
.home-search-hero label svg { width: 1.2rem; height: 1.2rem; }
.home-main .home-search-hero input { font-size: 1.45rem; padding: 1.05rem 1.2rem 1.05rem 3.4rem; border-radius: 14px; border: 2px solid #9fd0b1;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%232e7d50' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 1.1rem center;
  box-shadow: 0 4px 14px rgba(46, 125, 80, .12); }
.home-search-hero .help { display: block; margin-top: .45rem; }
.home-search-hero kbd { display: inline-block; padding: 0 .4rem; border: 1px solid #b9cfc1; border-bottom-width: 2px; border-radius: 4px; background: #fff; font-size: .8em; }

/* Piezīmju krāsas pēc termiņa: šodien sarkans, nokavēts tumši sarkans, vēlāk oranžs, bez termiņa dzeltens */
.note.due-today { background: #fdecec; border-color: #ef9a96; }
.note.due-today .note-meta strong { color: #b42318; }
.note.overdue { background: #fbdcdc; border-color: #d92d20; border-left: 5px solid #d92d20; }
.note.overdue .note-meta strong { color: #912018; }
.note.due-later { background: #fff4e0; border-color: #f5c77e; }

/* Zuletzt geöffnet (kreisi zem piezīmēm) un Feiertage (labi) */
.home-recent h2, .home-holidays h2 { display: flex; align-items: center; gap: .4rem; }
.recent-row { display: flex; flex-direction: column; padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: inherit; }
.recent-row:hover { background: #eef7f1; }
.recent-name { font-weight: 600; }
.recent-meta { font-size: .78rem; color: var(--muted); }
.holiday-row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid #eef0f3; }
.holiday-row:last-child { border-bottom: 0; }
.holiday-date { flex: none; width: 3.2rem; text-align: center; background: #e8f3ec; color: var(--primary-dark); border-radius: 8px; padding: .2rem 0; line-height: 1.1; }
.holiday-date b { display: block; font-size: 1rem; }
.holiday-date small { font-size: .7rem; text-transform: uppercase; }
.holiday-row.soon .holiday-date { background: #fdecec; color: #b42318; }
.holiday-body { flex: 1; display: flex; flex-direction: column; }
.holiday-body span { font-size: .8rem; color: var(--muted); }
.holiday-in { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
@media (min-width: 1500px) {
  .home-aside { flex-direction: column; gap: 1rem; }
  .home-aside .home-recent { flex: none; max-height: 40%; overflow-y: auto; margin: 0; }
}

/* „Kunde suchen und öffnen” izcelts un centrā */
.home-search-hero label { display: flex; justify-content: center; align-items: center; gap: .5rem; font-size: 1.4rem; font-weight: 800; margin-bottom: .7rem; }
.home-search-hero label svg { width: 1.5rem; height: 1.5rem; }
.home-search-hero .help { text-align: center; }

/* Svētki sagrupēti pēc piegādes dienas */
.holiday-days { display: flex; flex-wrap: wrap; gap: .35rem; }
.holiday-chip { display: inline-flex; align-items: center; gap: .2rem; background: #eef4f0; border: 1px solid #d5e3da; border-radius: 999px; padding: .1rem .3rem .1rem .6rem; font-size: .9rem; }
.holiday-chip form { display: inline; margin: 0; }
.holiday-chip button { font-size: 1rem; line-height: 1; padding: 0 .2rem; color: #9aa5b1; }

/* Bestelltermine pēc pasūtīšanas dienas */
.order-days tr.today-row td { background: #eef7f1; }
.holiday-chip.special { background: #fff1db; border-color: #f5c77e; }
.holiday-chip.own { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; padding-right: .6rem; }

/* Bestelltermine & Feiertage – tāds pats stils kā sākumlapai */
.dl-page { max-width: 1250px; margin: 0 auto; }
.dl-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: 16px; padding: 1.2rem 1.6rem; margin-bottom: 1rem; box-shadow: 0 6px 20px rgba(20, 70, 40, .18); }
.dl-hero h1 { color: #fff; margin: 0 0 .3rem; }
.dl-hero p { margin: 0; opacity: .92; }
.dl-hero-icon svg { width: 3rem; height: 3rem; opacity: .35; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1000px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.3rem; box-shadow: 0 6px 18px rgba(20, 70, 40, .06); margin-bottom: 1rem; }
.dl-grid .dl-card { margin-bottom: 0; }
.dl-card-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .8rem; }
.dl-card-head h2 { margin: 0; font-size: 1.15rem; }
.dl-card-head p { margin: .15rem 0 0; }
.dl-num { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: #eef1f4; color: #374151; }
.dl-num svg { width: 1.3rem; height: 1.3rem; }
.dl-num.green { background: #e8f3ec; color: var(--primary-dark); }
.dl-num.orange { background: #fff1db; color: #b45309; }
.dl-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; align-items: end; background: #f7faf8; border: 1px solid #e3ece6; border-radius: 12px; padding: .8rem; margin-bottom: .8rem; }
.dl-form label { margin: 0; }
.dl-form button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.dl-row { display: flex; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid #eef0f3; }
.dl-row:last-child { border-bottom: 0; }
.dl-date { flex: none; width: 3.4rem; text-align: center; border-radius: 10px; padding: .25rem 0; line-height: 1.1; background: #eef1f4; }
.dl-date b { display: block; font-size: 1.05rem; }
.dl-date small { font-size: .7rem; text-transform: uppercase; }
.dl-date.green { background: #e8f3ec; color: var(--primary-dark); }
.dl-date.orange { background: #fff1db; color: #b45309; }
.dl-row-body { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.order-days { width: 100%; }
.order-days tr.special-row td { background: #fffaf0; }

/* Divas kolonnas pa visu lapu: kreisi pasūtīšana, labi piegāde */
.dl-page { max-width: none; }
.dl-columns { align-items: start; }
.dl-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.dl-col .dl-card { margin: 0; }
.order-days tr.holiday-row td { background: #f3faf5; }
.order-days { table-layout: fixed; }
.order-days th:nth-child(1) { width: 3.2rem; }
.order-days th:nth-child(2) { width: 11rem; }
.order-days th:nth-child(4) { width: 9rem; }
.dl-hero-top { border-radius: 0; margin: 0; box-shadow: none; padding: .9rem 2rem; }
@media print { .dl-hero-top { display: none; } }
.dl-hero-orange { background: linear-gradient(135deg, #9a4a0a, #d97706); box-shadow: 0 6px 20px rgba(150, 75, 10, .18); }
.dl-col .dl-hero { margin: 0; }

/* Klientu saraksts (07.10.2026) */
.cl-page { max-width: 1500px; margin: 0 auto; }
.cl-hero { margin-bottom: 1rem; }
.cl-counts { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .3rem; opacity: .95; }
.cl-counts b { font-size: 1.3rem; margin-right: .2rem; }
.cl-new { display: inline-flex; align-items: center; gap: .5rem; background: #fff; color: var(--primary-dark); font-weight: 700; padding: .7rem 1.1rem;
  border-radius: 12px; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.cl-new svg { width: 1.2rem; height: 1.2rem; }
.cl-filter { display: flex; flex-direction: column; gap: .7rem; }
.cl-search { display: flex; gap: .6rem; }
.cl-search input { flex: 1; font-size: 1.15rem; padding: .8rem 1rem; border: 2px solid #cfe6d7; border-radius: 12px; }
.cl-search input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(46,125,80,.15); }
.cl-search button { display: inline-flex; align-items: center; gap: .4rem; border-radius: 12px; padding: 0 1.2rem; }
.cl-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cl-chip-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 .2rem 0 .8rem; }
.cl-chip-label:first-child { margin-left: 0; }
.cl-chip { display: inline-flex; align-items: center; padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: .9rem; background: #fff; margin: 0; }
.cl-chip input { display: none; }
.cl-chip:hover { border-color: var(--primary); }
.cl-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.cl-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.cl-table { width: 100%; }
.cl-table tbody tr { cursor: pointer; }
.cl-table tbody tr:hover td { background: #f3faf5; }
.cl-table tr.inactive td { opacity: .55; }
.cl-name { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.cl-name b { display: block; font-size: 1rem; }
.cl-name small { color: var(--muted); }
.cl-avatar { flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #e8f3ec; color: var(--primary-dark); font-weight: 700; font-size: .85rem; }
.cl-tour { display: inline-block; padding: .15rem .55rem; border-radius: 8px; background: #eef1f4; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-pay { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.cl-pay.bar { background: #e8f3ec; color: #1f6b40; }
.cl-pay.re { background: #e6efff; color: #1f4f8f; }
.cl-yes { color: var(--primary-dark); font-weight: 600; }
.cl-actions { white-space: nowrap; text-align: right; }
.cl-actions .button { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; }
.cl-actions svg { width: 1.05rem; height: 1.05rem; }
.cl-pages { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .8rem; }
.cl-sal { font-style: normal; font-weight: 400; color: var(--muted); }
.cl-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.cl-sort:hover { color: var(--primary-dark); text-decoration: underline; }
.cl-status { display: inline-block; margin-right: .5rem; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #f1f1f1; color: #6b7280; vertical-align: middle; }
.cl-status.on { background: #e8f3ec; color: #1f6b40; }

/* Klienta forma (Neuer Kunde / labošana) mūsdienīgāka */
.cf-hero { margin-bottom: 1rem; }
.nice-form .form-section { border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(20, 70, 40, .06); padding: 1.2rem 1.4rem; }
.nice-form .form-section h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; margin-top: 0; }
.nice-form .form-section h2 .step { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1rem; }
.nice-form input[type=text], .nice-form input[type=email], .nice-form input[type=tel], .nice-form input[type=search], .nice-form select, .nice-form textarea { border-radius: 10px; }
.nice-form .address-search input { border: 2px solid #cfe6d7; font-size: 1.05rem; }
.nice-form .partner-box { border-radius: 14px; }
.payer-search input { border: 2px solid #cfe6d7; border-radius: 10px; }
.payer-search .new-hit { color: #b45309; font-weight: 600; }
.sticky-actions button { min-width: 10rem; }
.cl-table .cl-status-col { text-align: center; }
.cl-table .cl-status-col .cl-status { margin: 0; }
/* Klientu saraksts un klienta forma vienā platumā */
.cl-page, .form-page { max-width: 1350px; margin: 0 auto; }

/* Zahlungspartner: veida krāsas */
.cl-avatar svg { width: 1.1rem; height: 1.1rem; }
.cl-avatar.kind-authority { background: #e6efff; color: #1f4f8f; }
.cl-avatar.kind-relative { background: #fff1db; color: #b45309; }
.cl-kind { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #f1f1f1; color: #4b5563; }
.cl-kind.kind-authority { background: #e6efff; color: #1f4f8f; }
.cl-kind.kind-relative { background: #fff1db; color: #b45309; }
.nice-form .form-section h2 .step svg { width: 1rem; height: 1rem; }

/* Dzēšanas zona klienta / partnera formā */
.danger-zone { border-color: #f2c4c0 !important; margin-top: 1.5rem; }
.danger-zone h2 { color: #b42318; }
.button.danger, button.danger { background: #b42318; border-color: #b42318; color: #fff; }
/* Jauna cenu grupa klienta formā */
.field-row.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.new-group h3 small { font-weight: 400; }

/* Klienta lapa (07.10.2026): zaļa galvene visām cilnēm, kalendārs, sānu kartītes */
.hub-head { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-radius: 16px; padding: 1.1rem 1.5rem; box-shadow: 0 6px 20px rgba(20, 70, 40, .18); margin-bottom: .6rem; }
.hub-head h1 { color: #fff; }
.hub-head p { opacity: .95; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hub-sal { font-size: .95rem; font-weight: 600; opacity: .85; }
.hub-avatar { background: #fff; color: var(--primary-dark); }
.hub-number { background: rgba(255, 255, 255, .2); color: #fff; }
.hub-status { font-size: .78rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: #fde2e1; color: #b42318; }
.hub-status.on { background: #e8f3ec; color: #1f6b40; }
.hub-chip { display: inline-block; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: .1rem .65rem; font-size: .88rem; }
.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .cv-layout { grid-template-columns: 1fr; } }
.cv-main, .cv-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.cv-main .dl-card, .cv-side .dl-card, .cv-stats { margin: 0; }
.cv-small { font-size: 1.45rem; }
.cv-red { color: #b42318; }
.dl-card-head .spacer { flex: 1; }
.dl-card-head .button { display: inline-flex; align-items: center; gap: .35rem; }
.dl-card-head .button svg { width: 1rem; height: 1rem; }
.cv-cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; margin: 0 -4px; }
.cv-cal th { text-align: center; font-size: .78rem; color: var(--muted); text-transform: uppercase; padding: .2rem; border: 0; background: none; }
.cv-cal td { vertical-align: top; height: 4.6rem; padding: .3rem .35rem; border: 1px solid #e8ece9; border-radius: 10px; background: #fff; }
.cv-cal td.cv-kw, .cv-cal th.cv-kw { width: 3rem; text-align: center; vertical-align: middle; background: #eef1f4; border-color: #eef1f4; color: #374151; }
.cv-cal td.today { border: 2px solid var(--primary); background: #f3faf5; }
.cv-cal td.past { opacity: .5; }
.cv-cal td.paused { background: repeating-linear-gradient(135deg, #fff7e6, #fff7e6 6px, #fff 6px, #fff 12px); }
.cv-cal td.cancelled { background: #f7f7f7; }
.cv-date { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.cv-chip { display: inline-block; margin: 0 .2rem .2rem 0; padding: .05rem .45rem; border-radius: 6px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #dcefe3; color: #14532d; }
.cv-chip.salad { background: #eef6d9; color: #3f5a12; }
.cv-chip.dessert { background: #f6e3d3; color: #7a3d12; }
.cv-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: #92400e; }
.cv-cal td.cancelled .cv-tag { color: var(--muted); }
.cv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.cv-head h3, .cv-notes h3 { margin: 0; font-size: 1.05rem; }
.cv-addr { font-size: 1.1rem; font-weight: 600; margin: 0 0 .5rem; }
.cv-line { margin: .3rem 0; }
#cv-map { height: 180px; border-radius: 12px; margin-top: .7rem; border: 1px solid var(--border); z-index: 0; }
.cv-partner { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; margin-top: .5rem; border: 1px solid #e3ece6; border-radius: 10px; background: #f7faf8; color: inherit; text-decoration: none; }
.cv-partner:hover { border-color: var(--primary); }
.cv-partner small { color: var(--muted); font-size: .75rem; }
.cv-notes { background: #fffbe6 !important; border-color: #f3e3a0 !important; }
.cv-notes h3 { display: flex; align-items: center; gap: .4rem; }
.cv-notes h3 svg { width: 1rem; height: 1rem; }
.cv-notes p { margin: .4rem 0 0; }
.cv-standing { display: flex; gap: .5rem; align-items: baseline; padding: .25rem 0; border-bottom: 1px solid #f0f2f4; }
.cv-standing > b { width: 1.8rem; flex: none; }
.cv-pause-form { display: grid; gap: .5rem; margin-top: .7rem; }
.cv-pause-form label { margin: 0; }
.ng-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem .7rem; margin-bottom: .4rem; }
.ng-item { margin: 0; padding: .4rem .5rem; border-radius: 8px; background: #fff; border: 1px solid #e3ece6; }
.ng-item span { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .2rem; }
.ng-item.menu { border-left: 4px solid #8cc7a0; }
.ng-item.salad { border-left: 4px solid #c5dc8a; }
.ng-item.dessert { border-left: 4px solid #e2b48f; }
#group-home #group-section > label { max-width: calc(50% - .5rem); }
@media (max-width: 800px) { #group-home #group-section > label { max-width: none; } }
.hub-tabs { align-items: center; }
.hub-tabs-spacer { flex: 1; }
.hub-delete { margin: 0 0 .2rem; }
.hub-delete button { background: #fff; color: #b42318; border: 1px solid #f2c4c0; padding: .35rem .9rem; font-weight: 700; border-radius: 8px; }
.hub-delete button:hover { background: #b42318; color: #fff; }
span.hub-delete.off { color: #9aa1a9; border: 1px dashed #d6dbe0; padding: .3rem .9rem; border-radius: 8px; font-weight: 600; cursor: help; margin-bottom: .2rem; }

/* Klienta izvēlne kā lielas krāsainas pogas (kā sākumlapā) */
.hub-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: .7rem; margin-bottom: 1.2rem; }
@media (max-width: 1100px) { .hub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hub-tile { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-radius: 14px; color: #fff; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1); transition: transform .12s, box-shadow .12s; opacity: .8; }
.hub-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .16); opacity: 1; color: #fff; }
.hub-tile.active { opacity: 1; outline: 3px solid #fff; box-shadow: 0 0 0 6px rgba(20, 70, 40, .35), 0 10px 24px rgba(0, 0, 0, .16); }
.hub-tile strong { display: block; font-size: 1.05rem; }
.hub-tile small { display: block; font-size: .78rem; color: rgba(255, 255, 255, .88); }
.hub-tile-icon { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: rgba(255, 255, 255, .2); }
.hub-tile-icon svg { width: 1.35rem; height: 1.35rem; }
.tile-overview { background: linear-gradient(135deg, #1b5e20, #2e7d32); }
.tile-orders { background: linear-gradient(135deg, #c2620f, #e48a2a); }
.tile-standing { background: linear-gradient(135deg, #0f766e, #14a39a); }
.tile-data { background: linear-gradient(135deg, #1f5f9e, #3a84c9); }
.tile-invoices { background: linear-gradient(135deg, #6b4fa0, #8c6cc4); }
.tile-history { background: linear-gradient(135deg, #4b5563, #6b7280); }
.hub-tiles .hub-delete { margin: 0; display: flex; }
.hub-tiles .hub-delete button, .hub-tiles span.hub-delete.off { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  min-width: 5.5rem; width: 100%; padding: .5rem .8rem; border-radius: 14px; font-size: .82rem; font-weight: 700; margin: 0; }
.hub-tiles .hub-delete button { background: #fff; color: #b42318; border: 2px solid #f2c4c0; }
.hub-tiles .hub-delete button:hover { background: #b42318; color: #fff; border-color: #b42318; }
.hub-tiles span.hub-delete.off { color: #9aa1a9; border: 2px dashed #d6dbe0; background: #fafbfc; }
.hub-tiles .hub-delete svg { width: 1.3rem; height: 1.3rem; }

/* Pause – liela oranža kartīte */
.cv-pause { background: linear-gradient(135deg, #fff7ec, #fff1db) !important; border: 1px solid #f5c48a !important; }
.cv-pause h2 { color: #9a4a0a; }
.cv-pause p { color: #7a3e00; }
.cv-pause-form { display: grid; gap: .5rem; }
.cv-pause-form label { margin: 0; color: #7a3e00; font-weight: 600; font-size: .85rem; }
.cv-pause-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cv-pause-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: linear-gradient(135deg, #c2620f, #e48a2a);
  border: 0; color: #fff; font-size: 1.05rem; font-weight: 700; padding: .75rem 1rem; border-radius: 12px; }
.cv-pause-btn:hover { filter: brightness(1.06); }
.cv-pause-btn svg { width: 1.1rem; height: 1.1rem; }

/* Dzēšanas poga sarakstos */
.cl-del-form { display: inline; margin: 0; }
.cl-actions .cl-del { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 8px; background: #fff; color: #b42318; border: 1px solid #f2c4c0; vertical-align: middle; }
.cl-actions .cl-del:hover { background: #b42318; color: #fff; }
.cl-actions .cl-del.off { background: #fafbfc; color: #c3c8ce; border: 1px dashed #d6dbe0; cursor: help; }
.cl-actions .cl-del.off:hover { background: #fafbfc; color: #c3c8ce; }

/* Kalendārs: nedēļas skaidrāk atdalītas (atstarpe starp rindām, katra otrā nedēļa iekrāsota) */
.cv-cal { border-spacing: 4px 10px; margin: -6px -4px; }
.cv-cal tbody tr:nth-child(even) td:not(.cv-kw):not(.today) { background: #f4f8f5; }
.cv-cal tbody tr:nth-child(odd) td.cv-kw { background: #e3ece6; color: var(--primary-dark); }
.cv-cal td.cv-kw b { display: block; font-size: 1.25rem; line-height: 1.1; }
.cv-cal td.cv-kw small { display: block; font-size: .66rem; color: var(--muted); line-height: 1.2; }
.cv-cal th.cv-kw { width: 4.2rem; }

/* Daten: vispirms skatīšanās, labošana pēc pogas „Bearbeiten” */
.cf-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.view-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #eef4fb; border: 1px solid #c9dbef;
  color: #1f4f8f; border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.view-banner span { display: inline-flex; align-items: center; gap: .4rem; }
.view-banner svg { width: 1.1rem; height: 1.1rem; }
.view-edit-btn { display: inline-flex; align-items: center; gap: .45rem; background: linear-gradient(135deg, #1f5f9e, #3a84c9); border: 0; color: #fff;
  font-weight: 700; font-size: 1rem; padding: .65rem 1.4rem; border-radius: 10px; }
.view-edit-btn svg { width: 1.05rem; height: 1.05rem; }
.nice-form .view-only { display: none; }
.nice-form.view-mode .view-only { display: inline-flex; }
.nice-form.view-mode .edit-only { display: none; }
/* Bloķētie lauki izskatās kā parasts teksts */
.view-mode .cf-fields input:not([type=radio]):not([type=checkbox]), .view-mode .cf-fields select, .view-mode .cf-fields textarea {
  background: #f7f9f8; border-color: transparent; color: var(--text); opacity: 1; cursor: default; -webkit-text-fill-color: var(--text); }
.view-mode .cf-fields select { appearance: none; }
.view-mode .cf-fields ::placeholder { color: transparent; }
.view-mode .cf-fields .segmented label:not(:has(input:checked)), .view-mode .cf-fields .choice-card:not(:has(input:checked)) { opacity: .35; }
.view-mode .cf-fields button.link, .view-mode .cf-fields [data-toggle], .view-mode #new-group-toggle, .view-mode .cf-fields .address-search,
.view-mode .cf-fields .help { display: none !important; }
.view-mode .cf-fields label, .view-mode .cf-fields .choice-card { cursor: default; }
.nice-form.edit-mode .view-banner { display: none; }
.cv-once { font-style: normal; font-size: .62rem; font-weight: 700; color: #9a4a0a; background: #fff1db; border-radius: 4px; padding: 0 .3rem; margin-left: .2rem; }

/* Daten skatīšanās režīmā: pārskatāma tabula, forma paslēpta līdz „Bearbeiten” */
.view-mode .cf-fields > .form-section { display: none; }
.view-mode .cf-fields > .form-section.keep-in-view { display: block; }
.nice-form.edit-mode .view-only-block { display: none; }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .ds-grid { grid-template-columns: 1fr; } }
.ds-card { margin: 0; }
.ds-card h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin: 0 0 .7rem; }
.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th { width: 38%; text-align: left; font-weight: 600; color: var(--muted); font-size: .88rem; padding: .5rem .6rem .5rem 0; vertical-align: top; border-bottom: 1px solid #eef0f3; background: none; }
.ds-table td { padding: .5rem 0; border-bottom: 1px solid #eef0f3; font-size: 1rem; }
.ds-table tr:last-child th, .ds-table tr:last-child td { border-bottom: 0; }
.ds-notes { background: #fffbe6; border: 1px solid #f3e3a0; border-radius: 10px; padding: .7rem .9rem; margin: 0; }
/* Klienta pogas: nosaukumi vienmēr pilnībā redzami */
.hub-tile > span:last-child { min-width: 0; }
.hub-tile strong { white-space: nowrap; }
@media (max-width: 1500px) {
  .hub-tile { padding: .75rem .8rem; gap: .5rem; }
  .hub-tile-icon { width: 2rem; height: 2rem; border-radius: 10px; }
  .hub-tile-icon svg { width: 1.1rem; height: 1.1rem; }
  .hub-tile strong { font-size: .98rem; }
  .hub-tile small { display: none; }
}
@media (max-width: 1250px) {
  .hub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-tile small { display: block; }
}

/* Bestellungen ansehen */
.lk-search { padding: 1rem 1.2rem; }
.lk-search-box { position: relative; }
.lk-search-box input { font-size: 1.3rem; padding: .9rem 1.1rem .9rem 3.2rem; border-radius: 14px; border: 2px solid #9fd0b1;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232e7d50' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 1rem center; }
.lk-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: .3rem; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); max-height: 420px; overflow: auto; }
.lk-results li { padding: .55rem .8rem; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; }
.lk-results li small { color: var(--muted); }
.lk-results li.on, .lk-results li:hover { background: #e8f3ec; }
.lk-results li.inactive b { color: var(--muted); }
.lk-customer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.lk-who { display: flex; gap: .9rem; align-items: center; }
.lk-who h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lk-who h2 small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.lk-who p { margin: .2rem 0 0; }
.lk-nr { background: #eef1f5; color: var(--muted); }
.lk-quick { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .lk-quick { grid-template-columns: 1fr 1fr; } }
.lk-q-btn { display: flex; flex-direction: column; gap: .1rem; padding: .85rem 1rem; border-radius: 14px; background: #fff; border: 2px solid var(--border);
  color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.lk-q-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20, 70, 40, .12); border-color: #9fd0b1; }
.lk-q-btn small { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lk-q-btn b { font-size: 1.45rem; color: var(--primary-dark); line-height: 1.2; }
.lk-q-btn span { font-size: .85rem; color: var(--muted); }
.lk-q-btn.on { border-color: var(--primary); background: #f3faf5; box-shadow: 0 0 0 3px rgba(46, 125, 50, .15); }
.lk-q-btn.q-next { background: linear-gradient(135deg, #1f7a4a, #2fa064); border: 0; color: #fff; }
.lk-q-btn.q-next small, .lk-q-btn.q-next span, .lk-q-btn.q-next b { color: #fff; }
.lk-q-btn.q-next span { opacity: .9; }
.lk-q-btn.q-next.on { box-shadow: 0 0 0 4px rgba(46, 125, 50, .3); }
.lk-week-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.lk-week-head .spacer { flex: 1; }
.lk-week-title h2 { margin: 0; font-size: 1.5rem; }
.lk-arrow { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #eef1f4; color: var(--text); text-decoration: none; font-size: 1.6rem; line-height: 1; }
.lk-arrow:hover { background: #e3ece6; color: var(--primary-dark); }
.lk-sums { display: flex; gap: 1rem; color: var(--muted); }
.lk-sums b { color: var(--text); }
.lk-edit { display: inline-flex; align-items: center; gap: .4rem; background: linear-gradient(135deg, #c2620f, #e48a2a); border: 0; }
.lk-edit svg { width: 1rem; height: 1rem; }
.lk-strip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: 1rem; }
.lk-strip-item { flex: 1; min-width: 4.2rem; display: flex; flex-direction: column; align-items: center; padding: .35rem .3rem; border-radius: 10px;
  background: #f4f6f5; color: inherit; text-decoration: none; border: 2px solid transparent; }
.lk-strip-item small { font-size: .62rem; color: var(--muted); }
.lk-strip-item b { font-size: 1.05rem; line-height: 1.1; }
.lk-strip-item span { font-size: .7rem; color: var(--muted); }
.lk-strip-item.this { background: #e8f3ec; }
.lk-strip-item.on { border-color: var(--primary); background: #fff; }
.lk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 1000px) { .lk-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lk-day { border: 1px solid #e3e8e5; border-radius: 12px; padding: .6rem .65rem; min-height: 9rem; display: flex; flex-direction: column; background: #fff; }
.lk-day.today { border: 2px solid var(--primary); background: #f3faf5; }
.lk-day.past { opacity: .55; }
.lk-day.empty { background: #fafbfa; }
.lk-day.pause { background: repeating-linear-gradient(135deg, #fff7e6, #fff7e6 8px, #fff 8px, #fff 16px); }
.lk-day.cancelled { background: #f6f6f6; }
.lk-day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .45rem; }
.lk-day-head b { font-size: .95rem; }
.lk-day-head span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.lk-chips { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; flex: 1; }
.lk-chips .cv-chip { font-size: .85rem; margin: 0; }
.lk-day-foot { display: flex; justify-content: space-between; align-items: center; gap: .3rem; margin-top: .5rem; flex-wrap: wrap; }
.lk-tag { font-size: .68rem; font-weight: 700; padding: .05rem .4rem; border-radius: 5px; background: #eef1f4; color: #4b5563; }
.lk-tag.standing { background: #dff3f1; color: #0f766e; }
.lk-tag.once { background: #fff1db; color: #9a4a0a; }
.lk-tag.pause { background: #fff1db; color: #92400e; }
.lk-tag.cancelled { background: #eee; color: #6b7280; }
.lk-amount { font-size: .82rem; font-weight: 700; }
.lk-none { margin: auto 0; text-align: center; color: #b8bec6; font-size: .82rem; }
.lk-chips .cv-chip, .cv-cal .cv-chip, .cv-standing .cv-chip { flex: none; display: inline-block; }

/* Touren & Gebiete */
.tr-page { max-width: none; }
.tr-columns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1rem; align-items: start; }
@media (max-width: 1300px) { .tr-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .tr-columns { grid-template-columns: 1fr; } }
.tr-col { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(20, 70, 40, .06); }
.tr-head { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: center; padding: .9rem 1rem; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.tr-head:hover { color: #fff; filter: brightness(1.06); }
.tr-num { grid-row: span 2; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 12px; background: rgba(255, 255, 255, .2); font-size: 1.3rem; font-weight: 800; }
.tr-head b { display: block; font-size: 1.05rem; }
.tr-head small { display: block; opacity: .9; font-size: .82rem; }
.tr-open { font-size: .78rem; font-weight: 700; opacity: .9; }
.tr-areas { padding: .4rem .8rem .8rem; }
.tr-area { padding: .55rem 0; border-bottom: 1px solid #eef0f3; }
.tr-area:last-child { border-bottom: 0; }
.tr-area-name { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.tr-move { display: flex; gap: .4rem; margin: .35rem 0 0; }
.tr-move select { flex: 1; min-width: 0; padding: .25rem .4rem; font-size: .85rem; }
.tr-move button { padding: .25rem .6rem; font-size: .8rem; }
.tr-move button:disabled { opacity: .4; }
.tr-loose h2, .tr-new h2 { margin: 0 0 .6rem; font-size: 1.1rem; display: flex; align-items: center; gap: .4rem; }
.tr-new h2 svg { width: 1.1rem; height: 1.1rem; }
.tr-new-form { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.tr-new-form label { margin: 0; }
.tr-new-form input { min-width: 18rem; }
.lk-quick { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; }
@media (max-width: 1100px) { .lk-quick { grid-template-columns: 1fr 1fr 1fr; } }
.lk-q-btn.q-change { background: linear-gradient(135deg, #c2620f, #e48a2a); border: 0; color: #fff; }
.lk-q-btn.q-change small, .lk-q-btn.q-change b, .lk-q-btn.q-change span { color: #fff; }
.lk-q-btn.q-change b { display: inline-flex; align-items: center; gap: .4rem; }
.lk-q-btn.q-change b svg { width: 1.1rem; height: 1.1rem; }

/* Bestellungen ansehen: nedēļa kā rindas (diena → ēdieni → statuss → summa) */
.lk-rows { display: flex; flex-direction: column; border: 1px solid #e3e8e5; border-radius: 12px; overflow: hidden; }
.lk-row { display: grid; grid-template-columns: 11rem 1fr 11rem 6.5rem; align-items: center; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid #eef0f3; background: #fff; }
.lk-row:last-child { border-bottom: 0; }
.lk-row:nth-child(even):not(.today):not(.lk-total) { background: #fafbfa; }
.lk-row.today { background: #eef8f1; box-shadow: inset 4px 0 0 var(--primary); }
.lk-row.past > div { opacity: .5; }
.lk-row.empty { padding-top: .45rem; padding-bottom: .45rem; }
.lk-row.pause { background: repeating-linear-gradient(135deg, #fff7e6, #fff7e6 8px, #fff 8px, #fff 16px); }
.lk-row.cancelled .lk-item { text-decoration: line-through; opacity: .6; }
.lk-row-date { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.lk-row-date b { font-size: 1.05rem; min-width: 6.2rem; }
.lk-row-date span { color: var(--muted); font-size: .88rem; }
.lk-row-date i { font-style: normal; font-size: .7rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 5px; padding: 0 .35rem; }
.lk-row-items { display: flex; flex-wrap: wrap; gap: .4rem; }
.lk-item { display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .7rem .2rem .25rem; border-radius: 999px; font-weight: 600; background: #dcefe3; color: #14532d; }
.lk-item b { display: grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; font-size: .9rem; }
.lk-item.salad { background: #eef6d9; color: #3f5a12; }
.lk-item.dessert { background: #f6e3d3; color: #7a3d12; }
.lk-row-status { text-align: right; }
.lk-row-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lk-row .lk-none { color: #b8bec6; font-size: .9rem; margin: 0; }
.lk-total { background: #f1f5f2 !important; border-top: 2px solid #dfe7e2; }
.lk-total .lk-row-amount { font-size: 1.15rem; color: var(--primary-dark); }
@media (max-width: 900px) { .lk-row { grid-template-columns: 1fr auto; } .lk-row-items { grid-column: 1 / -1; } .lk-row-status { display: none; } }
.lk-row-items .lk-item { flex: none; }

/* Pasūtījuma labošana: josla apakšā un mainītie lauki */
.entry-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem -1rem 0; padding: .8rem 1rem;
  background: rgba(243, 246, 242, .95); backdrop-filter: blur(4px); border-top: 1px solid var(--border); }
.entry-bar .spacer { flex: 1; }
.entry-bar .button, .entry-bar button { display: inline-flex; align-items: center; gap: .35rem; }
.entry-bar svg { width: 1rem; height: 1rem; }
.entry-changes { font-weight: 600; color: var(--muted); }
.entry-changes.on { color: #92400e; background: #fff1db; border-radius: 8px; padding: .3rem .7rem; }
.eb-save { min-width: 11rem; font-size: 1.05rem; padding: .65rem 1.4rem; }
.eb-save.pulse { box-shadow: 0 0 0 4px rgba(46, 125, 50, .25); }
.qty-grid td.changed input.qty { outline: 3px solid #f5b400; outline-offset: 1px; }
.changed-sample { outline: 2px solid #f5b400; border-radius: 4px; padding: 0 .25rem; }

/* Pasūtījuma izmaiņu vēsture */
.lk-row-status { display: flex; justify-content: flex-end; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lk-changed { font-size: .72rem; font-weight: 700; color: #92400e; background: #fff1db; border-radius: 5px; padding: .05rem .4rem; text-decoration: none; }
.lk-changed:hover { background: #fde2b8; }
.lk-row { grid-template-columns: 11rem 1fr 14rem 6.5rem; }
.lk-changes { margin-top: 1rem; }
.lk-changes h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.1rem; margin: 0 0 .6rem; }
.lk-changes h2 svg { width: 1.1rem; height: 1.1rem; }
.lk-change { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid #eef0f3; }
.lk-change:last-child { border-bottom: 0; }
.lk-change-when b { display: block; }
.lk-change-when span { font-size: .82rem; color: var(--muted); }
.lk-change-what { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lk-before, .lk-after { display: flex; flex-wrap: wrap; gap: .3rem; }
.lk-arrow-to { font-size: 1.2rem; color: var(--muted); }
@media (max-width: 800px) { .lk-change { grid-template-columns: 1fr; } }
.lk-before small, .lk-after small { align-self: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-right: .2rem; }
.lk-change .lk-item.st-same { opacity: .45; }
.lk-before .lk-item.st-gone, .lk-before .lk-item.st-changed { text-decoration: line-through; opacity: .75; }
.lk-after .lk-item.st-new, .lk-after .lk-item.st-changed { outline: 3px solid #f5b400; outline-offset: 1px; }
.lk-change .lk-item { flex: none; white-space: nowrap; }

/* Pasūtījuma tabula – moderns izskats (07.10.2026) */
.eg-nav { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .7rem 1rem; margin-bottom: 1rem; box-shadow: 0 4px 14px rgba(20, 70, 40, .05); }
.eg-nav .spacer { flex: 1; }
.eg-nav-title b { display: block; font-size: 1.35rem; line-height: 1.1; }
.eg-nav-title span { font-size: .85rem; color: var(--muted); }
.eg-nav-field { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.eg-nav-field input { width: 5rem; padding: .3rem .4rem; margin: 0; }
.eg-nav-field select { width: auto; padding: .3rem .4rem; margin: 0; }
.eg-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: .6rem .8rem .4rem; box-shadow: 0 6px 18px rgba(20, 70, 40, .06); overflow-x: auto; }
.eg-grid { border-collapse: separate; border-spacing: 5px 4px; width: 100%; }
.eg-grid td, .eg-grid th { border: 0; background: none; }
.eg-grid th.dish-head { border-radius: 8px; padding: .4rem .3rem; font-size: .8rem; letter-spacing: .02em; border-right: 0; }
.eg-grid th.eg-day-head { text-align: left; color: var(--muted); font-size: .75rem; }
.eg-day { white-space: nowrap; padding: .2rem .6rem .2rem .3rem !important; }
.eg-day b { display: inline-block; width: 1.9rem; font-size: 1rem; }
.eg-day span { color: var(--muted); font-size: .85rem; }
.eg-day i { font-style: normal; font-size: .65rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 5px; padding: 0 .3rem; margin-left: .3rem; vertical-align: middle; }
.eg-grid tr.weekend td { background: none; }
.eg-grid tr.weekend .eg-day b { color: #7a5c00; }
.eg-grid tr.today .eg-day { background: #e8f3ec !important; border-radius: 8px; }
.eg-grid tr.past .eg-day { opacity: .5; }
.eg-grid input.qty { height: 2.6rem; border-radius: 10px; border: 1.5px dashed color-mix(in srgb, var(--dish, #94a3b8) 40%, #fff); background: #fcfdfc; }
.eg-grid input.qty::placeholder { color: color-mix(in srgb, var(--dish, #94a3b8) 45%, #fff); font-weight: 400; font-size: 1.2rem; opacity: 0; transition: opacity .12s; }
.eg-grid td.qty-cell:hover input.qty::placeholder { opacity: 1; }
.eg-grid td.filled input.qty { border-style: solid; box-shadow: 0 2px 6px color-mix(in srgb, var(--dish, #2e7d32) 35%, transparent); font-size: 1.2rem; }
.eg-grid td.na input.qty { background: repeating-linear-gradient(135deg, #f4f5f7 0 5px, #eceef1 5px 10px); border: 1.5px solid transparent; }
.eg-grid tr.week-row td { background: none; padding: .8rem 0 .2rem; }
.eg-week-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .7rem; border-radius: 10px; background: linear-gradient(90deg, #e8f3ec, #f6faf7); }
.eg-week-bar .spacer { flex: 1; }
.eg-kw { font-weight: 800; color: #fff; background: var(--primary); border-radius: 8px; padding: .15rem .6rem; }
.eg-pill { display: inline-flex; align-items: center; gap: .25rem; background: #fff; color: var(--text); border: 1px solid #d7e2db; border-radius: 999px; padding: .25rem .8rem; font-size: .82rem; font-weight: 600; cursor: pointer; }
.eg-pill:hover { border-color: var(--primary); color: var(--primary-dark); background: #f3faf5; }
.eg-pill.small { padding: .15rem .6rem; font-size: .75rem; }
.eg-actions { white-space: nowrap; text-align: left; }
.eg-actions .lk-tag { margin-right: .3rem; }
.eg-grid tr.totals-row td { background: none; padding: .1rem 0 .5rem; }
.eg-totals { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.eg-sum { background: #f1f5f2; border-radius: 8px; padding: .15rem .6rem; font-size: .85rem; color: var(--muted); }
.eg-sum b { color: var(--text); }
.eg-grid td { vertical-align: middle; }
.eg-grid th.dish-head { min-width: 3.4rem; }

/* Tabula kā Zahner lapiņa: dienas augšā, ēdieni kreisajā malā */
.eg-week { margin-bottom: 1rem; padding: .8rem 1rem; }
.eg-week > .eg-week-bar { margin-bottom: .4rem; }
.eg-sheet { table-layout: fixed; }
.eg-sheet th.eg-corner { width: 7.5rem; }
.eg-sheet th.eg-dayhead { text-align: center; background: linear-gradient(135deg, #1b5e20, #2e7d32) !important; color: #fff; border-radius: 8px; padding: .35rem .2rem; }
.eg-sheet th.eg-dayhead b { display: block; font-size: .95rem; }
.eg-sheet th.eg-dayhead span { font-size: .75rem; opacity: .85; font-weight: 600; }
.eg-sheet th.eg-dayhead i { display: block; font-style: normal; font-size: .62rem; font-weight: 800; color: var(--primary-dark); background: #fff; border-radius: 4px; margin: .15rem auto 0; width: fit-content; padding: 0 .3rem; }
.eg-sheet th.eg-dayhead.weekend { background: linear-gradient(135deg, #4b6b52, #6b8a71) !important; }
.eg-sheet th.eg-dayhead.past { opacity: .45; }
.eg-sheet th.eg-dayhead.today { box-shadow: 0 0 0 3px #b9dcc5; }
.eg-sheet th.eg-dish { text-align: left; padding: 0 !important; }
.eg-sheet th.eg-dish span { display: flex; align-items: center; height: 2.6rem; padding: 0 .7rem; border-radius: 8px; background: var(--dish); color: #fff; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.eg-sheet td.today input.qty:not(:disabled) { box-shadow: inset 0 0 0 2px #b9dcc5; }
.eg-sheet td.past input.qty { opacity: .45; }
.eg-sheet tr.eg-dayfoot td { text-align: center; padding-top: .2rem; }
.eg-sheet tr.eg-dayfoot .lk-tag { display: inline-block; margin-bottom: .2rem; }
.eg-sheet tr.eg-dayfoot .eg-pill { margin: 0 auto; }
.eg-week .eg-totals { margin-top: .3rem; }
.eg-sheet th.eg-dish, .eg-sheet th.eg-dayhead { text-transform: none; letter-spacing: 0; }

/* Lapiņas tabula – skaidrāks izskats: katra ēdiena rinda viegli savā krāsā, šodienas kolonna izcelta */
.eg-sheet { border-spacing: 4px 5px; }
.eg-sheet td.qty-cell { background: color-mix(in srgb, var(--dish) 7%, #fff); border-radius: 10px; padding: .25rem !important; }
.eg-sheet td.qty-cell.today { background: color-mix(in srgb, var(--dish) 7%, #e3f2e7); box-shadow: inset 0 0 0 2px #9fd0b1; }
.eg-sheet input.qty { height: 2.5rem; border: 1px solid color-mix(in srgb, var(--dish) 22%, #fff); border-style: solid; background: #fff; box-shadow: none; }
.eg-sheet td.qty-cell:hover input.qty:not(:disabled) { border-color: var(--dish); background: color-mix(in srgb, var(--dish) 10%, #fff); }
.eg-sheet td.filled input.qty { border-color: var(--dish); background: var(--dish); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--dish) 35%, transparent); }
.eg-sheet td.na { background: none; }
.eg-sheet td.na input.qty { background: repeating-linear-gradient(135deg, #f5f6f7 0 5px, #eef0f2 5px 10px); border-color: transparent; }
.eg-sheet td.today input.qty:not(:disabled) { box-shadow: none; }
.eg-sheet td.changed input.qty { outline: 3px solid #f5b400; outline-offset: 1px; }
.eg-sheet td.removed input.qty { background: #fdecea; border: 1.5px dashed #e57373; outline: none; }
.eg-sheet td.removed input.qty::placeholder { color: #c62828; opacity: .7; text-decoration: line-through; font-weight: 700; font-size: 1.1rem; }
.eg-sheet th.eg-dish span { height: 2.5rem; }
.eg-sheet tr.eg-dayfoot td { background: none; }
.changed-sample.removed-sample { outline: 2px dashed #e57373; background: #fdecea; }

/* Lapiņa ierāmēta: rāmis ap visu tabulu, katra ēdiena rinda kā josla, dienas atdalītas */
.eg-frame { border: 2px solid #cfe3d5; border-radius: 16px; padding: .5rem .6rem .3rem; background: linear-gradient(180deg, #fbfdfb, #fff); box-shadow: inset 0 1px 0 #fff; }
.eg-sheet { border-spacing: 0 6px; }
.eg-sheet th.eg-dayhead { border-radius: 0; border-left: 2px solid #fff; }
.eg-sheet thead th.eg-dayhead:nth-child(2) { border-radius: 10px 0 0 10px; border-left: 0; }
.eg-sheet thead th.eg-dayhead:last-child { border-radius: 0 10px 10px 0; }
.eg-sheet th.eg-dish { padding-right: .4rem !important; }
.eg-sheet th.eg-dish span { border-radius: 10px; }
.eg-sheet td.qty-cell { border-radius: 0; border-top: 1px solid color-mix(in srgb, var(--dish) 28%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--dish) 28%, #fff);
  border-left: 1px dashed color-mix(in srgb, var(--dish) 22%, #fff); padding: .3rem !important; }
.eg-sheet tbody tr td.qty-cell:nth-child(2) { border-left: 1px solid color-mix(in srgb, var(--dish) 28%, #fff); border-radius: 10px 0 0 10px; }
.eg-sheet tbody tr td.qty-cell:last-child { border-right: 1px solid color-mix(in srgb, var(--dish) 28%, #fff); border-radius: 0 10px 10px 0; }
.eg-sheet td.qty-cell.today { box-shadow: inset 0 0 0 2px #9fd0b1; }
.eg-kw { background: #ffe14d; color: #3a3000; border: 1px solid #e6c400; font-size: 1rem; }
.eg-sheet-title { font-size: 1rem; }
.eg-sheet-title b { color: var(--primary-dark); margin-right: .3rem; }

/* Noslēgtas dienas korektūra */
.eg-sheet th.eg-dayhead i.lock { background: #fff3cd; color: #7a5c00; }
.eg-sheet th.eg-dayhead.unlocked { opacity: 1; background: linear-gradient(135deg, #b45309, #e48a2a) !important; }
.eg-sheet td.unlocked { box-shadow: inset 0 0 0 2px #f5b400; }
.eg-pill.eg-correct { border-color: #f5c48a; color: #92400e; background: #fff7ec; }
.eg-pill.eg-correct:disabled { opacity: 1; cursor: default; }
.lk-reason { display: block; font-style: normal; font-size: .78rem; color: #92400e; background: #fff1db; border-radius: 6px; padding: .1rem .4rem; margin-top: .2rem; }
.lk-quick { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr 1fr; }
@media (max-width: 1250px) { .lk-quick { grid-template-columns: 1fr 1fr 1fr; } }
.lk-q-btn.q-new { background: linear-gradient(135deg, #1f5f9e, #3a84c9); border: 0; color: #fff; }
.lk-q-btn.q-new small, .lk-q-btn.q-new b, .lk-q-btn.q-new span { color: #fff; }
.lk-quick { grid-template-columns: 1.6fr 1fr 1fr; }
@media (max-width: 800px) { .lk-quick { grid-template-columns: 1fr; } }

/* Bestellungen ansehen: klienta panelis labi redzams (zaļš kā klienta lapā) */
.lk-customer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-radius: 16px; padding: 1rem 1.4rem; box-shadow: 0 6px 20px rgba(20, 70, 40, .18); }
.lk-avatar { flex: none; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: #fff; color: var(--primary-dark); font-size: 1.4rem; font-weight: 800; }
.lk-customer .lk-who h2 { color: #fff; font-size: 1.5rem; }
.lk-customer .lk-who h2 small { color: rgba(255, 255, 255, .85); font-size: 1rem; }
.lk-nr { font-size: .85rem; font-weight: 600; background: rgba(255, 255, 255, .2); color: #fff; padding: .1rem .55rem; border-radius: 999px; }
.lk-status { font-size: .78rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: #fde2e1; color: #b42318; }
.lk-status.on { background: #e8f3ec; color: #1f6b40; }
.lk-addr { margin: .25rem 0 .4rem; font-size: 1.05rem; font-weight: 600; color: #fff; }
.lk-chips-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.lk-chip { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: .15rem .7rem; font-size: .88rem; color: #fff; }
.lk-open { background: #fff; color: var(--primary-dark); font-weight: 700; padding: .65rem 1.1rem; border-radius: 12px; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.lk-open:hover { color: var(--primary-dark); filter: brightness(.97); }
.lk-quick { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
@media (max-width: 1000px) { .lk-quick { grid-template-columns: 1fr 1fr; } }
.lk-q-btn.q-standing { background: linear-gradient(135deg, #0f766e, #14a39a); border: 0; color: #fff; }
.lk-q-btn.q-standing small, .lk-q-btn.q-standing b, .lk-q-btn.q-standing span { color: #fff; }
.lk-q-btn.q-standing.off { background: #fff; border: 2px dashed #8fcfc8; }
.lk-q-btn.q-standing.off small, .lk-q-btn.q-standing.off span { color: var(--muted); }
.lk-q-btn.q-standing.off b { color: #0f766e; }
.lk-chip.off { opacity: .75; }

/* Dauerauftrag plāns tālākajās nedēļās (vēl nav izveidots): skaitlis ar svītrotu rāmi */
.eg-sheet td.planned.filled input.qty { background: color-mix(in srgb, var(--dish) 55%, #fff); border-style: dashed; border-color: var(--dish); box-shadow: none; }

/* Dauerauftrag lapa */
.so-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-bottom: 1rem; padding: 1rem 1.3rem; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #0f766e, #14a39a); box-shadow: 0 6px 20px rgba(15, 118, 110, .2); }
.so-hero.paused { background: linear-gradient(135deg, #9a4a0a, #d97706); }
.so-hero.none { background: #fff; color: var(--text); border: 2px dashed #8fcfc8; box-shadow: none; }
.so-hero h2 { margin: 0 0 .2rem; color: inherit; font-size: 1.35rem; }
.so-hero p { margin: 0; opacity: .95; }
.so-hero-icon { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 14px; background: rgba(255, 255, 255, .2); }
.so-hero.none .so-hero-icon { background: #dff3f1; color: #0f766e; }
.so-hero-icon svg { width: 1.6rem; height: 1.6rem; }
.so-rules { margin: 0; padding: .6rem .9rem .6rem 1.8rem; background: rgba(255, 255, 255, .14); border-radius: 12px; font-size: .85rem; max-width: 26rem; }
.so-hero.none .so-rules { background: #f3faf9; }
.so-rules a { color: inherit; font-weight: 700; }
@media (max-width: 1000px) { .so-hero { grid-template-columns: auto 1fr; } .so-rules { grid-column: 1 / -1; max-width: none; } }
.so-dates { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: end; margin-bottom: 1rem; }
.so-dates label { margin: 0; display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .88rem; }
.so-dates input[type=date] { width: 11rem; }
.so-dates .so-active { flex-direction: row; align-items: center; gap: .4rem; font-size: 1rem; padding-bottom: .5rem; }
.so-dates .so-active input { width: 1.2rem; height: 1.2rem; }
.so-dates .so-notes { flex: 1; min-width: 14rem; }
.eg-kw.so-kw { background: #dff3f1; color: #0f766e; border-color: #8fcfc8; }
.eg-later { display: block; font-size: .68rem; }
.eg-standing-note { margin-bottom: .8rem; }

/* Neue Bestellung: nedēļas izvēle pirms ievades */
.nb-form h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: .3rem 0 .4rem; }
.nb-step { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: .95rem; }
.nb-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
@media (max-width: 900px) { .nb-weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nb-week { position: relative; display: flex; flex-direction: column; gap: .1rem; padding: .8rem 1rem; border: 2px solid var(--border); border-radius: 14px; cursor: pointer; background: #fff; margin: 0; }
.nb-week input { position: absolute; opacity: 0; }
.nb-week:hover { border-color: #9fd0b1; }
.nb-week:has(input:checked) { border-color: var(--primary); background: #eef8f1; box-shadow: 0 0 0 3px rgba(46, 125, 50, .18); }
.nb-kw { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.nb-dates { font-size: .85rem; color: var(--muted); }
.nb-state { font-size: .78rem; font-weight: 700; color: #1f6b40; }
.nb-week.taken .nb-state { color: #92400e; }
.nb-week.taken { background: #fffaf2; }
.nb-count { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.nb-n { margin: 0; cursor: pointer; }
.nb-n input { position: absolute; opacity: 0; }
.nb-n span { display: inline-block; padding: .55rem 1.1rem; border: 2px solid var(--border); border-radius: 999px; font-weight: 700; background: #fff; }
.nb-n:has(input:checked) span { border-color: var(--primary); background: var(--primary); color: #fff; }
.nb-actions { display: flex; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--border); padding-top: .9rem; }

/* Dauerauftrag: plāns skatīšanai, labošana pēc pogas */
.so-plan-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.so-plan-head h2 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: 1.2rem; }
.so-plan-head h2 svg { width: 1.2rem; height: 1.2rem; color: #0f766e; }
.so-plan-head .spacer { flex: 1; }
.so-plan .lk-row { grid-template-columns: 6rem 1fr 0 0; }
.so-edit-btn { background: linear-gradient(135deg, #0f766e, #14a39a); border: 0; }
.so-note { margin: .8rem 0 0; background: #fffbe6; border: 1px solid #f3e3a0; border-radius: 10px; padding: .5rem .8rem; }
.so-when { border: 2px solid #f5c48a; background: #fff7ec; }
.so-when h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.15rem; color: #92400e; }
.so-when .nb-step { background: #d97706; }
.so-when input[type=date] { width: 12rem; font-size: 1.1rem; }
.lk-open-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.nb-info { background: #e8f3ec; border: 1px solid #b9dcc5; color: #14532d; border-radius: 10px; padding: .6rem .9rem; margin: .2rem 0 .5rem; }
.nb-n.off span { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* Klienta izvēle: pēdējās ievades */
.pk-recent { margin-top: 1.2rem; text-align: left; }
.pk-recent h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; margin: 0 0 .5rem; }
.pk-recent h2 svg { width: 1.05rem; height: 1.05rem; }
.pk-row { display: grid; grid-template-columns: 3.4rem 1.3fr 1.5fr auto; gap: .8rem; align-items: center; padding: .55rem .4rem; border-bottom: 1px solid #eef0f3; color: inherit; text-decoration: none; border-radius: 8px; }
.pk-row:last-child { border-bottom: 0; }
.pk-row:hover { background: #f3faf5; color: inherit; }
.pk-row small { display: block; color: var(--muted); font-size: .78rem; }
.pk-time { text-align: center; }
.pk-time b { display: block; color: var(--primary-dark); }
.pk-user { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); background: #f1f5f2; border-radius: 999px; padding: .1rem .6rem; }
.pk-user svg { width: .9rem; height: .9rem; }
@media (max-width: 700px) { .pk-row { grid-template-columns: 3rem 1fr; } .pk-what, .pk-user { grid-column: 2; } }
.nb-step.nb-step-orange { background: #d97706; }
.nb-week.past { opacity: .65; }

/* Alle Bestellungen: summas */
.ol-day-sum { float: right; font-weight: 600; font-size: .82rem; color: var(--muted); }
tfoot tr.ol-total th { background: #e8f3ec; border-top: 2px solid var(--primary); font-size: .95rem; }
.ol-total-extra { font-weight: 500; color: var(--muted); }
.ol-summary { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; padding: .7rem; background: rgba(243, 246, 242, .96);
  border-top: 1px solid var(--border); backdrop-filter: blur(4px); z-index: 4; }
.ol-summary div { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; }
.ol-summary small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.ol-summary b { font-size: 1.3rem; color: var(--primary-dark); }
.ol-summary .main { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); border: 0; }
.ol-summary .main small, .ol-summary .main b { color: #fff; }
@media (max-width: 800px) { .ol-summary { grid-template-columns: 1fr 1fr; } }

/* Alle Bestellungen – jauns izskats */
.ol-hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.cl-new.ol-change { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, .5); }
.cl-new.ol-change:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.ol-dates { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.ol-dates label { display: flex; align-items: center; gap: .35rem; margin: 0; font-weight: 600; font-size: .88rem; color: var(--muted); }
.ol-dates input[type=date] { width: 10rem; margin: 0; padding: .35rem .5rem; }
.ol-quick { display: flex; gap: .35rem; flex-wrap: wrap; }
.ol-quick .cl-chip { text-decoration: none; color: inherit; }
.ol-quick .cl-chip.on { color: #fff; }
.ol-dates .spacer, .cl-filter .cl-chips .spacer { flex: 1; }
.ol-search { min-width: 18rem; }
.ol-search input { font-size: 1rem; padding: .5rem .8rem; }
.ol-dishes { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.ol-dishes .lk-item { flex: none; }
.ol-card { padding: .4rem .8rem; }
.ol-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ol-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: none; border-bottom: 2px solid #e6ece8; }
.ol-table td { vertical-align: middle; border-bottom: 1px solid #eef0f3; }
.ol-table tbody tr[data-href] { cursor: pointer; }
.ol-table tbody tr[data-href]:hover td { background: #f3faf5; }
.ol-table tr.inactive td { opacity: .55; }
.ol-table tr.group-row th { background: linear-gradient(90deg, #e8f3ec, #f6faf7); color: var(--primary-dark); font-size: .9rem; text-transform: none; letter-spacing: 0; padding: .55rem .7rem; border-radius: 10px 10px 0 0; border-bottom: 0; }
.ol-date { white-space: nowrap; color: var(--muted); font-weight: 600; }
.ol-name { color: inherit; text-decoration: none; }
.ol-name:hover b { color: var(--primary-dark); text-decoration: underline; }
.ol-table td small { display: block; font-size: .75rem; }
.ol-items { display: flex; flex-wrap: wrap; gap: .25rem; }
.ol-items .lk-item { flex: none; font-size: .82rem; padding: .1rem .55rem .1rem .15rem; }
.ol-items .lk-item b { min-width: 1.35rem; height: 1.35rem; font-size: .78rem; }
.ol-table .lk-tag.single { background: #eef1f4; color: #4b5563; }
.ol-table td svg { width: .95rem; height: .95rem; }
.ol-cash { display: inline-block; white-space: nowrap; font-size: .78rem; padding: .15rem .55rem; border-radius: 8px; background: #fff7db; color: #7a5c00; border: 1px solid #f3dc8a; }
.ol-cash.done { background: #e8f3ec; color: #1f6b40; border-color: #b9dcc5; }
.ol-cash.open { background: #fdecea; color: #b42318; border-color: #f2c4c0; }

/* Quittungen – pārskats */
.qo-kw { font-size: 1.3rem; color: var(--primary-dark); }
.qo-state { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: #fff7db; color: #7a5c00; }
.qo-state.s-kassiert, .qo-state.s-abgegeben { background: #e8f3ec; color: #1f6b40; }
.qo-state.s-nicht-kassiert { background: #fdecea; color: #b42318; }
.qo-red { color: #b42318 !important; }

/* Telefons: izvēlne aiz ☰ pogas, grupas atveras ar pieskārienu (lapas saturs uzreiz redzams) */
.menu-toggle, .mobile-scan, .menu-mobile-only { display: none; }
@media (max-width: 800px) {
  .topbar { gap: .5rem; padding: .55rem .9rem; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { flex: 1; font-size: 1.05rem; }
  .menu-toggle, .mobile-scan { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px;
    background: rgba(255, 255, 255, .14); color: #fff; border: 0; font-size: 1.35rem; padding: 0; text-decoration: none; }
  .topbar nav.menu, .topbar .topbar-search, .topbar .user-menu { display: none; }
  .topbar.open nav.menu { display: flex; flex-direction: column; align-items: stretch; gap: .15rem; flex: 0 0 100%; width: 100%; order: 10; max-height: 75vh; overflow-y: auto; padding-top: .4rem; }
  .topbar.open .topbar-search { display: block; flex: 0 0 100%; width: 100%; order: 9; font-size: 1rem; padding: .6rem .8rem; }
  .topbar.open .user-menu { display: block; flex: 0 0 100%; width: 100%; order: 11; }
  .menu > a, .menu-group > span { display: block; padding: .7rem .8rem; font-size: 1.05rem; }
  .menu-mobile-only { display: block; }
  .menu-scan { background: rgba(255, 255, 255, .16); border-radius: 10px; }
  .menu-items { position: static; box-shadow: none; border: 0; border-radius: 10px; margin: .1rem 0 .4rem; min-width: 0; }
  .menu-group:hover .menu-items { display: none; }
  .menu-group:focus-within .menu-items { display: block; }
  .menu-items a { padding: .65rem 1rem; font-size: 1rem; }
  main { padding-left: .8rem; padding-right: .8rem; }
  .dl-hero { padding: .9rem 1rem; flex-wrap: wrap; }
  .dl-hero h1 { font-size: 1.35rem; }
  .scan-drop > p:first-of-type, .scan-drop > p.small { display: none; }
}
@media (max-width: 800px) { .topbar.open nav.menu { flex-wrap: nowrap; } .topbar.open .menu-group, .topbar.open .menu > a { width: 100%; } .topbar.open .menu-items { width: 100%; } }
@media (max-width: 800px) { .topbar.open .topbar-search { max-width: none; box-sizing: border-box; } }
@media (max-width: 800px) { .home-hero-top { display: none; } }

/* Šofera lapa: zetteļu fotografēšana */
.drv-page { max-width: 640px; margin: 0 auto; }
.drv-hero { margin-bottom: 1rem; }
.drv-camera { text-align: center; padding: 1.4rem 1rem; }
.drv-camera .scan-camera-button { display: inline-block; width: 100%; font-size: 1.3rem; padding: 1.2rem; }
.drv-camera.scan-camera { display: block; }
.drv-drop { text-align: center; padding: .8rem; }
.drv-h2 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
@media (max-width: 800px) { .drv-menu { display: flex !important; flex: 0 0 auto !important; width: auto !important; order: 0 !important; flex-direction: row !important; } }

/* Bestellungen ansehen: zettelis blakus nedēļai */
.lk-body.with-scan { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .lk-body.with-scan { grid-template-columns: 1fr; } }
.lk-scan { border: 1px solid #e3e8e5; border-radius: 12px; padding: .6rem; background: #fafbfa; position: sticky; top: 1rem; }
.lk-scan-head { font-weight: 700; margin-bottom: .4rem; }
.lk-scan img { display: block; width: 100%; border-radius: 8px; border: 1px solid #e3e8e5; background: #fff; }
.lk-scan small { display: block; margin: .3rem 0 .6rem; font-size: .75rem; }
.drv-logout { text-align: center; margin: 1.5rem 0; }

/* Zettel scannen: bildīte sarakstā uzreiz redzama */
.scan-list-thumb { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.scan-list-thumb img { width: 110px; height: 80px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--border); background: #fff; transition: transform .15s; }
.scan-list-thumb:hover img { transform: scale(1.04); box-shadow: 0 6px 16px rgba(0, 0, 0, .15); }
#scan-table td { vertical-align: middle; }
.eg-sheet td.unsure input.qty { box-shadow: 0 0 0 3px #f5b400; }
.scan-week .eg-frame { margin-top: .4rem; }
.eg-sheet tr.eg-dayfoot td.small { font-size: .7rem; line-height: 1.2; word-break: break-word; }

/* Zettel prüfen: pārslēgt apgriezto / oriģinālo bildi */
.scan-swap { display: inline; margin-left: .6rem; }

/* Lapa nav atrasta (404) */
.nf-hero { margin-bottom: 1rem; }
.nf-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Kamera lapā: daudz zetteļu pēc kārtas */
body.cam-open { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; flex-direction: column; }
.cam[hidden] { display: none; }
.cam video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.cam-frame { position: absolute; inset: 8% 5% 150px; border: 3px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; }
.cam.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: cam-flash .35s ease-out forwards; pointer-events: none; }
@keyframes cam-flash { from { opacity: .85; } to { opacity: 0; } }
.cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; padding: .9rem 1rem 1.2rem; background: rgba(0,0,0,.85); }
.cam-thumbs { display: flex; gap: .3rem; overflow: hidden; min-width: 0; }
.cam-thumbs img { height: 56px; width: auto; border-radius: 4px; border: 2px solid #fff; flex: none; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 6px solid #9ccfb0; box-shadow: 0 0 0 3px #fff; padding: 0; }
.cam-shutter:active { transform: scale(.92); background: #e8f3ec; }
.cam-done { justify-self: end; background: #2e7d4f; color: #fff; border: 0; border-radius: 12px; font-size: 1.1rem; font-weight: 700; padding: .6rem 1rem; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cam-done small { font-weight: 400; font-size: .8rem; }
.cam-hint { position: absolute; top: .6rem; left: 0; right: 0; margin: 0 auto; max-width: 90%; text-align: center; color: #fff; font-size: .9rem; background: rgba(0,0,0,.45); border-radius: 8px; padding: .3rem .6rem; }

/* Zettel prüfen: visa ekrāna platums, bilde lielāka (aizņem brīvo vietu) */
.scan-review-page .scan-layout { display: block; }
/* Zettel un ievades tabula blakus, vienā augstumā un lielumā */
.scan-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(620px, 1fr); gap: 1rem; align-items: stretch; }
.scan-pair .scan-image { position: relative; top: 0; display: flex; flex-direction: column; max-height: none; overflow: hidden; padding: .6rem; }
.scan-pair .scan-image .toolbar { margin: 0 0 .4rem; }
.scan-img-box { position: relative; flex: 1; min-height: 320px; }
.scan-pair .scan-img-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.scan-pair.zoomed { grid-template-columns: 1fr; }
.scan-pair.zoomed .scan-img-box img, .scan-pair.zoomed .scan-img-box { position: static; height: auto; min-height: 0; }
.scan-weeks .scan-week:first-child { margin-top: 0; }
@media (max-width: 1100px) {
  .scan-pair { grid-template-columns: 1fr; }
  .scan-pair .scan-img-box, .scan-pair .scan-img-box img { position: static; height: auto; min-height: 0; }
}
.scan-pair > *, .scan-pair .scan-weeks > .scan-week:first-child { margin-top: 0; }

/* Zettel prüfen: vesela lapiņa, ievades tabulas rindas izmērītas pēc lapiņas rindām */
.scan-pair.aligned .scan-img-box { flex: none; min-height: 0; }
.scan-pair.aligned .scan-img-box img { position: static; height: auto; }
.eg-sheet.eg-fit th.eg-dayhead { padding-top: 0; padding-bottom: 0; }
.eg-sheet.eg-fit td.qty-cell { padding-top: 0 !important; padding-bottom: 0 !important; vertical-align: middle; }
.eg-sheet.eg-fit input.qty, .eg-sheet.eg-fit th.eg-dish span { height: var(--eg-h, 2.5rem); min-height: 0; padding-top: 0; padding-bottom: 0; }

/* Zettel prüfen: klients – viens ieteikums ar Ja/Nein, citādi meklēšana */
.sc-cust { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; border: 2px solid var(--border); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; }
.sc-cust[hidden] { display: none; }
.sc-cust > div { flex: 1; min-width: 14rem; display: flex; flex-direction: column; gap: .1rem; }
.sc-cust strong { font-size: 1.1rem; }
.sc-question { border-color: #f5b400; background: #fffbea; }
.sc-chosen { border-color: var(--primary); background: #edf6ef; }
.sc-check { width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.sc-search { position: relative; max-width: 34rem; margin-bottom: .6rem; }
.sc-search[hidden] { display: none; }
.sc-search input { width: 100%; font-size: 1.05rem; }
.sc-results { position: absolute; left: 0; right: 0; z-index: 20; }

/* Bestellung eingeben/ändern – klienta izvēle tikpat plata kā „Bestellungen ansehen” */
.pick-page.cl-page { max-width: 1350px; margin: 0 auto; text-align: left; }
.pick-page .lk-search-box input { width: 100%; }
.pick-page .pick-links { justify-content: flex-start; }
.pick-page .lk-search-box .search-wrap { display: block; width: 100%; }

/* Zettel scannen / prüfen – tāds pats dizains kā citās lapās */
.sl-page .dl-card { margin-bottom: 1rem; }
.sl-page .scan-drop { border: 2px dashed #9fd0b1; background: linear-gradient(180deg, #fbfdfb, #fff); padding: 1.6rem 1rem; }
.sl-page .scan-drop.over { border-color: var(--primary); background: #edf6ef; }
.sl-drop-icon { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: #e8f3ec; color: var(--primary-dark); margin-bottom: .3rem; }
.sl-drop-icon svg { width: 1.6rem; height: 1.6rem; }
.sl-h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.1rem; margin: 0 0 .6rem; }
.sl-page .scan-send { margin: .6rem 0 0; }
.sl-page .scan-list-thumb img { border-radius: 6px; box-shadow: 0 0 0 1px #d9e2dc; }
.sr-hero { margin-bottom: 1rem; }
.sr-pos { opacity: .75; font-weight: 600; }
.sr-kind { display: inline-block; background: rgba(255,255,255,.2); border-radius: 999px; padding: 0 .6rem; margin-left: .3rem; font-weight: 700; }

/* Daueraufträge – saraksts */
.so-search { margin-bottom: .6rem; }
.so-search input { width: 100%; font-size: 1.1rem; padding-top: .7rem; padding-bottom: .7rem; }
.so-table td.so-day { vertical-align: top; }
.so-table td.so-day .lk-item { display: flex; margin: 0 0 .2rem; font-size: .78rem; white-space: nowrap; }
.so-table tr.inactive td { opacity: .55; }
.so-state { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: #fff7db; color: #7a5c00; white-space: nowrap; }
.so-state.on { background: #e8f3ec; color: #1f6b40; }
.so-state.off { background: #eef0f2; color: #5c6670; }

/* Zettel prüfen: augšējais panelis – gelesen → Kunde im System */
.sc-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.sc-read, .sc-system { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.sc-read { background: #f6f8f7; border-radius: 12px; padding: .8rem 1rem; }
.sc-read strong { font-size: 1.25rem; }
.sc-note { font-size: .82rem; color: #7a5c00; background: #fff7db; border-radius: 8px; padding: .25rem .5rem; margin-top: .3rem; }
.sc-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sc-arrow { align-self: center; font-size: 1.6rem; color: #9fd0b1; font-weight: 700; }
.sc-system .sc-cust { margin: .2rem 0 0; }
.sc-system .sc-search { max-width: none; margin: .2rem 0 0; }
.scan-weeks .actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.sc-addweek { font-size: .85rem; }
@media (max-width: 900px) { .sc-panel { grid-template-columns: 1fr; } .sc-arrow { display: none; } }

/* Alle Bestellungen: 📄 zettelis virs lapas */
.ol-zettel { margin-right: .3rem; }
.zettel-box { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.75); display: grid; place-items: center; padding: 2rem; cursor: zoom-out; }
.zettel-box[hidden] { display: none; }
.zettel-box img { max-width: calc(100vw - 4rem); max-height: calc(100vh - 4rem); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.zettel-close { position: absolute; top: 1rem; right: 1rem; background: #fff; border: 0; border-radius: 50%; width: 2.6rem; height: 2.6rem; font-size: 1.2rem; cursor: pointer; }

/* Zettel prüfen: soļi 1 klients → 2 nedēļa → 3 režģis; lielas pogas apakšā */
.sc-steps { display: flex; gap: .5rem; list-style: none; margin: 0 0 .8rem; padding: 0; flex-wrap: wrap; }
.sc-steps li { display: flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px; background: #eef0f2; color: var(--muted); font-weight: 600; }
.sc-steps li b { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; color: var(--muted); }
.sc-steps li.now { background: #fff7db; color: #7a5c00; box-shadow: 0 0 0 2px #f5b400; }
.sc-steps li.now b { background: #f5b400; color: #fff; }
.sc-steps li.done { background: #e8f3ec; color: #1f6b40; }
.sc-steps li.done b { background: var(--primary); color: #fff; font-size: 0; }
.sc-steps li.done b::after { content: "✓"; font-size: .9rem; }
.sc-weekq, .sc-lockmsg { display: none; align-items: center; gap: .8rem; flex-wrap: wrap; border: 2px solid #f5b400; background: #fffbea; border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0 .6rem; }
.sc-weekq b { display: block; font-size: 1.1rem; }
.lock-week .sc-weekq { display: flex; }
.lock-customer .sc-lockmsg { display: flex; font-weight: 600; color: #7a5c00; }
.lock-customer .eg-frame, .lock-week .eg-frame { opacity: .35; pointer-events: none; filter: grayscale(.6); }
.lock-customer .scan-week .toolbar { opacity: .5; pointer-events: none; }
.sc-bar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: .8rem; margin: 1rem -1rem 0; padding: .8rem 1rem;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
.sc-bar .button { font-size: 1.05rem; padding: .75rem 1.3rem; border-radius: 12px; }
.sc-bar .sc-save { font-size: 1.2rem; padding: .85rem 2rem; }
.sc-bar .sc-save:disabled { opacity: .45; cursor: not-allowed; }
.sc-bar-hint { color: #7a5c00; font-weight: 600; }
.sc-bar .spacer { flex: 1; }

/* Zettel prüfen: nedēļa – jautājums / apstiprināta / labošana */
.sc-weekok { display: none; align-items: center; gap: .7rem; flex-wrap: wrap; border: 2px solid var(--primary); background: #edf6ef; border-radius: 10px; padding: .45rem .8rem; margin: .4rem 0 .6rem; }
.scan-weeks:not(.lock-customer):not(.lock-week) .sc-weekok { display: flex; }
.sc-weekok .sc-check { width: 1.6rem; height: 1.6rem; font-size: .85rem; }
.sc-kwedit { display: none; align-items: center; gap: .5rem; flex-wrap: wrap; background: #fff; border: 2px dashed #f5b400; border-radius: 10px; padding: .5rem .8rem; margin: 0 0 .6rem; }
.editing-week .sc-kwedit { display: flex; }
.lock-customer .sc-kwedit { display: none; }
.sc-blockhead { font-size: 1rem; margin: .8rem 0 .3rem; }

/* Zettel prüfen: panelis skaistāks; nedēļu skaits */
.sc-panel { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding: 1rem; }
.sc-read, .sc-system { border-radius: 14px; padding: .9rem 1.1rem; }
.sc-read { background: linear-gradient(180deg, #fbfaf3, #f4f2e6); border: 1px solid #e6e1c8; }
.sc-system { background: #fff; border: 1px solid var(--border); }
.sc-read strong { font-size: 1.5rem; line-height: 1.2; }
.sc-addr { color: var(--muted); }
.sc-meta { margin-top: .2rem; font-size: .85rem; font-weight: 600; color: #5c6670; }
.sc-arrow { font-size: 2rem; }
.sc-system .sc-cust { border-width: 2px; padding: .8rem 1rem; }
.sc-system .sc-cust strong { font-size: 1.3rem; }
.sc-system .sc-cust .button { font-size: 1.05rem; padding: .6rem 1.2rem; }
.sc-weekq { flex-direction: column; align-items: stretch; gap: .6rem; }
.sc-wcount, .sc-wq { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sc-wq b { display: block; font-size: 1.1rem; }
.sc-wchip { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid #e6d18a; background: #fff; font-weight: 800; font-size: 1.05rem; color: #7a5c00; cursor: pointer; padding: 0; }
.sc-wchip.on { background: #f5b400; border-color: #f5b400; color: #fff; }

/* Zettel prüfen: nedēļu skaits tikai labošanas režīmā; galvenā poga plata, vienmēr tajā pašā vietā */
.sc-weekq .sc-wcount { display: none; }
.editing-week .sc-weekq .sc-wcount { display: flex; }
.sc-bar .sc-save { min-width: 22rem; justify-content: center; text-align: center; }
.sc-bar-hint { color: var(--muted); font-weight: 600; }

/* Zettel prüfen: klients un nedēļa labajā kolonnā virs tabulas; visas pogas apakšējā joslā */
.sc-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.sc-readline { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; background: linear-gradient(180deg, #fbfaf3, #f4f2e6); border: 1px solid #e6e1c8; border-radius: 12px; padding: .5rem .8rem; }
.sc-readline b { font-size: 1.15rem; }
.sc-head .sc-cust { margin: 0; padding: .6rem .9rem; border-width: 2px; }
.sc-head .sc-cust strong { font-size: 1.2rem; }
.sc-head .sc-cust .sc-label { display: block; }
.sc-qmark { width: 2rem; height: 2rem; border-radius: 50%; background: #f5b400; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.sc-head .sc-search { max-width: none; margin: 0; display: flex; flex-direction: column; gap: .2rem; }
.sc-head .sc-search[hidden] { display: none; }
.sc-weekq .sc-wq { display: block; }
.sc-bar #sc-change-customer, .sc-bar #sc-change-week { font-size: .95rem; }
.sc-bar button:disabled { opacity: .45; cursor: not-allowed; }
.sc-bar .button, .sc-bar-hint { white-space: nowrap; }

.sc-warn { border: 2px solid #f5b400; background: #fffbea; color: #6b5200; border-radius: 10px; padding: .5rem .8rem; margin: .5rem 0; font-weight: 600; }
.sc-warn.red { border-color: #e57373; background: #fdecea; color: #8c1d18; }

/* Menü-Nummer vai daudzums */
.sc-menunum { display: flex; flex-direction: column; gap: .5rem; border-color: #f08a24; background: #fff4e8; color: #6b3a00; }
.sc-menunum[hidden] { display: none; }
.sc-menunum-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.eg-sheet td.menu-num input.qty { box-shadow: 0 0 0 3px #f08a24 !important; }

/* Wochenkontrolle – saraksts un pārbaude pa vienam klientam */
.wc-progress { margin-top: .5rem; max-width: 26rem; background: rgba(255,255,255,.25); }
.wc-progress span { background: #fff; }
.wc-hero-warn { background: rgba(245,180,0,.25); border-radius: 999px; padding: 0 .6rem; }
.wc-search { flex: 1; min-width: 16rem; margin-left: .8rem; }
.wc-search input { width: 100%; font-size: 1.05rem; padding-top: .6rem; padding-bottom: .6rem; }
.wc-hint { text-align: center; padding: 2rem 1rem; font-size: 1.05rem; }
.wc-list tr.wc-row { cursor: pointer; }
.wc-list tr.checked td { opacity: .6; }
.wc-list td.wc-cell { font-size: .8rem; }
.wc-list td.wc-cell.auto { color: var(--muted); }
.wc-list td.wc-cell.diff { background: #fff4e8; box-shadow: inset 0 0 0 2px #f08a24; }
.wcc-hero { margin-bottom: 1rem; }
.wcc-done { background: #fff; color: var(--primary-dark); border-radius: 999px; padding: .35rem .9rem; font-weight: 700; }
.wcc-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .wcc-pair { grid-template-columns: 1fr; } }
.wcc-sheet td.qty-cell { height: 2.6rem; vertical-align: middle; }
.wcc-qty { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.1rem; border-radius: 8px; font-weight: 800; font-size: 1.05rem; }
.wcc-sheet td.filled .wcc-qty { background: var(--dish); color: #fff; }
.wcc-sheet td.wcc-diff { box-shadow: inset 0 0 0 3px #f08a24; background: #fff4e8; }
.wcc-zv { display: block; font-size: .7rem; font-weight: 700; color: #a85a00; }
.wcc-img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px #d9e2dc; display: block; margin-bottom: .3rem; }
.wcc-nosource { display: flex; flex-direction: column; gap: .3rem; background: #f6f8f7; border-radius: 12px; padding: 1rem; }
.wcc-h3 { font-size: .95rem; margin: 1rem 0 .3rem; }
.wcc-change { font-size: .85rem; padding: .2rem 0; border-bottom: 1px dashed var(--border); }
.wcc-bar .button.disabled { opacity: .4; pointer-events: none; }
.wcc-bar { position: sticky; }
button.cl-chip { background: #fff; color: var(--text, #1f2a24); border: 1px solid var(--border); font: inherit; font-size: .85rem; cursor: pointer; }

/* Wochenkontrolle saraksts: rinda atveras turpat */
.wc-list tr.wc-row.open td { background: #e8f3ec; }
.wc-list tr.wc-detail > td { background: #f6f8f7; padding: 1rem !important; }
.wc-detail .wcc-pair { margin: 0; }
.wc-detail-bar { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.wc-detail-bar .sc-save { font-size: 1.15rem; padding: .8rem 1.8rem; }
.wc-loading { padding: 2rem; text-align: center; color: var(--muted); }
.wc-tick { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 2px solid var(--border); background: #fff; color: #c6cfca; font-weight: 800; cursor: pointer; padding: 0; }
.wc-tick:hover { border-color: var(--primary); color: var(--primary); }
.wc-tick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.wc-detail-bar { position: sticky; bottom: 0; z-index: 5; background: #f6f8f7; padding-bottom: .4rem; }

.wc-open-card .group-row th { background: #e8f3ec; color: var(--primary-dark); font-size: .9rem; }
.wc-allgood { text-align: center; font-size: 1.2rem; padding: 1.5rem; }
.qo-state.wc-none { background: #eef0f2; color: #5c6670; }

/* Bloķēts, kamēr nav pārbaudīts */
.cb-block { border: 2px solid #e57373; background: #fdecea; color: #8c1d18; border-radius: 12px; padding: .8rem 1rem; margin: .6rem 0; }
.cb-head { font-size: 1.05rem; }
.cb-names { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin: .4rem 0 .6rem; }
.cb-names a { color: #8c1d18; font-weight: 600; }
.cb-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cb-release { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.cb-release input { min-width: 16rem; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* Zettelis tikai daļai nedēļas */
.sc-span { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .9rem; margin: .2rem 0 .5rem; color: #5c6670; }
.sc-span select { padding: .2rem .4rem; }
.sc-span.partial { background: #e8f1fb; border: 2px solid #8bb5e6; border-radius: 10px; padding: .4rem .7rem; color: #1d4f86; font-weight: 600; }
.eg-sheet th.eg-dayhead.outside { opacity: .35; }

/* Bestellung ändern: visi tās nedēļas zetteļi */
.en-scans { display: flex; flex-direction: column; gap: .4rem; background: #fbfaf3; border: 1px solid #e6e1c8; border-radius: 12px; padding: .6rem .8rem; margin: .6rem 0; }
.en-scans-title { font-weight: 700; display: flex; align-items: center; gap: .3rem; }
.en-scans-list { display: flex; gap: .6rem; flex-wrap: wrap; }
.en-scans-list a { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-decoration: none; color: var(--muted); font-size: .75rem; }
.en-scans-list img { height: 110px; width: auto; border-radius: 6px; box-shadow: 0 0 0 1px #d9e2dc; background: #fff; }
.en-scans-list a:hover img { box-shadow: 0 0 0 3px var(--primary); }

.wcc-nodoc { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; border: 2px solid #e57373; background: #fdecea; color: #8c1d18; border-radius: 12px; padding: 1rem; }
.wcc-nodoc .button input { display: none; }

/* Otrs zettelis tai pašai nedēļai */
.sc-dup { display: flex; flex-direction: column; gap: .5rem; border: 2px solid #8bb5e6; background: #e8f1fb; color: #1d4f86; border-radius: 12px; padding: .7rem .9rem; margin: .3rem 0 .6rem; }
.sc-dup:not(.chosen) { border-color: #f5b400; background: #fffbea; color: #6b5200; }
.sc-dup-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.sc-span select { width: auto; flex: none; }

.lk-delete { margin: 0; }
.lk-delete .button.danger { background: #fff; color: #b42318; border: 2px solid #e57373; }
.lk-delete .button.danger:hover { background: #fdecea; }

.eg-pill.eg-del { color: #b42318; border-color: #e57373; }
.eg-pill.eg-del:hover { background: #fdecea; }
