/* Pizzeria Feuerstein – Premium Cockpit (Clean White · Fire-Orange · Crisp Black SaaS Look) */
:root {
  --red: #ea580c;
  --red-dark: #c2410c;
  --red-soft: #fff7ed;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #eaeef4;
  --border-strong: #d5dce6;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --radius: 11px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.045);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.login-logo {
  height: 68px;
  width: auto;
  object-fit: contain;
  margin-bottom: 14px;
}

.login-card h1 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.login-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ============================================================
   MAIN SHELL
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ULTRA-PREMIUM WEISSE SAAS-SIDEBAR MIT FEUER-ORANGE & TIEFEM SCHWARZ */
.sidebar {
  background: #ffffff;
  border-right: 1px solid #eaeef4;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #0f172a;
  box-shadow: 2px 0 18px rgba(15, 23, 42, 0.03);
}

.sidebar-top-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 18px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.sidebar-logo-pill {
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: none;
  flex-shrink: 0;
}

.sidebar-top-brand img {
  height: 36px;
  width: auto;
  max-width: 122px;
  object-fit: contain;
  display: block;
}

.sidebar-live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar .mobile-only-btn {
  color: #0f172a;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.nav-ico-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-ico-box svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: #fff7ed;
  color: #c2410c;
}

.nav-item:hover .nav-ico-box {
  background: #ffedd5;
  border-color: #fed7aa;
  color: #ea580c;
}

.nav-item.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.28);
}

.nav-item.active .nav-ico-box {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nav-badge {
  background: #ffffff;
  color: #ea580c;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

.nav-item:not(.active) .nav-badge {
  background: #ea580c;
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-switch-pill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.mode-switch-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-switch-opt:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.mode-switch-opt.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.26);
}

.sidebar-foot-btn {
  width: 100%;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 600;
  border-radius: 10px !important;
  justify-content: center;
}

.sidebar-foot-btn:hover {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
  color: #c2410c !important;
}

.ops-subnav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #eaeef4;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  margin-bottom: 16px;
  max-width: 520px;
}

.ops-sub-btn {
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.ops-sub-btn:hover {
  background: #fff7ed;
  color: #ea580c;
}

.ops-sub-btn.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}

.pos-stamps-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.45fr);
  gap: 14px;
  align-items: start;
}

.pos-stamps-grid > * {
  min-width: 0;
  max-width: 100%;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  flex-shrink: 0;
}

.conn-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ============================================================
   MAIN AREA & TOPBAR
   ============================================================ */
.main-area {
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.topbar-title p {
  font-size: 12.5px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 20px 24px 40px;
  max-width: 1400px;
  width: 100%;
}

/* ============================================================
   BUTTONS & INPUTS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  white-space: nowrap;
}

.btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn-green {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.btn-green:hover {
  background: #166534;
  border-color: #166534;
}

.btn-blue {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.btn-blue:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.btn-danger-outline {
  background: #ffffff;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-danger-outline:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--red);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.full-span {
  grid-column: 1 / -1;
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.stat-card small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-card strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.stat-card.alert {
  border-color: #fca5a5;
  background: #fff8f8;
}

.stat-card.alert strong {
  color: var(--red);
}

/* ============================================================
   LIVE ORDERS GRID
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-tab {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.order-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

.order-card.status-new {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.12);
}

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-no {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.order-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.new {
  background: #fee2e2;
  color: #b91c1c;
}
.status-badge.accepted,
.status-badge.preparing {
  background: var(--amber-soft);
  color: var(--amber);
}
.status-badge.delivering {
  background: var(--blue-soft);
  color: var(--blue);
}
.status-badge.completed {
  background: var(--green-soft);
  color: var(--green);
}
.status-badge.cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.order-customer {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.order-customer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.order-address-row {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.order-nav-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.order-items-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-item-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.order-item-sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: 18px;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.order-total-row strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   FEUERSTEIN INCOMING ORDER POPUP (FRONT OVERLAY)
   ============================================================ */
.incoming-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.incoming-overlay.open {
  display: flex;
}

.incoming-modal {
  background: #ffffff;
  width: 100%;
  max-width: 820px;
  max-height: 94vh;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--red);
}

