/* LCS – Designsprache an Triolution-CI angelehnt (kanonische Variablen, Inter, Dark default).
   Einzige Abweichung: Kontrastfarbe --accent = #9e1f31 (Triolution: #009EE1). Light/Dark via [data-theme]. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root, [data-theme="dark"] {
    --bg:         #0D0D0D;
    --surface:    #161616;
    --surface2:   #1E1E1E;
    --border:     #2A2A2A;
    --text:       #E8E8E8;
    --text-dim:   #888888;
    --text-dim2:  #666666;
    --accent:     #9E1F31;   /* LCS-Kontrastfarbe (Triolution-CI-Rolle von #009EE1) */
    --accent-fg:  #FFFFFF;
    --success:    #00C48C;
    --warning:    #F5A623;
    --danger:     #E8453C;
    --alarm:      #E8453C;
    --tint:       rgba(158, 31, 49, .22);
    --alarm-tint: rgba(232, 69, 60, .14);
    --shadow:     0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
    --radius:     6px;
    --topbar-h:   48px;
    --footer-h:   32px;
    --font:       'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg:         #F4F5F7;
    --surface:    #FFFFFF;
    --surface2:   #ECEFF2;
    --border:     #D9DEE3;
    --text:       #1B2027;
    --text-dim:   #5B6671;
    --text-dim2:  #8A949E;
    --accent:     #9E1F31;
    --accent-fg:  #FFFFFF;
    --success:    #1A9E6A;
    --warning:    #B9770A;
    --danger:     #C8362E;
    --alarm:      #C8362E;
    --tint:       rgba(158, 31, 49, .08);
    --alarm-tint: rgba(200, 54, 46, .08);
    --shadow:     0 1px 3px rgba(16,38,58,.10), 0 1px 2px rgba(16,38,58,.06);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Topbar (Triolution-Stil: 48px, Akzent-Oberkante, Marke // Tool, Text-Nav im Bar, Logout rechts) */
.topbar { position: sticky; top: 0; z-index: 100; height: var(--topbar-h); display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--surface); color: var(--text); border-top: 2px solid var(--accent); border-bottom: 1px solid var(--border); }
.topbar__brand { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.tb-sep { color: var(--text-dim2); }
.tb-tool { color: var(--accent); }
.topbar-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.navlink { padding: 6px 12px; border-radius: 4px; color: var(--text-dim); text-decoration: none; font-size: 13px; white-space: nowrap; }
.navlink:hover { background: var(--surface2); color: var(--text); }
.navlink.is-active { background: var(--surface2); color: var(--accent); }
.topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar__user { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.topbar__btn { background: transparent; border: 1px solid var(--border); color: var(--text); width: 30px; height: 30px; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.topbar__btn:hover { border-color: var(--accent); }
.topbar__logout { color: var(--text-dim); text-decoration: none; font-size: 13px; border: 1px solid var(--border); padding: 5px 10px; border-radius: 4px; }
.topbar__logout:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 560px) { .topbar { gap: 12px; padding: 0 12px; } .topbar__user { display: none; } }

.app { max-width: 1200px; margin: 0 auto; padding: 20px 20px calc(var(--footer-h) + 24px); min-height: calc(100dvh - var(--topbar-h)); }
@media (max-width: 560px) { .app { padding: 14px 12px calc(var(--footer-h) + 24px); } }
.loading { color: var(--text-dim); padding: 40px 0; text-align: center; }

.footer { height: var(--footer-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; font-size: 11px; letter-spacing: .04em; color: var(--text-dim2); border-top: 1px solid var(--border); background: var(--surface); }
.footer-mode { font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace; color: var(--text-dim); text-transform: uppercase; }

/* Karten (Triolution: flach, Sektions-Header mit Trennlinie) */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; padding-bottom: 10px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.hero h1 { margin: 0 0 4px; font-size: 20px; }
.pushbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13px; border-left: 3px solid var(--accent); }
.pushbar .btn { flex: 0 0 auto; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.fleet-grid .card { margin-bottom: 0; }
.veh-ico { border-color: #009EE1 !important; }
.muted { color: var(--text-dim); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* Buttons (Triolution: kompakt, 4px, Akzent nur für primär, Danger als Outline) */
.btn { appearance: none; border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 4px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background .1s, border-color .1s; }
.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn--primary, .btn--accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn--primary:hover, .btn--accent:hover { filter: brightness(1.1); background: var(--accent); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) { .btn { min-height: 38px; } .btn--sm { min-height: 32px; } }

/* Pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill--ok   { background: rgba(0,196,140,.16); color: var(--success); }
.pill--warn { background: rgba(245,166,35,.16); color: var(--warning); }
.pill--live { background: rgba(0,196,140,.16); color: var(--success); cursor: pointer; }
.pill--live:hover { background: rgba(0,196,140,.30); }
.live-map { height: 60vh; min-height: 340px; border-radius: var(--radius); overflow: hidden; }
.pill--err  { background: rgba(232,69,60,.16); color: var(--danger); }
.pill--muted { background: var(--surface2); color: var(--text-dim); }

/* Eingaben (Triolution: kompakt, surface2, Labels klein/uppercase) */
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; min-height: 64px; }
input[type=file] { padding: 6px; }
label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 12px 0 4px; }
@media (pointer: coarse) { input, select, textarea { min-height: 40px; } }

/* (Navigation liegt jetzt als .topbar-nav/.navlink in der Topbar) */
/* „Mehr"-Menü (fixed, damit es nicht vom horizontal scrollenden .topbar-nav geclippt wird) */
.navmore { position: relative; display: inline-flex; }
.navmore__btn { cursor: pointer; border: 0; background: none; font: inherit; }
.navmore__panel { position: fixed; top: calc(var(--topbar-h) + 2px); right: 12px; min-width: 210px; max-height: 80vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.45); padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 500; }
.navmore.is-open .navmore__panel { display: flex; }
.navmore__panel .navlink { display: block; padding: 9px 12px; border-radius: 4px; font-size: 14px; }
.navmore__panel .navlink:hover { background: var(--surface2); }
.navmore__sep { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); padding: 10px 12px 3px; border-top: 1px solid var(--border); margin-top: 4px; }

/* Schnellzugriff-Kacheln auf der Startseite */
.quickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quicktile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: 13px; text-align: center; transition: border-color .12s, transform .12s; }
.quicktile:hover { border-color: var(--accent); transform: translateY(-1px); }
.quicktile__ic { font-size: 26px; line-height: 1; }

