:root {
  --color-drink: #1565c0;
  --color-food: #f9a825;
  --color-bg: #ffffff;
  --color-text: #111111;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 18px;
}

.hidden { display: none !important; }

.screen { display: flex; flex-direction: column; height: 100vh; }

#screen-login {
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.pinpad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pinpad-display {
  font-size: 2rem;
  letter-spacing: 8px;
  min-height: 2.5rem;
}

.pinpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  gap: 10px;
}

.pinpad-key {
  font-size: 1.6rem;
  font-weight: 700;
  padding: 20px 0;
  border: none;
  border-radius: 10px;
  background: #1565c0;
  color: #fff;
}

#sale-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #eceff1;
  border-bottom: 2px solid #cfd8dc;
}

#sale-seller-name {
  font-size: 1.2rem;
  font-weight: 700;
}

#sale-quote {
  font-size: 1rem;
  font-style: italic;
  color: #37474f;
}

#sale-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#sale-grid {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: minmax(min-content, 160px);
  align-content: start;
  gap: 10px;
  padding: 10px;
  overflow-y: auto;
}

#sale-receipt {
  flex: 1;
  border-left: 3px solid #000;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 8px;
}

#receipt-list {
  flex-shrink: 0;
}

#receipt-total,
#receipt-given,
#receipt-change {
  font-size: 1.2rem;
  font-weight: 700;
}

.action-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 18px 8px;
}

.action-green { background: #2e7d32; }
.action-yellow { background: #f9a825; color: #111; }
.action-red { background: #c62828; }
.action-pfand { background: #6a1b9a; }
.action-trinkgeld { background: #00695c; }
.action-rabatt { background: #455a64; }
.action-rabatt.rabatt-aktiv { background: #ef6c00; }

.rabatt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rabatt-buttons {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 10px;
}

.rabatt-buttons button {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 18px 0;
  border: none;
  border-radius: 10px;
  background: #1565c0;
  color: #fff;
}

.rabatt-buttons button.rabatt-reset {
  background: #6d4c41;
}

#receipt-trinkgeld {
  font-size: 1.1rem;
  font-weight: 700;
}

#receipt-trinkgeld input {
  width: 100px;
  padding: 8px;
  font-size: 1rem;
  margin-right: 8px;
}

#receipt-trinkgeld button {
  padding: 10px 14px;
  font-size: 1rem;
  margin-right: 6px;
}

#given-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.given-btn {
  aspect-ratio: 1 / 1;
  background: #37474f;
  font-size: 1.1rem;
}

.given-clear {
  background: #6d4c41;
}

.admin-link {
  align-self: flex-end;
  background: none;
  border: 1px solid #999;
  border-radius: 8px;
  color: #666;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin-top: 8px;
}

#screen-admin {
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 2px solid #cfd8dc;
  flex-wrap: wrap;
}

#admin-tabs {
  display: flex;
  gap: 10px;
}

.admin-tab {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: #e0e0e0;
  color: #333;
}

.admin-tab.active {
  background: #1565c0;
  color: #fff;
}

#admin-content {
  padding: 20px;
}

.admin-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-row-label {
  font-size: 1rem;
}

.toggle-btn {
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  color: #fff;
  min-width: 110px;
}

.toggle-btn.toggle-active { background: #2e7d32; }
.toggle-btn.toggle-inactive { background: #c62828; }
.toggle-btn.edit-btn { background: #1565c0; }
.toggle-btn.delete-btn { background: #6d4c41; }
.toggle-btn.delete-btn:disabled { background: #bcaaa4; cursor: not-allowed; }

.admin-section {
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 16px 20px;
  width: 100%;
  max-width: 640px;
}

.admin-section h2 {
  margin-top: 0;
}

.admin-section input,
.admin-section select {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 1rem;
  border: 1px solid #999;
  border-radius: 8px;
}

.admin-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.admin-section label input {
  width: auto;
  margin-bottom: 0;
}

.admin-section button {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
}

#btn-admin-back {
  background: #455a64;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
}

.product-btn {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

.product-btn .price {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.85;
}

.category-drink { background: var(--color-drink); }
.category-food { background: var(--color-food); color: #111; }
.category-pfand { background: #6a1b9a; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 100;
}

.overlay .admin-link {
  border-color: #aaa;
  color: #ddd;
}