/* Warenausgang — Freigabe von Lieferungen der Rampe (js/modules/warenausgang/freigabe.js)
 * Läuft auf index.html (style.css) und wawe.html (portal.css): eigene Klassen mit
 * Präfix waf-, Knöpfe ausdrücklich gegen die globale button-Regel von style.css
 * (100 % Breite, Abstand, Schatten) abgesichert. */

.waf-block { border: 2px solid #c7d2fe; background: #eef2ff; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.waf-block-kopf { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: #3730a3; margin-bottom: 6px; flex-wrap: wrap; }
.waf-zahl { background: #4f46e5; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.waf-block-kopf .waf-btn { margin-left: auto; }
.waf-zeile { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #c7d2fe; }
.waf-zeile-haupt { flex: 1; min-width: 0; font-size: 14px; }

.waf-dim { color: #64748b; font-size: 12.5px; }
.waf-warn { color: #b45309; font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.waf-ok, .waf-fehler, .waf-hinweis { border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: 14px; line-height: 1.45; }
.waf-ok { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.waf-fehler { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.waf-hinweis { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }

/* Knöpfe — gegen style.css absichern */
button.waf-btn { width: auto; margin: 0; box-shadow: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 14px; min-height: 40px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff;
  color: #1e293b; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
button.waf-btn:hover { background: #f8fafc; }
button.waf-btn-primaer { background: #4f46e5; border-color: #4f46e5; color: #fff; }
button.waf-btn-primaer:hover { background: #4338ca; }
button.waf-btn-ok { background: #16a34a; border-color: #16a34a; color: #fff; }
button.waf-btn-ok:hover { background: #15803d; }
button.waf-btn-klein { padding: 4px 9px; min-height: 30px; font-size: 13px; }

/* Dialog */
.waf-hg { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.waf-dialog { background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: #1e293b; }
.waf-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.waf-kopf h3 { margin: 0; font-size: 17px; flex: 1; }
.waf-inhalt { padding: 12px 18px; overflow-y: auto; flex: 1; }
.waf-fuss { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid #e2e8f0; background: #f8fafc; border-radius: 0 0 14px 14px; }
.waf-fuss:empty { display: none; }
.waf-luecke { flex: 1; }
.waf-meta { font-size: 13px; color: #475569; margin-bottom: 4px; }

.waf-tabelle-wrap { overflow-x: auto; margin-top: 8px; }
table.waf-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; box-shadow: none; border-radius: 0; overflow: visible; }
/* style.css färbt jeden thead lila und macht th zu sortierbaren Köpfen — hier nicht */
table.waf-tabelle thead { background: #f8fafc; color: #64748b; }
table.waf-tabelle th { position: static; cursor: default; text-transform: none; letter-spacing: 0; }
table.waf-tabelle th { text-align: left; font-size: 12px; color: #64748b; padding: 6px 6px; border-bottom: 2px solid #e2e8f0; background: none; }
table.waf-tabelle td { padding: 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.waf-tabelle tfoot td { font-weight: 700; border-top: 2px solid #e2e8f0; }
table.waf-tabelle .r { text-align: right; }
table.waf-tabelle input { width: 74px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; text-align: right; margin: 0; }
.waf-stepper { display: inline-flex; align-items: center; gap: 4px; }
.waf-stepper input { width: 56px !important; }

.waf-neu { margin: 10px 0; }
.waf-neu select { width: 100%; max-width: 480px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.waf-abschnitt { font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
.waf-leergut { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.waf-leergut label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.waf-leergut input { width: 70px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; text-align: right; }
.waf-optionen { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; font-size: 14px; }
.waf-optionen label { display: flex; align-items: center; gap: 8px; }
.waf-optionen input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.waf-feld { flex-wrap: wrap; }
.waf-feld input { flex: 1; min-width: 220px; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.waf-liste { margin: 8px 0 8px 18px; font-size: 14px; line-height: 1.6; }
.waf-fortschritt { display: flex; align-items: center; gap: 12px; padding: 24px 6px; font-size: 15px; }
.waf-spinner { width: 22px; height: 22px; border: 3px solid #e2e8f0; border-top-color: #4f46e5; border-radius: 50%; animation: waf-dreh .8s linear infinite; }
@keyframes waf-dreh { to { transform: rotate(360deg); } }

/* Handy: Dialog bildschirmfüllend, große Tippflächen */
@media (max-width: 640px) {
  .waf-hg { padding: 0; align-items: stretch; }
  .waf-dialog { border-radius: 0; max-height: none; height: 100%; }
  button.waf-btn { min-height: 48px; font-size: 15px; }
  button.waf-btn-klein { min-height: 40px; min-width: 40px; }
  .waf-fuss { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .waf-fuss .waf-btn { flex: 1 1 auto; }
  .waf-luecke { display: none; }
  /* Stück-Spalte ergibt sich aus Paletten × Stk/Pal. — am Handy nur die Summe */
  table.waf-tabelle .waf-gross { display: none; }
  table.waf-tabelle td, table.waf-tabelle th { padding: 6px 3px; }
  table.waf-tabelle input { width: 62px; }
  .waf-stepper input { width: 42px !important; }
}