/* Arbeitsplatz-Code (Authenticator) */
.wscode__code { font-size: 42px; font-weight: 800; letter-spacing: 8px; color: var(--accent); font-variant-numeric: tabular-nums; text-align: center; padding: 6px 0; }

/* Listenzeilen */
.lrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lrow:last-child { border-bottom: 0; }
.lrow__title { font-weight: 600; }
.lrow__act { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

/* Mein Plan: Kalender (Tag/Woche) */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
@media (max-width: 760px) { .cal-grid { grid-template-columns: 1fr; } }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 88px; }
.cal-day--today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day__h { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.cal-item { background: var(--surface2); border-left: 3px solid var(--accent); border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; font-size: 13px; cursor: pointer; }
.cal-item:hover { filter: brightness(1.12); }
.cal-item--alarm { border-left-color: var(--danger); }

/* Fahrzeug-Auslastung (Gantt) */
.gantt { overflow-x: auto; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: center; }
.gantt-row { border-top: 1px solid var(--border); min-height: 40px; }
.gantt-row__label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.gantt-day { font-size: 11px; color: var(--text-dim); text-align: center; padding: 2px 0; }
.gantt-day--today { color: var(--accent); font-weight: 700; }
.gantt-track { position: relative; height: 26px; border-radius: 4px; background-color: var(--surface2); background-image: repeating-linear-gradient(90deg, transparent, transparent calc(100% / 7 - 1px), var(--border) calc(100% / 7 - 1px), var(--border) calc(100% / 7)); }
.gantt-bar { position: absolute; top: 3px; height: 20px; min-width: 4px; background: var(--accent); border-radius: 3px; color: #fff; font-size: 11px; line-height: 20px; padding: 0 5px; overflow: hidden; white-space: nowrap; box-sizing: border-box; }
.gantt-bar--done { background: var(--text-dim2); }
.gantt-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--danger); z-index: 2; }

