/* Dark mode for app.einlasspilot.de (Cockpit, Gate, Tower, Schalter, Buchhaltung, login/portal start).
   Active when <html data-theme="dark">, set by js/theme.js (saved choice, otherwise the system setting). */

/* ---- toggle button (all pages) ---- */
.ep-theme, .gate .ep-theme { position: fixed; top: 14px; right: 18px; z-index: 70; width: 40px; height: 40px; padding: 0; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid #e2e8f0; background: #fff; color: #334155;
  box-shadow: 0 8px 20px -14px rgba(15,23,42,.6); transition: transform .15s, background .15s, color .15s; }
.ep-theme:hover, .gate .ep-theme:hover { transform: translateY(-1px); color: #7c3aed; }
.ep-theme:focus-visible { outline: 3px solid rgba(124,58,237,.45); outline-offset: 2px; }
.ep-theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ep-theme .sun { display: none; }
html[data-theme="dark"] .ep-theme, html[data-theme="dark"] .gate .ep-theme { background: #151c31; border-color: #263152; color: #fbbf24; }
html[data-theme="dark"] .ep-theme .sun { display: block; }
html[data-theme="dark"] .ep-theme .moon { display: none; }
body.portal .t-main { padding-top: 64px; }          /* room for the button above the page header */
body.auth .auth-nav { right: 76px; }
@media (max-width: 860px) { body.portal .t-main { padding-top: 28px; } .ep-theme { top: 10px; right: 10px; } }
@media print { .ep-theme { display: none !important; } }

/* ---- colours ---- */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body.portal {
  --t-bg: #0b1122; --t-card: #131a2e; --t-line: #243050; --t-ink: #e5e9f2; --t-mut: #9aa6bd; --t-soft: #6b7893;
  --t-side: #070b17; --t-side-line: #1a2340; --t-ok: #22c55e; --t-warn: #f59e0b; --t-bad: #f87171;
}
html[data-theme="dark"] body.auth { --ink: #e5e9f2; --mut: #9aa6bd; --line: #243050; background: #0b1122; }

/* surfaces that were plain white */
html[data-theme="dark"] .t-btn.ghost, html[data-theme="dark"] .t-filters input, html[data-theme="dark"] .t-filters select,
html[data-theme="dark"] .t-form input, html[data-theme="dark"] .t-form select, html[data-theme="dark"] .t-form textarea,
html[data-theme="dark"] .t-form input[type=file], html[data-theme="dark"] .t-table input, html[data-theme="dark"] .t-table select,
html[data-theme="dark"] .t-inline input, html[data-theme="dark"] .t-events-check label, html[data-theme="dark"] .holder-row input,
html[data-theme="dark"] .holder-me, html[data-theme="dark"] .t-device .link input, html[data-theme="dark"] .g-bar input,
html[data-theme="dark"] .gate .row, html[data-theme="dark"] .gate .hit, html[data-theme="dark"] .gate .dev,
html[data-theme="dark"] .gate button:not(.t-btn):not(.ep-theme), html[data-theme="dark"] .bo-kpis div, html[data-theme="dark"] .bo-dialog,
html[data-theme="dark"] .bo-notes button, html[data-theme="dark"] .bo-given input, html[data-theme="dark"] .bo-btn.no,
html[data-theme="dark"] .auth-card, html[data-theme="dark"] .t-card input, html[data-theme="dark"] .t-card select,
html[data-theme="dark"] .t-card textarea {
  background: #0f1528; color: var(--t-ink, #e5e9f2); border-color: #243050;
}
html[data-theme="dark"] .t-btn.danger { background: #1f1220; border-color: #5b2130; color: #fca5a5; }
html[data-theme="dark"] .t-btn.ok { background: #0e2a1f; border-color: #14532d; color: #6ee7b7; }
html[data-theme="dark"] .t-btn.warn { background: #2a1a0c; border-color: #7c2d12; color: #fdba74; }
html[data-theme="dark"] .t-table tbody tr:hover td { background: #172040; }
html[data-theme="dark"] .t-card.is-disabled input { background: #1a2238; }

/* QR codes stay black on white so phones can scan them */
html[data-theme="dark"] .t-device .qr, html[data-theme="dark"] .g-qr { background: #fff; }
/* MFA setup: the authenticator QR code (black on transparent) needs a white quiet zone to be scannable */
html[data-theme="dark"] .auth-card img[src^="data:image/svg"] { background: #fff; padding: 12px; border-radius: 14px; }

/* tinted chips, notices, messages */
html[data-theme="dark"] .t-pill, html[data-theme="dark"] .t-tabs .t-count, html[data-theme="dark"] .t-date { background: #1e2550; color: #a5b4fc; }
html[data-theme="dark"] .t-pill.ok, html[data-theme="dark"] .t-pill.live, html[data-theme="dark"] .t-live-badge { background: #0e2a1f; color: #6ee7b7; }
html[data-theme="dark"] .t-pill.off { background: #2a1219; color: #fca5a5; }
html[data-theme="dark"] .t-pill.draft, html[data-theme="dark"] .t-pill.expired { background: #1e2638; color: #a3aec4; }
html[data-theme="dark"] .t-pill.warn { background: #2a1d0a; color: #fcd34d; }
html[data-theme="dark"] .t-pill.guest { background: #2a240a; color: #fde047; }
html[data-theme="dark"] .t-msgs li, html[data-theme="dark"] .t-live-bar { background: #0e2a1f; color: #a7f3d0; border-color: #14532d; }
html[data-theme="dark"] .t-msgs li.error, html[data-theme="dark"] .t-notice, html[data-theme="dark"] .t-live-bar.stopped,
html[data-theme="dark"] .gate .conflict, html[data-theme="dark"] .bo-error, html[data-theme="dark"] .bo-change.bad {
  background: #2a1219; color: #fecaca; border-color: #5b2130; }
html[data-theme="dark"] .t-notice.info { background: #111d3b; color: #bfdbfe; border-color: #1e3a8a; }
html[data-theme="dark"] .t-events-check label:has(input:checked) { background: #1e2550; border-color: #4338ca; }
html[data-theme="dark"] .t-info { background: #1e2550; color: #a5b4fc; }
html[data-theme="dark"] .t-info .t-tip { background: #e5e9f2; color: #0f172a; }
html[data-theme="dark"] .t-info .t-tip::after { border-top-color: #e5e9f2; }
html[data-theme="dark"] .t-info.below .t-tip::after { border-top-color: transparent; border-bottom-color: #e5e9f2; }
html[data-theme="dark"] .t-expired-note, html[data-theme="dark"] .g-expired {
  color: #cbd5e1; border-color: #334155; background: repeating-linear-gradient(45deg, #141b2d 0 22px, #1a2236 22px 44px); }
html[data-theme="dark"] tr.t-row-expired td { color: #7c879e; }

/* live entrance cards */
html[data-theme="dark"] .t-live { background: linear-gradient(135deg, #0d2a20, #0f1f1b 40%, #131a2e); border-color: #14532d; }
html[data-theme="dark"] .t-live.stopped { background: linear-gradient(135deg, #2a1219, #131a2e); border-color: #5b2130; }
html[data-theme="dark"] .t-live .t-live-note { color: #fca5a5; }
html[data-theme="dark"] .t-table tr.t-row-live td { background: #0f2219; }

/* Gate */
html[data-theme="dark"] .g-live, html[data-theme="dark"] .gate .hit span.tk.here { background: #0e2a1f; color: #6ee7b7; }
html[data-theme="dark"] .g-stats .gl, html[data-theme="dark"] .gate .row.gl, html[data-theme="dark"] .gate .hit.gl { background: #2a240a; border-color: #713f12; }
html[data-theme="dark"] .g-stats .gl .n { color: #fde047; }

/* Schalter */
html[data-theme="dark"] .bo-kpis span, html[data-theme="dark"] .bo-cat span, html[data-theme="dark"] .bo-line small,
html[data-theme="dark"] .bo-hit small { color: #9aa6bd; }
html[data-theme="dark"] .bo-cat, html[data-theme="dark"] .bo-hit { border-bottom-color: #243050; }
html[data-theme="dark"] .bo-line { border-bottom-color: #243050; }
html[data-theme="dark"] .bo-qty button { background: #1e2550; border-color: #3730a3; color: #c7d2fe; }
html[data-theme="dark"] .bo-qty button:hover:not(:disabled) { background: #283070; }
html[data-theme="dark"] .bo-codes li, html[data-theme="dark"] .bo-change { background: #0e2a1f; color: #6ee7b7; }
html[data-theme="dark"] .bo-due { background: #0f1528; }
html[data-theme="dark"] .bo-notes button:hover { background: #1a2238; }
html[data-theme="dark"] .bo-btn.free { background: #334155; }
html[data-theme="dark"] .bo-seatcount { color: #c4b5fd; }

/* login / portal start */
html[data-theme="dark"] .auth-card { box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
html[data-theme="dark"] .auth-card input[type=email], html[data-theme="dark"] .auth-card input[type=password],
html[data-theme="dark"] .auth-card input[type=text], html[data-theme="dark"] .auth-card input[type=number],
html[data-theme="dark"] .auth-card input:not([type]) { background: #0b1122; border-color: #243050; color: #e5e9f2; }
html[data-theme="dark"] .auth-card input:focus { background: #0b1122; }
html[data-theme="dark"] .area-links a { background: #0f1528; border-color: #243050; }
html[data-theme="dark"] .area-links a:hover { border-color: #4338ca; }
html[data-theme="dark"] .auth-card ul.messages li { background: #1e2550; color: #c7d2fe; }
html[data-theme="dark"] .auth-card ul.messages li.error, html[data-theme="dark"] .auth-card .errorlist.nonfield,
html[data-theme="dark"] .auth-card form > ul.errorlist { background: #2a1219; color: #fecaca; border-color: #5b2130; }
html[data-theme="dark"] .auth-card code, html[data-theme="dark"] .auth-card pre { background: #1a2238; }
html[data-theme="dark"] a { color: inherit; }
html[data-theme="dark"] body.auth a { color: #93c5fd; }
html[data-theme="dark"] body.auth .auth-nav a { color: var(--mut); }
html[data-theme="dark"] body.auth .area-links a { color: var(--ink); }
html[data-theme="dark"] .t-todo { background: #261c06; color: #fde68a; border-color: #713f12; }
