/* yourvend Online – Farben wie die Automaten-App (Petrol + Bernstein) */
:root {
  --bg: #EEF1F4; --panel: #FFFFFF; --line: #E2E6EB; --fg: #1B2026; --dim: #67727E; --faint: #9AA4AE;
  --accent: #0E7C86; --accent-2: #0A5F67; --accent-soft: #E3F3F4;
  --amber: #C0620F; --amber-soft: #FDF1E6;
  --ok: #2E9E5B; --ok-soft: #E6F5EC; --bad: #C62828; --bad-soft: #FDECEC; --warn: #B7791F; --warn-soft: #FFF6E0;
  --radius: 16px; --shadow: 0 1px 2px rgba(20,30,40,.06), 0 6px 18px rgba(20,30,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 Roboto, system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--dim); }

/* Kopf + Navigation */
.top { display: flex; align-items: center; gap: 16px; padding: 0 max(16px, env(safe-area-inset-left)); height: 60px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.2px; }
.brand small { display: block; font-size: 10px; letter-spacing: 1.6px; opacity: .8; font-weight: 500; margin-top: -3px; }
.nav { display: flex; gap: 4px; margin-left: 12px; flex: 1; overflow-x: auto; }
.nav button { background: none; border: 0; color: #fff; opacity: .78; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.nav button.on, .nav button:hover { opacity: 1; background: rgba(255,255,255,.16); }
.who { font-size: 13px; opacity: .9; white-space: nowrap; }
.who button { margin-left: 8px; background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; }

main { max-width: 1280px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left)); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.3px; text-wrap: balance; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--dim); margin: 0 0 20px; }
.muted { color: var(--dim); } .small { font-size: 13px; } .mono { font-family: "Roboto Mono", ui-monospace, monospace; }

.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 22px; }
.kpi .label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); }
.kpi .val { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .val.amber { color: var(--amber); }
.kpi .note { font-size: 13px; color: var(--dim); }

/* Automaten-Karten */
.machines { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.mcard { cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.mcard:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.mcard .head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.mcard .name { font-weight: 700; font-size: 17px; }
.mcard .id { font-size: 12px; color: var(--faint); }
.mcard .rev { display: flex; gap: 14px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.mcard .rev b { display: block; font-size: 18px; }
.mcard .rev span { font-size: 12px; color: var(--dim); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.off { color: var(--dim); background: #EDF0F3; }
.pill.info { color: var(--accent); background: var(--accent-soft); }
.pill.plain::before { display: none; }

/* Detail */
.back { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; margin-bottom: 10px; font-weight: 500; }
.tabs { display: flex; gap: 6px; margin: 16px 0; overflow-x: auto; }
.tabs button { border: 1px solid var(--line); background: var(--panel); padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--dim); } dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.tube { display: flex; align-items: end; gap: 10px; height: 120px; padding-top: 8px; }
.tube div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; font-size: 12px; color: var(--dim); }
.tube i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: var(--accent); min-height: 4px; }
.tube i.low { background: var(--amber); }
.tube b { color: var(--fg); font-size: 14px; }

/* Bedienelemente */
.btn { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--accent-2); }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--bad); } .btn.warn { background: var(--amber); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; min-width: 0; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.f { display: block; font-size: 13px; color: var(--dim); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: #7A5310; font-size: 14px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--accent-soft); color: var(--accent-2); }

/* Fernsitzung */
.remote { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .remote { grid-template-columns: 1fr; } }
.screen { position: relative; background: #0D1114; border-radius: 18px; padding: 10px; aspect-ratio: 9 / 16; max-width: 100%;
  display: flex; align-items: center; justify-content: center; color: #8996A2; overflow: hidden; user-select: none; }
.screen img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; cursor: crosshair; -webkit-user-drag: none; }
.screen .age { position: absolute; left: 16px; bottom: 14px; font-size: 12px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 999px; }
.screen .dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; background: rgba(14,124,134,.5); pointer-events: none; animation: ping .6s ease-out forwards; }
@keyframes ping { to { transform: scale(1.8); opacity: 0; } }

.cmdlist { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.cmd { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 10px; border-radius: 10px; background: #F6F8FA; }
.cmd .msg { color: var(--dim); overflow-wrap: anywhere; }

/* Anmeldung */
.login { max-width: 400px; margin: 9vh auto; }
.login .brandbig { font-size: 34px; font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.login .brandbig small { display: block; font-size: 11px; letter-spacing: 2px; color: var(--dim); font-weight: 500; }

dialog { border: 0; border-radius: 20px; padding: 24px; max-width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(16,20,24,.55); }
dialog h3 { margin: 0 0 8px; font-size: 19px; }
dialog p { margin: 0 0 16px; color: var(--dim); }
.secret { font-family: "Roboto Mono", monospace; background: #F2F5F7; border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; font-size: 13px; margin: 6px 0 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1B2026; color: #fff;
  padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .2s; pointer-events: none; z-index: 20; font-size: 14px; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
@media (max-width: 640px) { .who span { display: none; } .brand small { display: none; } }