/* Standortfreigabe-Anfrage (Helfer-Feed) */
.taskwrap { border-bottom: 1px solid var(--border); }
.taskwrap:last-child { border-bottom: 0; }
.taskwrap .lrow { border-bottom: 0; }
.locreq { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 10px; padding: 8px 10px; border-radius: var(--radius);
    background: var(--surface2); border-left: 3px solid var(--accent); }
.locreq__txt { font-size: 13px; font-weight: 500; }
.locreq__act { display: flex; gap: 6px; flex-wrap: wrap; }

/* Checkboxen */
.checks { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.check input { width: auto; min-height: auto; }
.checks--row { flex-direction: row; flex-wrap: wrap; max-height: none; gap: 6px 14px; }

/* Modal */
.modal__overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 20px; z-index: 2000; overflow: auto; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 480px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal__head h2 { margin: 0; font-size: 17px; }
.modal__x { background: transparent; border: 0; font-size: 20px; cursor: pointer; color: var(--text-dim); width: auto; min-height: auto; padding: 4px 8px; }
.modal__body { padding: 16px; }

/* QR */
.qrbox { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); }
.qr svg { width: 220px; height: 220px; display: block; }

/* Notice */
.notice { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--surface2); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: var(--radius); font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; z-index: 2200; max-width: 90vw; text-align: center; }
.notice.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notice--ok { background: var(--success); color: #04231a; border-color: var(--success); }
.notice--warn { background: var(--warning); color: #2a1d00; border-color: var(--warning); }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-top: 12px; }
.tab { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; color: var(--text); }
.tab.is-active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Board */
.board2, .board4 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .board2 { grid-template-columns: 1fr 1fr; } .board4 { grid-template-columns: repeat(4, 1fr); } .app { padding-top: 22px; } }
.bcol { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.bcol h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-dim); }
.col__list { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.tcard { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px; cursor: grab; }
.tcard--alarm { border-left-color: var(--alarm); background: var(--alarm-tint); }
.tcard__t { font-weight: 700; margin-bottom: 5px; }
.tcard__due { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.tcard__as { font-size: 12px; color: var(--accent); margin-top: 4px; }
.helper-drop { display: flex; flex-direction: column; gap: 2px; background: var(--surface2); border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px; min-height: 48px; }
.helper-name { font-weight: 600; }
.helper-meta { font-size: 12px; color: var(--text-dim); }
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: 0 0 0 2px var(--accent); }

/* Ersthelfer-Alarm */
.alarmcard { border: 2px solid var(--alarm); }
.alarm-ov { position: fixed; inset: 0; background: rgba(120,10,5,.92); display: flex; align-items: center; justify-content: center; padding: 22px; z-index: 3000; }
.alarm-box { background: var(--surface); color: var(--text); border-radius: 14px; max-width: 420px; width: 100%; padding: 22px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5); border-top: 4px solid var(--alarm); }
.alarm-h { color: var(--alarm); font-weight: 800; letter-spacing: .04em; font-size: 15px; }
.alarm-t { font-size: 22px; font-weight: 800; margin: 10px 0 4px; }
.alarm-z { color: var(--text-dim); margin-bottom: 14px; }
.alarm-act { display: flex; flex-direction: column; gap: 10px; }
.alarm-dis { font-size: 12px; color: var(--text-dim2); margin: 14px 0 0; }
.inc-flash-map { height: 240px; border-radius: var(--radius); overflow: hidden; margin: 6px 0; }

