/* ══════════════════════════════════════════════════════════════════════════════
   styles.css – Einlasskontrolle
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Variablen ── */
:root {
  --bg:      #1a1f2e;
  --surface: #242938;
  --border:  #333a50;
  --accent:  #4f8ef7;
  --ok:      #2ecc71;
  --warn:    #f39c12;
  --danger:  #e74c3c;
  --text:    #e8eaf0;
  --muted:   #8892a4;
  --radius:  12px;
  --font:    'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; min-height: 100dvh; }

/* ── Header ── */
header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.header-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav-links a:hover { color: var(--text); }

/* ── Formulare ── */
label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="password"] {
  width: 100%; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 17px; padding: 11px 12px;
  outline: none; transition: border-color .15s;
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 8px; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; transition: opacity .15s;
}
.btn:active   { opacity: .8; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-full     { width: 100%; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-ok       { background: var(--ok);     color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-muted    { background: var(--border); color: var(--text); }
.btn-confirm  { background: var(--ok);     color: #fff; }
.btn-cancel   { background: var(--border); color: var(--text); }
.btn-undo     { background: var(--danger); color: #fff; grid-column: 1/-1; margin-top: 4px; }
.btn-delete   { background: var(--danger); color: #fff; }
.btn-clear    { background: var(--border); color: var(--muted); font-size: 18px; font-weight: 700; padding: 13px 18px; border: none; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0; }
.btn-clear:active { background: var(--danger); color: #fff; }
.btn-logout   { font-size: 13px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color .15s, background .15s; }
.btn-logout:hover { color: var(--danger); background: rgba(231,76,60,.1); }

.btn-scan {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}

.btn-search {
  width: 100%; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 700; padding: 13px; border: none; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s;
}

.btn-scan:active { background: var(--border); }
  width: 100%; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 700; padding: 13px; border: none; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s;
}
.btn-search:active { opacity: .8; }

/* ── Karten (Admin) ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 16px; }

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-overlay.bottom { align-items: flex-end; }

.modal-center {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 24px 20px; width: min(420px, 90vw);
  transform: scale(.95); transition: transform .2s cubic-bezier(.3,1,.3,1);
}
.modal-overlay.open .modal-center { transform: scale(1); }

.modal-drawer {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(36px + env(safe-area-inset-bottom, 20px)); width: 100%;
  transform: translateY(100%); transition: transform .25s cubic-bezier(.3,1,.3,1);
  border-top: 1px solid var(--border);
}
.modal-overlay.open .modal-drawer { transform: translateY(0); }

.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 20px; }
.modal-center h2, .modal-drawer h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal-center p { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }
.modal-meta  { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal-btns  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-btns .btn { padding: 13px; }

.warn-box { background: #2a2415; border: 1px solid var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--warn); margin-bottom: 16px; display: none; }
.warn-box.visible { display: block; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 20px)); left: 50%;
  transform: translateX(-50%) translateY(60px); background: var(--ok); color: #fff;
  padding: 12px 24px; border-radius: 24px; font-weight: 700; font-size: 15px;
  z-index: 200; white-space: nowrap; transition: transform .3s cubic-bezier(.3,1.4,.3,1), opacity .3s;
  opacity: 0; box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.toast.show  { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; display: none; }

/* ── Hints ── */
.hint  { text-align: center; color: var(--muted); padding: 32px 0; font-size: 14px; }
.empty { color: var(--muted); font-size: 14px; padding: 16px 0; }

/* ── Status-Banner ── */
.status-banner { border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: flex-start; gap: 12px; font-size: 14px; font-weight: 600; border: 1px solid var(--border); margin-bottom: 16px; }
.status-banner.checking { background: #1e2535; color: var(--muted); }
.status-banner.ok       { background: #142a1e; border-color: var(--ok);     color: var(--ok);    }
.status-banner.warn     { background: #2a1a10; border-color: var(--danger); color: var(--danger); }
.status-icon   { font-size: 22px; flex-shrink: 0; }
.status-detail { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }

/* ── Upload ── */
.upload-area { border: 2px dashed var(--border); border-radius: 8px; padding: 28px; text-align: center; cursor: pointer; transition: border-color .2s; margin-bottom: 14px; }
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); }
.upload-area input { display: none; }
.upload-icon     { font-size: 32px; margin-bottom: 8px; }
.upload-label    { font-size: 14px; color: var(--muted); }
.upload-filename { font-size: 14px; color: var(--text); font-weight: 600; margin-top: 6px; }
.result-box      { border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-top: 12px; display: none; }
.result-box.ok   { background: #142a1e; border: 1px solid var(--ok);     color: var(--ok);    }
.result-box.err  { background: #2a1010; border: 1px solid var(--danger); color: var(--danger); }

/* ── Confirm-Box ── */
.confirm-box { background: #2a1010; border: 1px solid var(--danger); border-radius: 8px; padding: 16px; margin-top: 14px; display: none; }
.confirm-box p { font-size: 14px; margin-bottom: 14px; line-height: 1.5; }
.confirm-btns  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Login ── */
.login-wrap  { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; width: 100%; max-width: 380px; }
.login-logo  { font-size: 40px; text-align: center; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 20px; cursor: pointer; }
.login-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.login-error { background: #2a1010; border: 1px solid var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--danger); margin-bottom: 16px; display: none; }
.login-error.visible { display: block; }

/* ── Setup ── */
.setup-wrap { padding: 20px; max-width: 700px; margin: 0 auto; }
.setup-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.setup-step h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.step-num { background: var(--accent); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.setup-step p { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.setup-step p:last-child { margin-bottom: 0; }
pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; overflow-x: auto; line-height: 1.6; color: var(--text); margin: 10px 0; }
.setup-link  { display: inline-block; color: var(--accent); font-size: 14px; word-break: break-all; }
.check-list  { list-style: none; padding: 0; }
.check-list li { font-size: 14px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.check-list li:last-child { border-bottom: none; }
.check-list li::before { content: '☐'; font-size: 16px; }

/* ── Statistik ── */
.refresh-info { font-size: 12px; color: var(--muted); text-align: right; padding: 8px 20px 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.kpi .value { font-size: 36px; font-weight: 800; line-height: 1; }
.kpi .sub   { font-size: 13px; color: var(--muted); }
.kpi.highlight { border-color: var(--ok); }
.kpi.highlight .value { color: var(--ok); }
section    { margin-bottom: 24px; }
section h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 12px; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row   { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 10px; }
.bar-label { font-size: 13px; color: var(--muted); text-align: right; }
.bar-track { background: var(--border); border-radius: 4px; height: 24px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease; }
.bar-count { font-size: 14px; font-weight: 700; }
.checkin-list { display: flex; flex-direction: column; gap: 8px; }
.checkin-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; transition: border-color .15s; }
.checkin-item:hover { border-color: var(--danger); }
.checkin-name { font-weight: 600; font-size: 15px; }
.checkin-time { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.checkin-knr  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.checkin-del  { font-size: 18px; color: var(--border); flex-shrink: 0; transition: color .15s; }
.checkin-item:hover .checkin-del { color: var(--danger); }
svg.ring   { overflow: visible; }
.ring-bg   { fill: none; stroke: var(--border); }
.ring-fill { fill: none; stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-text { fill: var(--text); text-anchor: middle; dominant-baseline: middle; }
.ring-wrapper { display: flex; justify-content: center; margin-bottom: 8px; }

/* ── Index / Gästeliste ── */
.search-box { background: var(--surface); padding: 14px 16px; border-bottom: 1px solid var(--border); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.row1 { margin-bottom: 10px; }
#results { padding: 12px 16px; }
.result-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.guest-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, transform .1s; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.guest-card:active { transform: scale(.98); }
.guest-card.checked-in { border-color: var(--warn); background: #2a2415; }
.card-info  { flex: 1; min-width: 0; }
.card-name  { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta  { font-size: 13px; color: var(--muted); margin-top: 3px; }
.badge      { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: var(--ok); color: #fff; }
.badge.warn { background: var(--warn); }