:root {
  --bg: #0b0f14;
  --panel: #151b24;
  --panel2: #1c2430;
  --line: #2a3444;
  --text: #f2f5fa;
  --muted: #8b97a8;
  --accent: #e31c23;
  --ok: #3dd68c;
  --warn: #f5a524;
  --radius: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --vh: 100dvh;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; width: 100%;
  overflow: hidden;
  font-family: var(--font); color: var(--text); background: var(--bg);
}
#app { height: var(--vh); width: 100%; overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }

.idle {
  height: var(--vh); display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  overflow: hidden;
  background: radial-gradient(900px 500px at 20% 0%, #2a1214 0%, transparent 55%), var(--bg);
}
.idle-logo {
  display: grid; place-items: center; border-right: 1px solid var(--line); padding: clamp(16px, 3vh, 40px);
}
.idle-logo img { max-width: min(380px, 70%); max-height: 40vh; height: auto; }
.idle-action { display: grid; place-items: center; padding: clamp(16px, 3vh, 40px); }
.btn-anmelden {
  min-width: min(280px, 70vw); min-height: clamp(72px, 14vh, 120px); border: 0; border-radius: 18px;
  background: var(--accent); color: #fff; font-size: clamp(22px, 4vh, 32px); font-weight: 700;
  letter-spacing: .04em; box-shadow: 0 12px 40px rgba(227,28,35,.35);
}
.btn-anmelden:active { transform: scale(.98); }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; padding: 12px;
  overflow: hidden;
}
.modal {
  width: min(440px, 100%); max-height: calc(var(--vh) - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.modal h2 { margin: 0 0 6px; }
.modal .sub { color: var(--muted); margin: 0 0 12px; }
.display {
  background: #0a0e13; border: 1px solid var(--line); border-radius: 10px;
  padding: clamp(10px, 1.5vh, 14px); font-family: var(--mono); font-size: clamp(20px, 3.2vh, 28px); letter-spacing: .1em;
  text-align: right; min-height: clamp(44px, 7vh, 64px); margin-bottom: 8px;
}
.display.small { font-size: 16px; min-height: 40px; }
.err { color: #ff7b83; font-size: 12px; min-height: 1.2em; margin: 0 0 6px; }
.ok { color: var(--ok); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad button {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  border-radius: 10px; min-height: clamp(40px, 6.2vh, 52px); font-size: clamp(16px, 2.6vh, 22px); font-weight: 600;
}
.pad button.fn { font-size: 13px; background: #121820; color: var(--muted); }
.pad button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
.pad button.del { color: var(--warn); }

/* Vollbild-Kasse – kein Seiten-Scroll */
.pos-root {
  height: var(--vh);
  max-height: var(--vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.top {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.top .meta { font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #231016; color: #ffb4b8; font-size: 11px; font-weight: 600; }
.badge.ok { background: #13281f; color: var(--ok); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(260px, 300px);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.cart, .buttons, .side {
  border-right: 1px solid var(--line);
  padding: 8px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cart h3, .buttons h3 { margin: 0 0 6px; font-size: 14px; flex-shrink: 0; }
.cart-lines {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.side { border-right: 0; background: #10151c; padding: 0; }
.side-scroll {
  flex: 1; min-height: 0; overflow: hidden; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.side-pay {
  flex-shrink: 0; padding: 8px; border-top: 1px solid var(--line);
  background: #0c1016; display: flex; flex-direction: column; gap: 6px;
}
.bonstorno {
  min-height: clamp(40px, 5.5vh, 48px); border-radius: 10px; border: 1px solid #5a2228;
  background: #2a1214; color: #ffb4b8; font-weight: 700;
}
.line {
  display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-bottom: 6px;
  font-size: 13px;
}
.line button { padding: 6px 8px !important; font-size: 12px !important; }
.btn-grid {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  grid-auto-rows: minmax(56px, auto); gap: 6px; align-content: start;
}
.pbtn {
  min-height: 56px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); font-weight: 600; padding: 8px; text-align: left; font-size: 13px;
}
.pbtn small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; font-size: 11px; }
.entry {
  background: #0a0e13; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  font-family: var(--mono); font-size: clamp(16px, 2.4vh, 20px); text-align: right; flex-shrink: 0;
}
.func { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex-shrink: 0; }
.func button, .pay button {
  min-height: clamp(40px, 5.5vh, 48px); border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-weight: 700; font-size: 14px;
}
.func .storno { background: #3a1518; border-color: #5a2228; color: #ffb4b8; }
.func .code { background: #1a2433; }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 0; }
.pay .cash { background: var(--ok); border-color: var(--ok); color: #062016; font-size: 16px; }
.total {
  font-size: clamp(20px, 3.5vh, 28px); font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums; flex-shrink: 0; padding-top: 4px;
}
.pad button.mult { background: #1a2a3a; color: #7ec8ff; font-size: 22px; }
.pad + .go.wide, button.go.wide {
  width: 100%; min-height: clamp(40px, 5.5vh, 48px); border-radius: 10px; border: 0;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.side .meta { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.cash-screen {
  height: var(--vh); display: grid; place-items: center; padding: 12px;
  overflow: hidden;
  background: radial-gradient(800px 400px at 50% 0%, #1a2a22 0%, transparent 55%), var(--bg);
}
.cash-screen.done { background: radial-gradient(800px 400px at 50% 20%, #13281f 0%, transparent 55%), var(--bg); }
.cash-panel {
  width: min(560px, 100%); max-height: calc(var(--vh) - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.cash-panel.center { text-align: center; }
.cash-panel h1 { margin: 0 0 8px; font-size: clamp(22px, 3.5vh, 28px); }
.cash-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.cash-due { font-size: clamp(28px, 5vh, 40px); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
.change-big { font-size: clamp(40px, 8vh, 64px); font-weight: 700; color: var(--ok); margin: 8px 0; font-variant-numeric: tabular-nums; }
.cash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cash-box .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cash-box .display.change { color: var(--text); }
.cash-box .display.change.ok { color: var(--ok); }
.note-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px;
}
.note-btn {
  min-height: clamp(40px, 6vh, 52px); border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-weight: 700; font-size: 15px;
}
.note-btn.suggest { border-color: var(--ok); background: #13281f; color: var(--ok); }
.note-btn.exact { background: #1a2a22; color: var(--ok); }
.cash-pad { margin-bottom: 4px; }
.cash-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; margin-top: 10px; }
.cash-actions button {
  min-height: clamp(40px, 5.5vh, 52px); border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-weight: 700;
}
.cash-actions .go { background: var(--ok); border-color: var(--ok); color: #062016; }
.cash-actions .go:disabled { opacity: .45; cursor: not-allowed; }
.banner {
  background: #3a1518; color: #ffd0d3; padding: 8px 12px; border-top: 1px solid #5a2228;
  display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
}
.banner button { border: 0; border-radius: 8px; padding: 8px 12px; background: #fff; color: #3a1518; font-weight: 700; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr 280px; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .cart { grid-column: 1; grid-row: 1; }
  .buttons { grid-column: 1; grid-row: 2; border-top: 1px solid var(--line); }
  .side { grid-column: 2; grid-row: 1 / span 2; }
  .idle { grid-template-columns: 1fr; }
  .idle-logo { border-right: 0; border-bottom: 1px solid var(--line); max-height: 35vh; }
}
@media (max-width: 720px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.1fr); }
  .cart, .buttons, .side { grid-column: 1; grid-row: auto; }
}