.incoming-header {
  background: var(--red);
  color: #ffffff;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.incoming-header-left h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.incoming-header-left p {
  font-size: 12.5px;
  opacity: 0.92;
  margin-top: 2px;
}

.incoming-queue-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.incoming-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}

.incoming-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.incoming-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.incoming-map-frame {
  width: 100%;
  height: 155px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
  background: #f3f4f6;
}

.time-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.time-btn {
  padding: 9px 6px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.time-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.time-btn.selected {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.time-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.promised-preview {
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #14532d;
  font-size: 13.5px;
}

.promised-preview strong {
  font-size: 17px;
  font-weight: 600;
}

.incoming-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.incoming-footer-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   TABLES & MANAGEMENT LAYOUTS
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

table.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.split-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.list-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}

.list-item-btn.active {
  border-color: var(--red);
  background: var(--red-soft);
}

.street-chips {
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.street-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
}

.street-row:last-child {
  border-bottom: none;
}

/* ============================================================
   GENERIC MODAL
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 150;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #ffffff;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15.5px;
  font-weight: 600;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafbfc;
}

/* ============================================================
   EXACT 80mm THERMAL RECEIPT (1:1 MATCH TO USER'S PHOTO)
   Safe printable width (default 68mm + 5mm left inset) so NO
   characters are ever clipped by 80mm thermal printer heads!
   ============================================================ */
:root {
  --print-width: 68mm;
  --print-pad-left: 5mm;
  --print-pad-right: 3mm;
  --print-font-size: 11px;
}

.receipt-paper {
  width: var(--print-width, 68mm);
  max-width: 100%;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
  font-size: var(--print-font-size, 11px);
  line-height: 1.32;
  padding: 5mm var(--print-pad-right, 3mm) 8mm var(--print-pad-left, 5mm);
  border: 1px solid #d1d5db;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.receipt-logo-wrap {
  text-align: center;
  margin-bottom: 4px;
}

.receipt-logo-wrap img {
  height: 48px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%) contrast(185%);
}

.receipt-title-main {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.receipt-rule {
  border: none;
  border-top: 1px solid #222222;
  margin: 5px 0;
}

.receipt-center {
  text-align: center;
  font-size: 10.5px;
}

.receipt-customer {
  margin: 7px 0 6px;
  font-size: 11.5px;
  line-height: 1.38;
}

.receipt-kv {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
}

.receipt-kv-left {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
}

.receipt-kv-left span:first-child {
  min-width: 74px;
}

.receipt-promised {
  font-size: 11.5px;
  font-weight: 700;
  margin: 4px 0 3px;
}

.receipt-section-head {
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  margin: 7px 0 4px;
}

.receipt-order-meta {
  padding-left: 10px;
  font-size: 11px;
  line-height: 1.36;
  margin-bottom: 6px;
}

.receipt-items-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 4px 0;
  font-size: 11px;
}

.receipt-items-table .col-qty {
  width: 15px;
}

.receipt-items-table .col-name {
  word-break: break-word;
}

.receipt-items-table .col-price {
  width: 52px;
}

.receipt-items-table .col-tax {
  width: 14px;
}

.receipt-items-table td {
  padding: 1.5px 0;
  vertical-align: top;
}

.receipt-items-table .col-qty {
  width: 16px;
  padding-right: 4px;
}

.receipt-items-table .col-name {
  padding-right: 6px;
}

.receipt-items-table .col-price {
  text-align: right;
  white-space: nowrap;
  padding-right: 5px;
}

.receipt-items-table .col-tax {
  width: 14px;
  text-align: right;
  white-space: nowrap;
}

.receipt-subline {
  font-size: 11.5px;
  padding-left: 18px;
}

.receipt-extra-row td {
  font-size: 11.5px;
  padding-top: 0.5px;
  padding-bottom: 0.5px;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.receipt-vat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-bottom: 8px;
}

.receipt-vat-table td {
  padding: 1px 0;
}

.receipt-vat-table td:nth-child(2),
.receipt-vat-table td:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

