/* ITMedia Fahrtenbuch – Dunkles Standarddesign (Palette wie design-standard/theme-dark.css) */
:root { --bg:#0a0e14; --panel:#121823; --panel2:#0e131b; --line:#222b3a; --line2:#2d384b; --txt:#d5dbe6; --dim:#8a96a8;
        --acc:#4c8dff; --acc2:#8b5cf6; --ok:#34d399; --bad:#f87171; --warn:#fbbf24; }
* { box-sizing:border-box; }
html { color-scheme:dark; }
body { margin:0; color:var(--txt); font:14px/1.5 "Inter","Segoe UI Variable","Segoe UI",system-ui,sans-serif; -webkit-font-smoothing:antialiased;
       background:radial-gradient(1100px 520px at 85% -10%, rgba(139,92,246,.16), transparent 60%), radial-gradient(900px 480px at -10% 110%, rgba(76,141,255,.14), transparent 60%), var(--bg);
       background-attachment:fixed; min-height:100vh; }
a { color:#8fb6ff; text-decoration:none; } a:hover { text-decoration:underline; }
h1 { font-size:26px; margin:0 0 4px; letter-spacing:-.3px; } h2 { font-size:17px; margin:0 0 12px; letter-spacing:-.2px; } h3 { font-size:15px; margin:0 0 8px; }
.container { max-width:1400px; margin:0 auto; padding:24px 28px 40px; }
.dim { color:var(--dim); } .small { font-size:12px; } .right { text-align:right; } .nowrap { white-space:nowrap; }
::-webkit-scrollbar { width:10px; height:10px; } ::-webkit-scrollbar-thumb { background:#27324a; border-radius:8px; }

/* Topbar */
.topbar { position:sticky; top:0; z-index:900; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px 18px; padding:10px 28px;
          background:rgba(10,14,20,.8); backdrop-filter:blur(14px) saturate(140%); border-bottom:1px solid var(--line); }
.tb-brand { display:flex; align-items:center; gap:10px; color:#f3f6fb; font-weight:650; }
.tb-brand:hover { text-decoration:none; }
.tb-img { height:30px; width:auto; display:block; }
.tb-env { font-size:11px; font-weight:500; color:var(--dim); border:1px solid var(--line2); border-radius:999px; padding:2px 9px; }
.nav { display:flex; flex-wrap:wrap; gap:4px; }
.nav a { color:var(--txt); padding:7px 14px; border-radius:9px; border:1px solid transparent; font-weight:550; }
.nav a:hover { background:rgba(76,141,255,.10); text-decoration:none; }
.nav a.on { background:linear-gradient(135deg,var(--acc),var(--acc2)); color:#fff; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.tb-user { display:flex; align-items:center; gap:10px; padding:5px 6px 5px 12px; background:var(--panel); border:1px solid var(--line); border-radius:999px; }
.tb-live { width:8px; height:8px; border-radius:50%; background:var(--ok); animation:pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow:0 0 0 0 rgba(52,211,153,.6); } 70% { box-shadow:0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow:0 0 0 0 rgba(52,211,153,0); } }
.tb-avatar { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-weight:700; color:#fff; background:linear-gradient(135deg,var(--acc),var(--acc2)); }
.tb-meta { display:flex; flex-direction:column; line-height:1.15; font-size:13px; color:#f3f6fb; } .tb-small { font-size:10px; color:var(--dim); }
.role { font-size:10px; text-transform:uppercase; letter-spacing:.8px; font-weight:700; padding-right:8px; } .role-admin { color:var(--warn); } .role-kunde { color:var(--acc); }
.tb-out { background:none !important; box-shadow:none !important; color:var(--bad) !important; border:1px solid rgba(248,113,113,.35) !important; border-radius:999px !important; padding:6px 12px !important; font-size:12px; font-weight:500; }
.tb-out:hover { background:rgba(248,113,113,.14) !important; transform:none !important; }

/* Karten / Boxen */
.card { background:linear-gradient(180deg,var(--panel),var(--panel2)); border:1px solid var(--line); border-radius:14px; padding:18px 20px;
        box-shadow:0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.03); margin-bottom:20px; }
.card > h2:first-child { margin-top:0; }
.head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--line); padding-bottom:14px; margin-bottom:20px; }
.head h1 { background:linear-gradient(90deg,#fff,#a9b8d4); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.grid { display:grid; gap:20px; } .g2 { grid-template-columns:repeat(2,minmax(0,1fr)); } .g3 { grid-template-columns:repeat(3,minmax(0,1fr)); } .g4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:900px) { .g2,.g3,.g4 { grid-template-columns:1fr; } .container { padding:16px 14px 30px; } .topbar { padding:10px 14px; } }
.boxes > .card { margin-bottom:20px; }
.kpi { display:flex; flex-direction:column; gap:2px; } .kpi b { font-size:28px; letter-spacing:-.5px; color:#fff; } .kpi span { color:var(--dim); font-size:12px; text-transform:uppercase; letter-spacing:.8px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:16px; }

/* Buttons / Eingaben */
button, .btn { display:inline-block; cursor:pointer; color:#fff; font:inherit; font-weight:600; background:linear-gradient(135deg,var(--acc),#3b6fe0); border:1px solid rgba(255,255,255,.12);
         border-radius:9px; padding:8px 16px; box-shadow:0 4px 14px rgba(76,141,255,.28); transition:transform .12s, box-shadow .15s, filter .15s; text-decoration:none; }
button:hover, .btn:hover { transform:translateY(-1px); filter:brightness(1.1); text-decoration:none; }
button:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.btn-action, button.sec, .btn.sec { background:#141b27; border:1px solid var(--line2); color:var(--txt); box-shadow:none; }
.btn-action:hover, button.sec:hover, .btn.sec:hover { border-color:var(--acc); color:#fff; }
button.danger, .btn.danger { background:rgba(248,113,113,.10); color:var(--bad); border-color:rgba(248,113,113,.38); box-shadow:none; }
button.danger:hover { background:#ef4444; color:#fff; }
button.sm { padding:4px 10px; font-size:12px; }
.btnrow { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
label { display:block; font-size:12px; color:var(--dim); margin:0 0 4px; text-transform:uppercase; letter-spacing:.6px; }
input[type=text],input[type=password],input[type=email],input[type=number],input[type=date],select,textarea {
  width:100%; font:inherit; color:#f3f6fb; background:#0b1018; border:1px solid var(--line2); border-radius:9px; padding:9px 12px; }
input:focus,select:focus,textarea:focus { border-color:var(--acc); box-shadow:0 0 0 3px rgba(76,141,255,.2); outline:none; }
input[type=checkbox] { width:17px; height:17px; accent-color:var(--acc); vertical-align:middle; }
.field { margin-bottom:14px; } .check { display:flex; align-items:center; gap:8px; color:var(--txt); text-transform:none; font-size:14px; letter-spacing:0; }
.row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; } .row > .field { flex:1 1 150px; margin-bottom:0; }
.hint { color:var(--dim); font-size:12px; margin-top:4px; }

/* Tabellen */
.tablewrap { overflow-x:auto; border:1px solid var(--line); border-radius:10px; }
table.t { width:100%; border-collapse:separate; border-spacing:0; }
table.t th { background:#151c29; color:var(--dim); text-transform:uppercase; font-size:11px; letter-spacing:.9px; text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
table.t td { padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.t tbody tr:nth-child(even) { background:rgba(255,255,255,.015); } table.t tbody tr:hover { background:rgba(76,141,255,.07); }
table.t tr.done td { color:var(--dim); } table.t td.num, table.t th.num { text-align:right; font-variant-numeric:tabular-nums; }
.badge { display:inline-block; font-size:11px; font-weight:600; padding:2px 9px; border-radius:999px; background:rgba(76,141,255,.10); color:#9db9ee; border:1px solid rgba(76,141,255,.28); }
.badge.ok { background:rgba(52,211,153,.12); color:var(--ok); border-color:rgba(52,211,153,.4); } .badge.bad { background:rgba(248,113,113,.12); color:var(--bad); border-color:rgba(248,113,113,.4); }
.badge.warn { background:rgba(251,191,36,.12); color:var(--warn); border-color:rgba(251,191,36,.4); }
.flash { padding:11px 16px; border-radius:10px; margin-bottom:16px; border:1px solid; } .flash-ok { background:rgba(52,211,153,.10); border-color:rgba(52,211,153,.4); color:#a7f3d0; }
.flash-err { background:rgba(248,113,113,.10); border-color:rgba(248,113,113,.4); color:#fecaca; } .flash-info { background:rgba(76,141,255,.10); border-color:rgba(76,141,255,.4); color:#bfd4ff; }
.selbar { position:sticky; bottom:0; display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; padding:12px 16px; margin-top:14px;
          background:rgba(18,24,35,.96); border:1px solid var(--line2); border-radius:12px; backdrop-filter:blur(8px); }

/* Dialoge */
dialog { color:var(--txt); border:1px solid var(--line2); border-radius:16px; padding:22px 24px; background:linear-gradient(180deg,#131a26,#0e131b); box-shadow:0 30px 80px rgba(0,0,0,.65); width:min(520px,94vw); }
dialog::backdrop { background:rgba(4,7,12,.72); backdrop-filter:blur(5px); }
dialog.wide { width:min(900px,96vw); }
.map { width:100%; height:420px; border-radius:12px; border:1px solid var(--line2); z-index:1; }
.map.dark .leaflet-tile-pane { filter:invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.7); }
.leaflet-container { background:#0b1018; }
.qr { background:#fff; padding:12px; border-radius:12px; display:inline-block; }
.code { font:700 30px/1.2 ui-monospace,Consolas,monospace; letter-spacing:4px; color:#fff; }
.app-footer { border-top:1px solid var(--line); color:#5b667a; padding:14px 28px; font-size:12px; text-align:center; }

/* Anmeldung: links Leiste, rechts große Karte */
.login-page { display:grid; grid-template-columns:400px 1fr; min-height:100vh; }
.login-side { display:flex; flex-direction:column; justify-content:center; gap:20px; padding:36px 34px; background:linear-gradient(180deg,#0f1520,#0a0e14); border-right:1px solid var(--line2); z-index:5; box-shadow:10px 0 40px rgba(0,0,0,.5); }
.login-side img.logo { width:230px; max-width:100%; }
.login-map { position:relative; } .login-map .map { height:100%; min-height:100vh; border:0; border-radius:0; }
.login-map .geo { position:absolute; right:14px; bottom:14px; z-index:500; background:rgba(10,14,20,.85); border:1px solid var(--line2); padding:6px 12px; border-radius:999px; font-size:12px; color:var(--dim); }
@media (max-width:860px) { .login-page { grid-template-columns:1fr; } .login-map .map { min-height:300px; height:300px; } .login-side { border-right:0; } }

/* Standarddesign: Freistellen */
.boxes { display:grid; grid-template-columns:1fr; gap:0; }
@media (min-width:1101px) { .boxes { grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 20px; align-items:start; } .box-title { grid-column:1 / -1; } .box-kpi { grid-column:1 / -1; } .box-filter { grid-column:1 / -1; } .box-list { grid-column:1 / -1; } }
.btn-small { padding:6px 12px; font-size:12px; }

input.secret { -webkit-text-security:disc; text-security:disc; }

.box-list .tablewrap table.t thead th { position:sticky; top:0; z-index:2; }
.box-list .selbar { position:static; }

/* Freigestellte Liste: Tabelle füllt die Box, Berechnung und Buttons wandern nach unten */
.fs-free .box-list .fs-grow { display:flex; flex-direction:column; overflow:hidden; }
.fs-free .box-list #expform { display:flex; flex-direction:column; flex:1; min-height:0; }
.fs-free .box-list #expform > .btnrow:first-child { flex-shrink:0; }
.fs-free .box-list .tablewrap { flex:1; min-height:0; max-height:none !important; overflow:auto; }
.fs-free .box-list .selbar { flex-shrink:0; margin-top:10px; }

.box-title { margin-bottom:14px; padding:2px 4px; }
.box-title h1 { background:linear-gradient(90deg,#fff,#a9b8d4); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }

/* Freistellen: die ganze Fensterbreite steht als Arbeitsfläche zur Verfügung */
.fs-free .container { max-width:none; padding-left:16px; padding-right:16px; }

/* Live-Serverprotokoll */
.term { background:#080c12; border:1px solid var(--line); border-radius:10px; font:12.5px/1.55 ui-monospace,Consolas,monospace; height:calc(100vh - 330px); min-height:320px; overflow:auto; padding:10px 12px; white-space:pre; }
.term .l { display:block; } .term .s2 { color:#34d399; } .term .s3 { color:#8fb6ff; } .term .s4 { color:#fbbf24; } .term .s5 { color:#f87171; }
