/* Aral-Look: Aral-Blau auf Weiß, helle Flächen. Immer hell, wie an der Station. */
:root {
  color-scheme: light;
  --brand: #0063af;        /* Aral-Blau */
  --brand-dark: #004b87;
  --brand-light: #e6f0f9;  /* Eingabefelder, gezählte Artikel */
  --brand-line: #9cc3e6;
  --bg: #eef3f8; --card: #fff; --text: #13233a; --muted: #5d6b7e; --line: #d9e2ec;
  --danger: #c62828;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
       background: var(--bg); color: var(--text); padding-bottom: 90px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
       background: var(--brand); color: #fff; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
       box-shadow: 0 3px 0 #fff, 0 4px 12px rgba(0, 40, 80, .18); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
         font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.brand::before { content: ""; width: 42px; height: 42px; border-radius: 8px; flex: none;
                 background: #fff url("/static/aral-logo.jpg") center / 38px no-repeat; }
.save-state { font-size: 13px; opacity: .9; }
main { max-width: 760px; margin: 0 auto; padding: 18px 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; color: var(--brand-dark); }
h2 { font-size: 19px; margin: 0 0 12px; color: var(--brand-dark); }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1em; }
a { color: var(--brand); }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
        padding: 16px; margin-bottom: 12px; color: inherit; text-decoration: none;
        box-shadow: 0 1px 2px rgba(0, 40, 80, .06); }
.card.station { border-top: 4px solid var(--brand); }
.narrow { max-width: 360px; margin: 40px auto; }
.info { margin-bottom: 14px; font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--brand);
       background: var(--card); color: var(--brand); border-radius: 10px; padding: 10px 16px; font-size: 16px;
       font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--brand-dark); }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-bottom: 10px; }
.btn:disabled { opacity: .5; }
input[type=password], input[type=number] { font: inherit; font-size: 20px; padding: 10px; border-radius: 10px;
       border: 1.5px solid var(--line); background: var(--card); color: var(--text); width: 100%; }
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
#login input { margin: 8px 0; text-align: center; letter-spacing: 4px; }

.line .head { display: flex; gap: 14px; align-items: center; }
.line img, .line .noimg { width: 84px; height: 84px; object-fit: contain; border-radius: 10px; background: #fff;
                           border: 1px solid var(--line); flex: none; }
.noimg { display: flex; align-items: center; justify-content: center; font-size: 36px; }
.line .name { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.line.done { background: var(--brand-light); border-color: var(--brand-line); border-left: 5px solid var(--brand); }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stepper span, .sum span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stepper div { display: flex; gap: 6px; }
.stepper input { text-align: center; background: var(--brand-light); border-color: var(--brand-line); font-weight: 700;
                 min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn.step { width: 46px; flex: none; padding: 0; font-size: 24px; }
.sum { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
       border-top: 1px solid var(--line); padding-top: 10px; }
.sum span { margin: 0; font-size: 15px; }
.sum b { font-size: 20px; color: var(--brand-dark); }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center;
          gap: 10px; background: var(--card); border-top: 3px solid var(--brand); padding: 12px 16px;
          padding-bottom: max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 12px rgba(0, 40, 80, .1); }
#progress { font-weight: 700; color: var(--brand-dark); }

.hist { display: flex; justify-content: space-between; align-items: center; border-left: 5px solid var(--brand); }
.n { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 40, 80, .06); }
.report table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 15px; }
.report th { background: var(--brand); color: #fff; padding: 8px; font-size: 13px; text-align: left; }
.report td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; }
.report td.img img, .report td.img .noimg { width: 56px; height: 56px; object-fit: contain; font-size: 24px; }
.report tfoot td { font-weight: 800; border-top: 2px solid var(--brand); color: var(--brand-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

@media (max-width: 420px) {
  .line img, .line .noimg { width: 68px; height: 68px; }
  .report th:nth-child(4), .report td:nth-child(4) { display: none; }
  .report table { font-size: 13px; }
  .report th, .report td { padding: 5px 4px; }
  .report td.img img, .report td.img .noimg { width: 40px; height: 40px; }
  .report svg.ean { width: 84px; }
}
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --line: #bbb; }
  .top, .noprint, .bottom { display: none !important; }
  body { padding: 0; }
  main { max-width: none; padding: 0; }
  .table-wrap { box-shadow: none; overflow: visible; }
  .report th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.btn.bag { margin-top: 6px; padding: 5px 10px; font-size: 14px; font-weight: 700; }
dialog.edit { border: none; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px));
              background: var(--card); color: var(--text); border-top: 5px solid var(--brand); }