.receipt-payment-line {
  font-size: 12.5px;
  font-weight: 700;
  margin: 6px 0 8px;
}

.receipt-tax-line {
  display: flex;
  gap: 18px;
  font-size: 12px;
  margin: 6px 0 8px;
}

.receipt-footer-msg {
  font-size: 12px;
  line-height: 1.35;
}

#receiptPrintArea {
  display: none;
}

/* ============================================================
   TOAST & RESPONSIVE
   ============================================================ */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #1f2937;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.18s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================================
   MOBILE APP NAVIGATION (DRAWER & BOTTOM TAB BAR)
   ============================================================ */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-menu-btn,
.mobile-topbar-logo,
.mobile-only-btn,
.mobile-bottom-nav,
.mobile-nav-backdrop {
  display: none;
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-topbar-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

.mobile-nav-backdrop.open {
  display: block;
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  min-width: 58px;
  cursor: pointer;
}

.mob-tab svg.icon {
  width: 20px;
  height: 20px;
}

.mob-tab.active {
  color: var(--red);
}

.mob-tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mob-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  border-radius: 999px;
  text-align: center;
}

/* ============================================================
   RESPONSIVE: TABLET & SMARTPHONE APP MODE
   ============================================================ */
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    max-width: 82vw;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.16);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-brand {
    justify-content: space-between;
  }

  .mobile-only-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .mobile-topbar-logo {
    display: block;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }

  .topbar-title h2 {
    font-size: 15.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .content {
    padding: 14px 12px calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 11px 12px;
  }

  .stat-card strong {
    font-size: 19px;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .filter-tab {
    flex-shrink: 0;
  }

  .orders-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .order-card {
    padding: 14px;
  }

  .order-actions .btn {
    flex: 1 1 auto;
    min-height: 38px;
  }

  .split-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS Safari zoom on input focus */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }

  /* Full-screen Feuerstein Incoming Popup on Smartphone */
  .incoming-overlay {
    padding: 0;
    align-items: stretch;
  }

  .incoming-modal {
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .incoming-header {
    padding: 12px 14px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .incoming-header-left h2 {
    font-size: 15.5px;
  }

  .incoming-header-left p {
    font-size: 12px;
  }

  .incoming-body {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }

  .time-picker-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .time-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .incoming-footer {
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .incoming-footer-right {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 8px;
    width: 100%;
  }

  .incoming-footer .btn {
    min-height: 44px;
    width: 100%;
    padding: 10px 12px;
  }

  /* Modals fit mobile screens cleanly */
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 14px;
  }
}

/* ============================================================
   80mm THERMAL PRINTER PRINT RULES
   ============================================================ */
@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .login-screen,
  .app-shell,
  .mobile-bottom-nav,
  .mobile-nav-backdrop,
  .incoming-overlay,
  .modal-backdrop,
  .toast {
    display: none !important;
  }
  #receiptPrintArea {
    display: block !important;
    width: var(--print-width, 68mm) !important;
    max-width: var(--print-width, 68mm) !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #receiptPrintArea .receipt-paper {
    border: none !important;
    width: var(--print-width, 68mm) !important;
    max-width: var(--print-width, 68mm) !important;
    padding: 3mm var(--print-pad-right, 3mm) 8mm var(--print-pad-left, 5mm) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   TOPBAR TON-OPTIONEN POPOVER (8 Alarm-Töne + Lautstärke + Intervall)
   ============================================================ */
.sound-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sound-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.sound-trigger-btn.muted {
  color: #6b7280;
  background: #f3f4f6;
}

.sound-caret {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.sound-menu-wrap.open .sound-caret {
  transform: rotate(180deg);
}

.sound-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
  z-index: 450;
  overflow: hidden;
  text-align: left;
}

.sound-menu-wrap.open .sound-popover {
  display: block;
}

.sound-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  color: #0f172a;
}

.sound-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  cursor: pointer;
}

.sound-switch input {
  width: 16px;
  height: 16px;
  accent-color: #c8102e;
  cursor: pointer;
}

.sound-pop-section {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.sound-pop-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 7px;
}

