/* TEAMMATE:MEET – gemeinsames Design (Teammate Events). Farben kommen aus den Einstellungen (CSS-Variablen). */
:root {
  --primary: #8aac27; --accent: #e3a21a; --bg: #141614; --surface: #1f221e;
  --text: #f2f3ef; --btn-text: #1d1d1b; --success: #8aac27; --danger: #d64545;
  --radius: 6px; --surface-alpha: .92; --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --scale: 1; --muted: color-mix(in srgb, var(--text) 58%, transparent);
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --panel: color-mix(in srgb, var(--surface) calc(var(--surface-alpha) * 100%), transparent);
  --field: color-mix(in srgb, var(--bg) 70%, var(--surface));
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 28%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
html { font-size: calc(16px * var(--scale)); }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  background-image: var(--bg-image, none); background-size: cover; background-position: center;
  background-attachment: fixed; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 700; letter-spacing: -.005em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { flex: 1; }

/* Markenname TEAMMATE:XXX */
.appname { font-weight: 400; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.appname b { font-weight: 700; }
.appname .colon { color: var(--primary); font-weight: 700; margin: 0 .05em; }

/* Kopfzeile mit grünem Balken wie im Logo */
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1.2rem; flex-wrap: wrap;
  background: var(--panel); border-top: 6px solid var(--primary); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar img.brand { height: 30px; }
img.brand { max-width: 220px; object-fit: contain; object-position: left center; }
img.brand.custom { height: 40px !important; }
.topbar .appname { font-size: 1.05rem; }
.topbar .clock { font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 600; }
.topbar nav { gap: .2rem; }
.topbar nav a { text-decoration: none; padding: .4rem .65rem; border-radius: var(--radius); color: var(--muted); font-size: .95rem; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--line); }
.cust { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.cust img { height: 34px; max-width: 170px; object-fit: contain; }
.branded .appname .tm, .branded .hide-branded { display: none !important; }
/* Ruhige Karten für Bar, Service, Technik: neutraler Rahmen, Rot nur für Alarm */
.qcard { background: color-mix(in srgb, var(--surface) 96%, var(--text)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.qcard.new { animation: qflash 1.2s ease 3; }
@keyframes qflash { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 55%, transparent); } }
.qcard.ring { animation: qalarm 1.1s ease infinite; }
@keyframes qalarm { 50% { box-shadow: 0 0 0 4px var(--danger); } }
.qcard .room { font-size: 1.6rem; font-weight: 800; }
.qcard .meta, .qcard .state { color: var(--muted); font-size: .88rem; }
.qcard .btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.qcard .btns .btn { flex: 1; }
.qcard .btns .btn.sm { flex: 0 0 auto; padding: .4rem .9rem; }
.age { font-variant-numeric: tabular-nums; font-weight: 700; }
.age.late { color: var(--danger); }
.cntn { background: var(--line); color: var(--text); border-radius: 99px; padding: 0 .6rem; font-size: 1rem; letter-spacing: 0; font-weight: 700; }
.footer-stripe { height: 6px; background: var(--primary); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; backdrop-filter: blur(8px); }
.wrap { max-width: 1500px; margin: 0 auto; padding: 1rem; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; letter-spacing: .02em;
  padding: .7rem 1.1rem; border-radius: var(--radius); background: var(--primary); color: var(--btn-text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none;
  transition: transform .08s ease, filter .15s; touch-action: manipulation; user-select: none;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost.on { background: var(--primary); color: var(--btn-text); border-color: transparent; }
.btn.accent { background: var(--accent); color: #1d1d1b; }
.btn.success { background: var(--success); color: var(--btn-text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.dark { background: var(--text); color: var(--bg); }
.btn.sm { padding: .4rem .7rem; font-size: .86rem; }
.btn.lg { padding: 1.05rem 1.5rem; font-size: 1.15rem; }
.btn.xl { padding: 1.3rem 1.8rem; font-size: 1.45rem; min-height: 5rem; }

/* Formulare */
label { display: block; font-size: .84rem; color: var(--muted); margin: .6rem 0 .25rem; }
label.chk { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .95rem; margin: .8rem 0 .2rem; cursor: pointer; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: calc(var(--radius) * .8 + 2px); padding: .6rem .7rem;
}
input[type=color] { padding: 2px; height: 2.4rem; }
input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); margin: 0; flex: 0 0 auto; }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .9rem; }

/* Schalter */
.switch { position: relative; display: inline-block; width: 2.9rem; height: 1.6rem; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 1.2rem; height: 1.2rem; left: .2rem; top: .2rem; background: var(--text); border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(1.3rem); background: var(--btn-text); }

/* Status */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--line); letter-spacing: .02em; }
.badge.angefragt { background: var(--accent); color: #1d1d1b; }
.badge.bestaetigt { background: var(--success); color: var(--btn-text); }
.badge.abgelehnt, .badge.storniert, .badge.red { background: var(--danger); color: #fff; }
.badge.laufend { background: var(--primary); color: var(--btn-text); }

/* Toast & Dialog */
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast { background: var(--surface); border: 1px solid var(--line); padding: .8rem 1.2rem; border-radius: var(--radius); box-shadow: 0 8px 30px #0007; font-weight: 600; animation: pop .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--success); color: var(--btn-text); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
dialog { border: 1px solid var(--line); border-top: 6px solid var(--primary); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 1.3rem 1.5rem; width: min(600px, 94vw); box-shadow: 0 20px 60px #000a; max-height: 92vh; overflow: auto; }
dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
dialog .actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.2rem; flex-wrap: wrap; }

/* Zeitplan (Tag / Woche) */
.sched { display: grid; position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); user-select: none; }
.sched .hcell { padding: .5rem .3rem; font-weight: 700; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; position: sticky; z-index: 3; }
.sched .hcell.grp { font-size: .95rem; border-left: 2px solid var(--line); }
.sched .hcell.narrow { padding: .45rem 0; font-size: .78rem; text-overflow: clip; }
.sched .hcell.grp.today { color: var(--primary); }
.sched .hcell .dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.sched .times { position: relative; border-right: 1px solid var(--line); }
.sched .times div { position: absolute; right: .4rem; font-size: .76rem; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.sched .col { position: relative; border-left: 1px solid var(--line); cursor: crosshair; }
.sched .col.first { border-left: 2px solid var(--line); }
.sched .col.today { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.sched .col .hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.sched .col .hl.half { border-top-style: dashed; opacity: .5; }
.sched .nowline { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 4; pointer-events: none; }
.sched .blk {
  position: absolute; left: 4px; right: 6px; border-radius: calc(var(--radius) * .8 + 2px); padding: .25rem .4rem; font-size: .78rem; overflow: hidden;
  background: var(--success); color: var(--btn-text); box-shadow: 0 2px 8px #0005; z-index: 2; cursor: pointer; line-height: 1.25; border-left: 4px solid #0003;
}
.sched .blk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched .blk.angefragt { background: repeating-linear-gradient(135deg, var(--accent), var(--accent) 8px, color-mix(in srgb, var(--accent) 82%, #000) 8px, color-mix(in srgb, var(--accent) 82%, #000) 16px); color: #1d1d1b; }
.sched .blk.busy { background: color-mix(in srgb, var(--text) 30%, var(--surface)); color: var(--text); cursor: default; border-left-color: var(--danger); }
.sched .blk.running { box-shadow: inset 0 0 0 3px var(--text), 0 2px 8px #0005; }
.sched .blk.short { padding-top: 0; padding-bottom: 0; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.sched .blk.short b { display: block; flex: 0 1 auto; min-width: 0; }
.sched .blk.short .tm { flex: 0 0 auto; opacity: .85; }
.sched .blk.ended { opacity: .45; }
.sched .blk.notstarted { outline: 3px dashed var(--danger, #d33); outline-offset: -3px; }
.sched .blk .nsflag { display: inline-block; margin-top: 2px; padding: 0 .35em; border-radius: 4px; background: var(--danger, #d33); color: #fff; font-weight: 700; font-size: .85em; }
.sched .blk .nsdot { display: inline-block; width: 1.1em; height: 1.1em; line-height: 1.1em; text-align: center; border-radius: 50%; background: var(--danger, #d33); color: #fff; font-weight: 800; margin-right: .3em; font-size: .85em; }
.sched .blk.dragging { opacity: .85; z-index: 10; box-shadow: 0 10px 30px #000a; cursor: grabbing; }
.sched .blk .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.sched .ghostsel { position: absolute; left: 3px; right: 3px; background: color-mix(in srgb, var(--primary) 40%, transparent); border: 2px dashed var(--primary); border-radius: var(--radius); pointer-events: none; z-index: 1; }
.legend { display: flex; gap: 1rem; font-size: .84rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: .3rem; }

/* Tabellen */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list .n { text-align: right; font-variant-numeric: tabular-nums; }
table.list th { font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.thumb { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; background: var(--line); display: inline-block; vertical-align: middle; }

/* Produkt-Buttons */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.pbtn {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 0; padding: 0;
  background: var(--pcolor, var(--primary)); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: flex-end; justify-content: center; box-shadow: 0 4px 14px #0005; touch-action: manipulation; transition: transform .08s;
}
.pbtn:active { transform: scale(.96); }
.pbtn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pbtn span.lbl { position: relative; width: 100%; padding: .6rem .5rem; text-align: center; background: linear-gradient(transparent, #000c 70%); }
.pbtn.noimg { align-items: center; }
.pbtn.noimg span.lbl { background: none; font-size: 1.15rem; }
.pbtn .qty { position: absolute; top: .45rem; right: .45rem; background: var(--primary); color: var(--btn-text); min-width: 2rem; height: 2rem; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-weight: 800; z-index: 2; box-shadow: 0 2px 6px #0006; }
.pbtn .stockinfo { position: absolute; top: .45rem; left: .45rem; z-index: 2; background: #000a; color: #fff; font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; font-weight: 600; }
.pbtn.off { cursor: not-allowed; filter: grayscale(1); opacity: .45; }
.pbtn.off .offlbl { position: absolute; z-index: 3; top: 40%; left: 0; right: 0; text-align: center; background: #000c; color: #fff; padding: .35rem; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.cattabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; }
.cattab { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; padding: .75rem 1.15rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); cursor: pointer; color: var(--text); font: inherit; font-weight: 700; }
.cattab img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.cattab.active { background: var(--catcolor, var(--primary)); color: #fff; border-color: transparent; }

/* Bon */
.bon { font-family: 'Courier New', ui-monospace, monospace; background: #fff; color: #000; padding: 10px; white-space: pre; font-size: 13px; line-height: 1.35; display: inline-block; border-radius: 3px; }
.bon .c { text-align: center; display: block; }
.bon .b { font-weight: 700; }
.bon .big { font-weight: 700; font-size: 1.6em; text-align: center; display: block; }
#printarea { display: none; }
@media print {
  @page { size: 80mm auto; margin: 2mm; }
  html, body { background: #fff !important; background-image: none !important; }
  body > *:not(#printarea) { display: none !important; }
  #printarea { display: block !important; }
  #printarea .bon { padding: 0; font-size: 12px; }
  .pagebreak { page-break-after: always; }
}
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
/* Ortung (4.0) */
.seg { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
table.list tr.sel td { background: color-mix(in srgb, var(--primary) 12%, transparent); }
#lmap text { font-family: inherit; pointer-events: none; }
.tzone { display: block; font-size: .85rem; color: var(--text); margin-top: .1rem; }

/* Status-Pillen (App, Info-Counter) */
.stpill { display: inline-block; padding: .22rem .7rem; border-radius: 99px; font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* Kommende Meetings (Bar, Service, Technik) */
.meet { padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.meet.soon { border-left: 4px solid var(--accent); padding-left: .6rem; }
.meet .mtext { white-space: pre-line; font-size: 1.05rem; font-weight: 600; margin-top: .3rem; }
