/* Food safety log (logbook-view.js) and its dashboard card. Light rules first, dark appearance at the end. */
.lb-top{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:start;margin-bottom:26px}
.lb-section{margin-bottom:26px}
.lb-section>.section-label{margin-bottom:10px}
.lb-hint{font-size:14px;line-height:1.45;color:var(--ios-label2);margin:10px 2px 0}

/* Today */
.lb-today{background:var(--ios-card);border-radius:var(--ios-r);padding:18px 18px 8px;box-shadow:0 1px 2px #14201908}
.lb-today.warn{box-shadow:inset 0 0 0 2px #e9b469,0 1px 2px #14201908}
.lb-today-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:4px}
.lb-today-head h2{font-size:22px;font-weight:700;letter-spacing:-.02em}
.lb-checks{list-style:none;margin:0;padding:0}
.lb-check{display:flex;align-items:center;gap:12px;padding:11px 0;border-top:.5px solid var(--ios-sep);min-height:60px}
.lb-check:first-child{border-top:0}
.lb-check>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.lb-check strong{font-size:16px;font-weight:600;overflow-wrap:anywhere}
.lb-check small{font-size:13px;color:var(--ios-label2);font-variant-numeric:tabular-nums}
.lb-check.warn small{color:var(--ios-warn);font-weight:600}
.lb-tick{width:28px;height:28px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;border:2px solid #cfd3ca}
.lb-tick svg{width:16px;height:16px;stroke-width:2.6}
.lb-check.done .lb-tick{background:var(--ios-green);border-color:var(--ios-green);color:#fff}
.lb-check.warn .lb-tick{background:#e39a2d;border-color:#e39a2d;color:#fff}
.lb-check .button.small{flex-shrink:0;min-height:44px}
.lb-again{width:44px;height:44px;border-radius:22px;flex-shrink:0;display:grid;place-items:center;background:var(--ios-fill);color:var(--deep)}
.lb-again svg{width:18px;height:18px;stroke-width:2.2}

/* Quick add */
.lb-quick{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:10px}
.lb-quick-btn{display:flex;flex-direction:column;align-items:flex-start;gap:10px;background:var(--ios-card);border-radius:16px;padding:14px;min-height:88px;font-size:14px;font-weight:600;color:var(--ink);text-align:left;box-shadow:0 1px 2px #14201908;transition:transform .14s}
.lb-quick-btn:disabled{opacity:.45}
@media(hover:none){.lb-quick-btn:active,.lb-entry:active,.lb-eq:active,.safety-card:active,.lb-again:active{transform:scale(.97);opacity:.85}}
.lb-glyph{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex-shrink:0;background:#e6efe0;color:#2c5a3a}
.lb-glyph svg{width:20px;height:20px}
.lb-glyph.cleaning{background:#e1edf5;color:#2b5878}
.lb-glyph.pasteurisation{background:#f8e6da;color:#8a3f17}
.lb-glyph.batch{background:#ece7f5;color:#4f3c7a}
.lb-glyph.delivery{background:#f3efd9;color:#6a5a14}

/* Records by day */
.lb-day{margin-bottom:16px}
.lb-day h3{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--ios-label2);margin:0 4px 6px}
.lb-day h3 span{text-transform:none;letter-spacing:0;font-weight:500}
.lb-list{list-style:none;margin:0;padding:0;background:var(--ios-card);border-radius:var(--ios-r);overflow:hidden;box-shadow:0 1px 2px #14201908}
.lb-list>li+li{border-top:.5px solid var(--ios-sep)}
.lb-entry,.lb-eq{display:flex;gap:12px;align-items:flex-start;width:100%;text-align:left;padding:13px 16px;min-height:60px;background:none;color:var(--ink);transition:transform .14s}
.lb-eq{align-items:center}
.lb-entry.warn{background:var(--amber-bg,#fbf1df);box-shadow:inset 4px 0 0 #e39a2d}
.lb-entry-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.lb-entry-top{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.lb-entry-top strong,.lb-eq strong{font-size:16px;font-weight:600;overflow-wrap:anywhere;min-width:0}
.lb-value{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}
.lb-entry small,.lb-eq small{font-size:13px;color:var(--ios-label2);line-height:1.4}
.lb-entry .badge{align-self:flex-start;margin-top:3px}
.lb-action{font-size:14px;line-height:1.45;color:var(--ios-warn);overflow-wrap:anywhere}
.lb-action b{font-weight:700}
.lb-note{font-size:13px;line-height:1.45;color:var(--ios-label2);font-style:italic;overflow-wrap:anywhere}
.lb-chev{width:16px;height:16px;color:#a5aaa1;flex-shrink:0}.lb-chev svg{width:16px;height:16px}
.lb-more{margin-top:4px}

/* Equipment */
.lb-eq-foot{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-top:12px}
.lb-unit-pick{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--ios-label2)}
.lb-seg{display:inline-flex;background:var(--ios-fill);border-radius:12px;padding:3px;gap:2px}
.lb-seg button,.lb-seg label span{min-width:58px;min-height:40px;padding:0 14px;border-radius:10px;font-size:15px;font-weight:600;color:var(--ink);display:grid;place-items:center;cursor:pointer}
.lb-seg button[aria-pressed=true],.lb-seg input:checked+span{background:var(--ios-card);box-shadow:0 1px 3px #14201924}
.lb-seg label{position:relative;flex:1;display:flex}
.lb-seg label span{flex:1}
.lb-seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;min-height:0}
.lb-seg input:focus-visible+span{outline:2px solid var(--green);outline-offset:1px}

/* First run */
.lb-empty{background:var(--ios-card);border-radius:var(--ios-r);padding:28px 24px;display:flex;flex-direction:column;align-items:flex-start;gap:12px;max-width:620px;box-shadow:0 1px 2px #14201908}
.lb-empty-icon{width:52px;height:52px;border-radius:16px;background:var(--deep);color:#d9efa8;display:grid;place-items:center}
.lb-empty-icon svg{width:28px;height:28px}
.lb-empty h2{font-size:22px;font-weight:700;letter-spacing:-.02em}
.lb-empty p{font-size:15px;line-height:1.5;color:var(--ios-label2)}
.lb-empty .button{min-height:50px;gap:8px}.lb-empty .button svg{width:18px;height:18px}

/* Inspector report */
.lb-report-card{background:var(--ios-card);border-radius:var(--ios-r);padding:16px 18px;display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between;box-shadow:0 1px 2px #14201908}
.lb-range{display:grid;grid-template-columns:1fr 1fr;gap:12px;flex:1 1 300px}
.lb-range .field{margin:0}.lb-range input{width:100%;min-height:44px}
.lb-report-buttons{display:flex;gap:8px;flex-wrap:wrap}
.lb-report-buttons .button{min-height:44px}
#print-report tr.off td{background:#fff3df}
#print-report .report-sign{margin-top:28px;font-size:12px}

/* Forms */
#lb-form textarea{width:100%;resize:vertical;font:inherit;padding:10px 12px;line-height:1.4}
.lb-fieldset{border:0;padding:0;margin:0 0 17px;min-width:0}
.lb-fieldset legend{font-size:14px;font-weight:600;margin-bottom:8px;padding:0}
.lb-yesno{display:flex;width:100%}
.lb-yesno label span{min-height:44px}
.lb-alert{display:flex;gap:10px;align-items:flex-start;background:var(--ios-warn-bg);color:var(--ios-warn);border-radius:14px;padding:12px 14px;margin-bottom:16px;font-size:14px;line-height:1.45;font-weight:600}
.lb-alert[hidden]{display:none}
.lb-alert svg{width:20px;height:20px;flex-shrink:0}
.lb-action-field.required>span::after{content:" *";color:var(--danger)}
.lb-action-field.required textarea{border-color:#e39a2d;background:#fffaf2}
#lb-form .field-grid>.field,#lb-equipment-form .field-grid>.field{min-width:0}
#lb-form input,#lb-form select,#lb-equipment-form input,#lb-equipment-form select{width:100%}

/* Dashboard card */
.safety-card{grid-column:1/-1;display:flex;align-items:center;gap:14px;text-align:left;background:var(--ios-card);color:var(--ink);border-radius:var(--ios-r);padding:14px 18px;min-height:64px;box-shadow:0 1px 2px #14201908;transition:transform .14s}
.safety-card .review-icon{background:var(--ios-ok-bg);color:var(--ios-ok)}
.safety-card .review-icon svg{width:22px;height:22px}
.safety-card .review-text span{color:var(--ios-label2)}
.safety-card.warn{background:var(--ios-warn-bg)}
.safety-card.warn .review-icon{background:#e39a2d;color:#fff}
.safety-card.warn .review-text span{color:var(--ios-warn);font-weight:600}
.safety-card .chev{width:16px;height:16px;color:#a5aaa1;flex-shrink:0}

@media(max-width:970px){.lb-top{grid-template-columns:1fr}}
/* Phone: five tabs fit at 360px; long labels wrap onto two short lines. */
@media(max-width:700px){
  .navigation{grid-template-columns:repeat(5,minmax(0,1fr))}
  .nav-item{font-size:10px;padding-left:1px;padding-right:1px;hyphens:auto;-webkit-hyphens:auto}
  .lb-top{gap:14px;margin-bottom:22px}
  .lb-today{padding:16px 16px 6px}
  .lb-quick{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .lb-quick-btn{flex-direction:row;align-items:center;padding:10px 12px;min-height:58px;font-size:15px;gap:10px}
  .lb-quick-btn:first-child{grid-column:1/-1}
  .lb-entry,.lb-eq{padding:12px 14px}
  .lb-empty{padding:22px 18px}
  .lb-empty .button{width:100%}
  .lb-report-card{padding:14px}
  .lb-report-buttons{width:100%}.lb-report-buttons .button{flex:1}
  #lb-form .field-grid,#lb-equipment-form .field-grid{grid-template-columns:1fr 1fr}
  #lb-form .field-grid>.field.full,#lb-equipment-form .field-grid>.field.full{grid-column:1/-1}
}
@media(max-width:380px){.lb-range{grid-template-columns:1fr}.lb-check .button.small{padding-left:10px;padding-right:10px;font-size:13px}}

@media(prefers-color-scheme:dark){
  .lb-today,.lb-quick-btn,.lb-list,.lb-empty,.lb-report-card,.safety-card{background:#1a201c;color:#e8ede9;box-shadow:none}
  .lb-today.warn{box-shadow:inset 0 0 0 2px #8a5a1c}
  .lb-check strong,.lb-entry-top strong,.lb-eq strong,.lb-value,.lb-entry,.lb-eq,.lb-today-head h2,.lb-empty h2{color:#e8ede9}
  .lb-check small,.lb-entry small,.lb-eq small,.lb-hint,.lb-note,.lb-day h3,.lb-empty p,.lb-unit-pick,.safety-card .review-text span{color:#a3ada6}
  .lb-check,.lb-list>li+li{border-color:#2a312c}
  .lb-tick{border-color:#47504a}
  .lb-check.done .lb-tick{background:#5f9c70;border-color:#5f9c70;color:#0e1310}
  .lb-check.warn .lb-tick,.safety-card.warn .review-icon{background:#d99a3e;border-color:#d99a3e;color:#1a1206}
  .lb-check.warn small,.lb-action{color:#f0c27e}
  .lb-again{background:#262e29;color:#d9efa8}
  .lb-check .button.primary,.lb-empty .button.primary,.lb-report-buttons .button.primary{background:#d9efa8;color:#10291f;border-color:#d9efa8}
  .lb-glyph{background:#24322a;color:#b8d9c2}
  .lb-glyph.cleaning{background:#1f2c36;color:#a9cbe3}
  .lb-glyph.pasteurisation{background:#36261c;color:#f0bf9b}
  .lb-glyph.batch{background:#2a2537;color:#cbbdf0}
  .lb-glyph.delivery{background:#312d1a;color:#e6d68f}
  .lb-entry.warn{background:#2a2114;box-shadow:inset 4px 0 0 #d99a3e}
  .lb-seg{background:#0e1310}
  .lb-seg button,.lb-seg label span{color:#e8ede9}
  .lb-seg button[aria-pressed=true],.lb-seg input:checked+span{background:#2f3833;box-shadow:none}
  .lb-empty-icon{background:#d9efa8;color:#10291f}
  .lb-alert{background:#2a2114;color:#f0c27e}
  .lb-action-field.required textarea{background:#221b10;border-color:#d99a3e}
  .safety-card .review-icon{background:#24322a;color:#b8d9c2}
  .safety-card.warn{background:#2a2114}
  .safety-card.warn .review-text span{color:#f0c27e}
  .lb-chev,.safety-card .chev{color:#6f7a72}
}
/* Long words (German compounds) never cut off a heading; very narrow phones keep the top bar inside the screen. */
.page-heading h1,.section-label h2,.lb-card h2{-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word}
@media(max-width:360px){.topbar .icon-button[data-action=help]{display:none}.topbar .currency-select select{width:84px;padding-right:20px}.brand>span:last-child{font-size:17px}}