.sound-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.sound-options-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 245px;
  overflow-y: auto;
}

.sound-opt-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.sound-opt-btn:hover {
  border-color: #f97316;
  background: #fff7ed;
}

.sound-opt-btn.active {
  border-color: #c8102e;
  background: #fef2f2;
  color: #991b1b;
}

.sound-opt-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sound-opt-main strong {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

.sound-opt-main small {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

.sound-opt-play {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #c8102e;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sound-opt-btn.active .sound-opt-play {
  background: #c8102e;
  border-color: #c8102e;
  color: #ffffff;
}

.sound-repeat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.sound-rep-btn {
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.sound-rep-btn.active {
  background: #c8102e;
  border-color: #c8102e;
  color: #ffffff;
}

.sound-pop-foot {
  padding: 10px 14px;
  background: #f8fafc;
}

@media (max-width: 680px) {
  .sound-popover {
    position: fixed;
    top: 62px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* ============================================================
   PREMIUM SAAS POLISH (WEISS · FEUER-ORANGE · TIEFES SCHWARZ)
   ============================================================ */
.topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #eaeef4;
  padding: 15px 26px;
}

.topbar-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.topbar-title p {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 1px;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
  color: #0f172a;
  border-color: #e2e8f0;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(234, 88, 12, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(234, 88, 12, 0.34);
}

.card {
  background: #ffffff;
  border: 1px solid #eaeef4;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.card-header h3 {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #eaeef4;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  border-color: #fed7aa;
  transform: translateY(-1px);
}

.stat-card small {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.stat-card strong {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.filter-tab {
  border-radius: 999px;
  font-weight: 600;
  color: #334155;
}

.filter-tab.active {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
}

.sound-opt-btn.active {
  border-color: #ea580c;
  background: #fff7ed;
  color: #c2410c;
}

.sound-opt-play {
  color: #ea580c;
}

.sound-opt-btn.active .sound-opt-play,
.sound-rep-btn.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}

/* ============================================================
   BETONFESTES MOBILE ADMIN LAYOUT (0% OVERFLOW, KEIN BOTTOM-BAR,
   MENÜ NUR VON LINKS, KEIN IOS AUTO-ZOOM, ALLES SAUBER UNTEREINANDER)
   ============================================================ */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

.app-shell,
.main-area,
.topbar,
.content,
.tab-panel,
.card {
  max-width: 100%;
  min-width: 0;
}

.mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 960px) {
  .app-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip;
  }

  .main-area {
    width: 100% !important;
    max-width: 100% !important;
  }

  .topbar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    position: sticky;
    top: 0;
    z-index: 60;
  }

  .topbar-left {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }

  .topbar-title {
    min-width: 0;
    flex: 1;
  }

  .topbar-title h2 {
    font-size: 16px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .topbar-actions .btn,
  .topbar-actions .sound-menu-wrap {
    flex: 1 1 auto;
  }

  .topbar-actions .sound-trigger-btn {
    width: 100%;
    justify-content: center;
  }

  .content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 12px 28px !important;
  }

  .ops-subnav {
    max-width: 100% !important;
    width: 100%;
    margin-bottom: 12px;
  }

  .ops-sub-btn {
    padding: 9px 6px;
    font-size: 12.5px;
  }

  /* Alle 2-/3-Spalten-Grids sauber untereinander */
  .pos-stamps-grid,
  .split-layout,
  .form-grid-2,
  .form-grid-3,
  .orders-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .card {
    padding: 14px !important;
    width: 100% !important;
    overflow-x: hidden;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Buttons niemals über Kartenrand hinausragen lassen */
  .btn {
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
    max-width: 100%;
    line-height: 1.3;
  }

  /* WICHTIG für iOS Safari: >= 16px verhindert ungewolltes Reinzoomen & Wegschieben beim Tippen! */
  input,
  select,
  textarea {
    font-size: 16px !important;
    max-width: 100%;
    min-width: 0;
  }

  /* Menü-Drawer kommt sauber nur von links heraus */
  .sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    max-width: 84vw;
    z-index: 120;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.22);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }
}