/* Notfall-Button (FAB, alle Helfer) */
.notfall-fab { position: fixed; right: 18px; bottom: 18px; z-index: 1500; width: 60px; height: 60px; border-radius: 50%; border: none;
  background: var(--danger); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 6px 20px rgba(232,69,60,.5);
  display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.notfall-fab:hover { transform: scale(1.06); }
.notfall-fab:active { transform: scale(.96); }
@media (pointer: coarse) { .notfall-fab { width: 64px; height: 64px; bottom: 22px; } }

/* Einsatz-Telefon (Melder) */
.melder-mine { border-left: 4px solid var(--success); }
.melder-open { border-left: 4px solid var(--danger); }

/* Protokoll */
.logtbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.logtbl td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.logtbl .logts { color: var(--text-dim); white-space: nowrap; }

/* Chat */
.chat-thread { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; padding: 10px 0; }
.msg { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; max-width: 85%; align-self: flex-start; }
.msg--mine { align-self: flex-end; background: var(--tint); border-color: var(--accent); }
.msg__meta { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.msg__body { white-space: pre-wrap; word-break: break-word; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }

/* Dashboard (Lagebild) */
.dash-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.dash-title { font-size: 24px; font-weight: 800; }
.dash-clock { font-size: 24px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dash-canvas { position: relative; flex: 1; min-height: 320px; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--border) 1.2px, transparent 1.2px); background-size: 24px 24px; border: 1px solid var(--border); border-radius: var(--radius); touch-action: none; cursor: grab; user-select: none; }
.dash-canvas.is-grabbing { cursor: grabbing; }
.dash-canvas.is-edit { cursor: default; }
.dash-canvas__inner { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.dash-canvas .dash-tile { position: absolute; user-select: none; }
.dash-canvas .dash-tile--map { min-height: 0; }
.tile-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 45%, var(--accent) 45%); border-bottom-right-radius: var(--radius); z-index: 6; }
.dash-guide { position: absolute; background: var(--accent); z-index: 5; pointer-events: none; opacity: .85; display: none; }
.dash-guide--v { top: -1000px; height: 4000px; width: 1.5px; }
.dash-guide--h { left: -1000px; width: 4000px; height: 1.5px; }
/* Dashboard-Widgets: Aufgaben-Tabelle + Fahrzeuge */
.dash-tile__h--row { display: flex; justify-content: space-between; align-items: center; }
.dash-cogbtn { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.dash-cogbtn:hover { color: var(--accent); }
.dash-tablewrap { flex: 1; min-height: 0; overflow: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { position: sticky; top: 0; background: var(--surface2); text-align: left; padding: 6px 8px; cursor: pointer; white-space: nowrap; user-select: none; color: var(--text-dim); font-weight: 600; z-index: 1; }
.dash-table th:hover { color: var(--text); }
.dash-table td { padding: 5px 8px; border-top: 1px solid var(--border); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.dash-table tr.is-alarm td { color: var(--danger); }
.dash-vrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.dash-vrow:first-child { border-top: 0; }
.dash-vrow strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Dashboard nutzt die volle Fläche; Kacheln füllen die Höhe */
.app--full { max-width: none; }
.dash-view { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h) - var(--footer-h) - 40px); }
.dash-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: relative; }
.dash-tile--alarm { border: 2px solid var(--alarm); background-color: var(--surface); background-image: linear-gradient(var(--alarm-tint), var(--alarm-tint)); }
.dash-tile--warn { border: 2px solid var(--warning); }
.dash-tile--crit { border: 2px solid var(--alarm); background-color: var(--surface); background-image: linear-gradient(var(--alarm-tint), var(--alarm-tint)); animation: dashPulse 1.4s ease-in-out infinite; }
.dash-tile--crit .dash-warn { color: var(--alarm); }
@keyframes dashPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 69, 60, 0); }
    50% { box-shadow: 0 0 0 7px rgba(232, 69, 60, .30); border-color: #ff6b60; }
}
@media (prefers-reduced-motion: reduce) { .dash-tile--crit { animation: none; } }
.dash-tile__h { flex: 0 0 auto; font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.dash-big { font-size: 46px; font-weight: 800; line-height: 1; }
.dash-sub { color: var(--text-dim); margin-top: 6px; font-size: 15px; }
.dash-ok { color: var(--success); font-weight: 600; }
/* Inhalt füllt die Kachel + wird zentriert (Höhe-Füllen lässt sonst Leerraum) */
.dash-tile > .dash-ok, .dash-tile > .muted { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
.dash-wx { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.dash-list { flex: 1; min-height: 0; overflow: auto; }
.dash-warns { display: flex; flex-direction: column; gap: 6px; }
.dash-warn { color: var(--warning); font-weight: 700; }
.dash-tile--alarm .dash-warn { color: var(--alarm); }
.dash-inc { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dash-inc:last-child { border-bottom: 0; }
.dash-inc__m { color: var(--text-dim); font-size: 13px; }
.dash-stats { display: flex; flex: 1; gap: 16px; flex-wrap: wrap; justify-content: space-evenly; align-items: center; }
.dash-stat { text-align: center; }
.dash-stat__n { font-size: 40px; font-weight: 800; line-height: 1; }
.dash-stat__l { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.dash-stat--alarm .dash-stat__n { color: var(--alarm); }
.dash-feed { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow: auto; }
.dash-feed__i { display: flex; gap: 8px; font-size: 14px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.dash-feed__i:last-child { border-bottom: 0; }
.dash-feed__i--click { cursor: pointer; border-radius: 4px; margin: -2px -4px; padding: 2px 4px 5px; transition: background .12s; }
.dash-feed__i--click:hover { background: var(--surface2); }
.dash-feed__t { color: var(--text-dim); white-space: nowrap; flex: 0 0 auto; font-weight: 600; }

/* Widget-Konfigurator */
.wlist { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.wrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface2); border-radius: var(--radius); }
.wrow__h { cursor: grab; color: var(--text-dim); font-size: 16px; user-select: none; }
.wrow .check { margin: 0; }

/* Live-Karte (Leaflet) */
.dash-tile--map { min-height: 260px; }
.plan-map { height: 60vh; min-height: 360px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); isolation: isolate; }
.mp-ico { display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--accent); border-radius: 50%; font-size: 16px; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.dash-map { flex: 1; min-height: 220px; border-radius: var(--radius); overflow: hidden; isolation: isolate; }
.dash-map .leaflet-control a, .dash-map .leaflet-popup-content-wrapper, .dash-map .leaflet-popup-tip { color: #1b2027; }

/* Dashboard-Editor (Anordnen) */
.dash-tile.is-edit { outline: 1px dashed var(--accent); outline-offset: -1px; }
.tile-edit { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 3px; z-index: 5; }
.tile-drag { cursor: grab; padding: 2px 6px; color: var(--text-dim); user-select: none; }
.tile-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 3px; font-size: 12px; line-height: 1; padding: 3px 6px; cursor: pointer; }
.tile-btn:hover { border-color: var(--accent); }
.tile-btn--x { color: var(--danger); }
.sortable-ghost { opacity: .4; }
.sortable-chosen { outline: 2px solid var(--accent); }

/* Vollbild: Topbar/Footer ausblenden, Dashboard nutzt den ganzen Screen */
html:fullscreen .topbar, html:fullscreen .footer { display: none; }
html:fullscreen .app { padding: 12px; }
html:fullscreen .dash-view { height: calc(100dvh - 24px); }
/* Kiosk-Display-Modus (?kiosk=token): Vollbild ohne Topbar/Footer */
html.is-kiosk .topbar, html.is-kiosk .footer { display: none; }
html.is-kiosk .dash-view { height: 100dvh; }
