/* Order Smart · gemeinsame Komponenten für Panel und Kundenansicht */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px;
}

/* Kopfzeile */
.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { align-items: center; display: flex; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark {
  align-items: center; background: var(--ink); border-radius: var(--radius-sm); color: #fff;
  display: inline-flex; flex: 0 0 auto; font-weight: 800; height: 40px; justify-content: center; width: 40px;
}
.brand-title { font-size: 17px; font-weight: 800; line-height: 1.1; margin: 0; }
.brand-sub { color: var(--muted); font-size: 12px; margin: 2px 0 0; }

.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a, .nav span {
  border-radius: var(--radius-sm); color: var(--ink); padding: 8px 10px; text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: var(--panel-soft); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav .soon { color: var(--muted); cursor: default; }

/* Buttons */
.btn {
  align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); display: inline-flex; gap: 6px; justify-content: center; min-height: 40px;
  padding: 8px 12px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.btn.is-on { box-shadow: inset 0 0 0 2px currentColor; font-weight: 800; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; }

/* Panels */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.panel-head {
  align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 8px;
  justify-content: space-between; padding: 12px;
}
.panel-head h2, .panel-head h3 { font-size: 17px; margin: 0; }
.panel-head p { color: var(--muted); margin: 3px 0 0; font-size: 13px; }
.panel-body { padding: 12px; }

/* Badges, Pills */
.badge {
  border: 1px solid var(--line); border-radius: 999px; display: inline-block; font-size: 12px;
  font-weight: 800; padding: 3px 8px; white-space: nowrap;
}
.badge.pickup { background: var(--accent-soft); border-color: var(--accent-line); }
.badge.delivery { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.badge.late { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.badge.muted { color: var(--muted); }

.pill {
  align-items: center; border: 1px solid var(--line); border-radius: 999px; display: inline-flex;
  gap: 8px; min-height: 38px; padding: 7px 12px; white-space: nowrap; background: #fff;
}
.dot { background: var(--accent); border-radius: 999px; display: inline-block; height: 10px; width: 10px; }
.pill[data-mode="paused"] .dot, .pill[data-mode="pickup_only"] .dot, .pill[data-mode="delivery_only"] .dot { background: var(--warn); }
.pill[data-mode="closed"] .dot { background: var(--danger); }

/* Formulare */
.field { display: grid; gap: 5px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; }
.input, .field input, .field select, .field textarea {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 42px;
  padding: 9px 10px; width: 100%; font-weight: 400;
}
.field textarea { min-height: 80px; resize: vertical; }
.check { align-items: flex-start; display: flex; gap: 8px; font-weight: 400; }
.check input { margin-top: 3px; }

.switch {
  appearance: none; background: #c8c1b6; border: 0; border-radius: 999px; flex: 0 0 auto;
  height: 24px; margin: 0; position: relative; width: 44px; cursor: pointer;
}
.switch::before {
  background: #fff; border-radius: 999px; content: ""; height: 18px; left: 3px; position: absolute;
  top: 3px; transition: transform .15s ease; width: 18px;
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(20px); }

/* Hinweise */
.notice {
  background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-sm);
  color: var(--warn-ink); padding: 10px;
}
.notice.error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.notice.ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* Modal */
.modal {
  align-items: center; background: rgba(23, 20, 17, .56); display: none; inset: 0;
  justify-content: center; padding: 16px; position: fixed; z-index: 60;
}
.modal.is-open { display: flex; }
.modal-box {
  background: var(--panel); border-radius: var(--radius); box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  max-height: calc(100vh - 32px); max-width: 520px; overflow: auto; width: 100%;
}
.modal-head, .modal-body, .modal-foot { padding: 14px; }
.modal-head { align-items: start; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.modal-head h2 { font-size: 18px; margin: 0; }
.modal-body { display: grid; gap: 12px; }
.modal-foot { border-top: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }

/* Toast */
.toast-wrap { bottom: 16px; display: grid; gap: 8px; left: 50%; position: fixed; transform: translateX(-50%); z-index: 90; }
.toast { background: var(--ink); border-radius: var(--radius-sm); color: #fff; padding: 10px 14px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

@media (max-width: 620px) {
  .modal-foot { grid-template-columns: 1fr; }
}