dialog.edit::backdrop { background: rgba(0, 30, 60, .5); }
dialog.edit form { padding: 18px; }
dialog.edit label { display: block; font-weight: 700; margin-bottom: 14px; }
dialog.edit input { font: inherit; font-size: 17px; width: 100%; padding: 10px; margin-top: 4px; border-radius: 10px;
                    border: 1.5px solid var(--line); background: var(--brand-light); color: var(--text); }
dialog.edit small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
svg.ean { display: block; width: 150px; height: auto; margin: 6px 0 2px; border-radius: 4px; border: 1px solid var(--line); }
.report svg.ean { width: 120px; }
.ean-preview svg.ean { width: 190px; margin-top: 8px; }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 15px; }
.btn.danger { color: var(--danger); border-color: #f0c4c4; margin-left: auto; }
@media (max-width: 420px) {
  /* Bericht auf dem Handy: alles auf eine Bildschirmbreite */
  .report svg.ean { width: 78px; margin: 3px 0 0; }
  .report td:nth-child(3) { min-width: 90px; }
  .report th { font-size: 11px; }
  /* Auf dem Handy nur der Bestand – Beutel/lose Stück stehen im Druck und in der Excel-Datei */
  .report th:nth-child(5), .report td:nth-child(5), .report th:nth-child(6), .report td:nth-child(6) { display: none; }
}
/* Startseite */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card.station .btn.big { margin-bottom: 8px; }
.card.station p.muted { margin: -6px 0 12px; }
/* Bestellliste */
.order-tools { position: sticky; top: 70px; z-index: 3; display: flex; gap: 10px; align-items: center;
               background: var(--bg); padding: 6px 0 10px; }
.order-tools input[type=search] { flex: 1; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
                                  border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
.chk { white-space: nowrap; font-size: 14px; color: var(--brand-dark); font-weight: 700; }
h3.cat { margin: 18px 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); }
.oline { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px; }
.oline img, .oline .noimg { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff;
                             border: 1px solid var(--line); font-size: 26px; }
.oline .name { font-weight: 700; font-size: 15px; }
.oline .muted { font-size: 13px; }
.ostep { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.ostep input { width: 70px; flex: none; text-align: center; font-size: 18px; font-weight: 700; padding: 8px;
               border-radius: 10px; border: 1.5px solid var(--brand-line); background: var(--brand-light); color: var(--text);
               -moz-appearance: textfield; }
.ostep input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ostep .btn.step { width: 44px; height: 42px; }
.oline.done { background: var(--brand-light); border-color: var(--brand-line); border-left: 5px solid var(--brand); }
@media (min-width: 560px) {
  .oline { grid-template-columns: 56px 1fr auto; }
  .ostep { grid-column: auto; }
}
.report tr.catrow td { background: var(--brand-light); color: var(--brand-dark); font-weight: 800; font-size: 13px;
                       text-transform: uppercase; letter-spacing: .4px; }
/* Bestell-Bericht: Menge immer zeigen (die Handy-Regel oben gilt nur für die Inventur-Tabelle) */
.report table.order th:nth-child(4), .report table.order td:nth-child(4) { display: table-cell; font-size: 17px; }
