/* DARU-Patrol · Portal-Schicht: Aufbau wie SequriX (Menü oben, Suchbereich links, Block-Überschriften), hochwertiger gestaltet. */

body { background: #eef1f1; }

/* Kopf */
.topnav { background: linear-gradient(180deg, #232524 0%, #1a1b1a 100%); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06); padding: 12px 28px 0; align-items: flex-end; }
.topnav .logo { padding-bottom: 14px; }
.menu { gap: 2px; }
.menu a { padding: 2px 12px 12px; border-bottom-width: 3px; color: #c9d1d1; font-size: 10.5px; letter-spacing: .08em; }
.menu a i { width: 48px; height: 48px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.menu a:hover { color: #fff; }
.menu a.on i { background: linear-gradient(160deg, #10a6b6, #007886); box-shadow: 0 6px 16px -6px rgba(0, 143, 159, .7); }
.firms { padding-bottom: 18px; }
.subbar { background: linear-gradient(90deg, #00707c 0%, #008f9f 100%); padding: 10px 28px; box-shadow: 0 6px 18px -12px rgba(0, 60, 66, .6); }
.backbtn { box-shadow: 0 4px 10px -4px rgba(120, 20, 10, .6); }
.crumbs h1 { font-size: 26px; font-weight: 600; letter-spacing: .015em; }
.user { display: flex; align-items: center; gap: 10px; color: #e3f4f6; font-size: 12.5px; }
.user b { color: #fff; font-weight: 600; }
.user .btn-sub { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); color: #fff; padding: 6px 14px; border-radius: 6px; font-weight: 600; font-size: 12px; text-decoration: none; }
.page { padding: 24px 28px 48px; max-width: 1680px; }

/* Block-Überschrift wie SequriX (Balken links), in DARU-Rot */
.bh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.bh h2, .bh h3 { margin: 0; font: 700 15px/1.2 var(--f-body); letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.bh h2::before, .bh h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--red); flex: none; }
.bh .x { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; border-radius: 6px; }
.bh .x:hover { background: var(--paper); color: var(--ink); }
.bh .count { font: 600 11px/1 var(--f-mono); color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; }
.blk { background: var(--surface); border: 1px solid #dfe5e6; border-radius: 12px; box-shadow: 0 1px 2px rgba(20, 30, 30, .04), 0 10px 30px -18px rgba(20, 40, 40, .25); min-width: 0; overflow: hidden; }
.blk .body { padding: 16px 18px; }
.blk .tbl th { background: #f7f9f9; position: sticky; top: 0; z-index: 1; }
.blk .tbl td { padding: 9px 14px; }
.tbl td.num { white-space: nowrap; }
.blk .scroll { max-height: 320px; overflow: auto; }

/* Startseite: Widget-Raster wie SequriX */
.dash-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: start; }
.w-12 { grid-column: span 12; } .w-8 { grid-column: span 8; } .w-6 { grid-column: span 6; } .w-4 { grid-column: span 4; }
.kpibar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.kpibar > div { padding: 16px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.kpibar > div:last-child { border-right: 0; }
.kpibar .v { font: 700 34px/1 var(--f-display); }
.kpibar .l { font-size: 12.5px; color: var(--muted); }
.kpibar .v.red { color: var(--red); } .kpibar .v.petrol { color: var(--petrol); } .kpibar .v.amber { color: var(--amber); }
.live { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--f-body); color: var(--green); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.prog { height: 6px; background: var(--paper); border-radius: 99px; overflow: hidden; min-width: 80px; }
.prog span { display: block; height: 100%; background: var(--petrol); border-radius: 99px; }
.empty-sm { padding: 18px; color: var(--muted); font-style: italic; }

/* KPI-Dashboard mit Diagrammen (Kunden, Objekte) */
.kpi-dash { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 0; }
.kpi-dash > div { padding: 18px 20px; border-right: 1px solid var(--line); min-width: 0; }
.kpi-dash > div:last-child { border-right: 0; }
.kpi-list { display: flex; flex-direction: column; gap: 14px; }
.kpi-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kpi-list span { color: var(--muted); font-size: 13px; }
.kpi-list b { font: 700 24px/1 var(--f-display); }
.chart-t { font: 600 12.5px/1.3 var(--f-body); margin-bottom: 10px; }
.chart-t small { display: block; font-weight: 400; color: var(--muted); }
.donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut { width: 130px; height: 130px; flex: none; }
.lg { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; min-width: 0; }
.lg span { display: flex; align-items: center; gap: 8px; }
.lg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 140px 36px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .t { height: 10px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.hbar .t span { display: block; height: 100%; background: linear-gradient(90deg, #00a3b5, var(--petrol-600)); border-radius: 99px; }
.hbar .c { font: 600 12px/1 var(--f-mono); text-align: right; }
.hint-start { padding: 14px 18px; color: var(--muted); font-size: 14px; }

/* Suchbereich links */
.panel { background: var(--surface); border-color: #dfe5e6; box-shadow: 0 10px 30px -20px rgba(20, 40, 40, .3); overflow: hidden; }
.panel .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line); }
.panel .tabs a { padding: 11px 8px; text-align: center; text-decoration: none; font: 600 12.5px/1 var(--f-body); color: var(--muted); border-bottom: 3px solid transparent; }
.panel .tabs a.on { color: var(--ink); border-bottom-color: var(--petrol); background: #f7fbfb; }
.panel h3 { font: 700 13px/1 var(--f-body); letter-spacing: .02em; text-transform: none; border-left: 0; padding-left: 0; display: flex; align-items: center; gap: 10px; }
.panel h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--red); }
.panel section { padding: 16px 18px; gap: 11px; }
.panel .field { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 8px; }
.panel .field label { font-weight: 500; font-size: 12.5px; color: var(--ink); }
.panel .field.stack { grid-template-columns: minmax(0, 1fr); }
.panel .inp { padding: 7px 9px; font-size: 13px; background: #fbfcfc; }
.checklist { max-height: 168px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; background: #fbfcfc; }
.checklist label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.checklist input { accent-color: var(--petrol); }
.panel .btn.search { background: var(--petrol); width: 100%; justify-content: center; padding: 9px; }
.panel .acts { display: flex; flex-direction: column; gap: 8px; }

/* Detail-Dashboard (wie SequriX: Blöcke untereinander, zweispaltig) */
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.dgrid .full { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 7px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.kv .sp { grid-column: 1 / -1; height: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.note-box { border-left: 3px solid var(--amber); background: var(--amber-050); padding: 10px 12px; border-radius: 6px; font-size: 13.5px; }

/* Plantafel */
.unpl { max-height: 230px; overflow: auto; }
.unpl tr.sel td { background: var(--petrol-050); }
.board-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board { overflow: auto; position: relative; }
.tl { position: relative; min-width: 100%; }
.tl-head { display: grid; position: sticky; top: 0; z-index: 3; background: #f7f9f9; border-bottom: 1px solid var(--line); }
.tl-row { display: grid; border-bottom: 1px solid var(--line); min-height: 46px; }
.tl-row:hover { background: #fbfdfd; }
.tl-row.drop { background: var(--petrol-050); }
.tl-lbl { position: sticky; left: 0; z-index: 2; background: inherit; background-color: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 12.5px; }
.tl-head .tl-lbl { background: #f7f9f9; font: 600 11px/1 var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tl-lbl b { font-weight: 600; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tl-lbl small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tl-lbl a { text-decoration: none; }
.tl-track { position: relative; }
.tl-hours { display: flex; height: 100%; }
.tl-hours span { flex: 1; border-left: 1px solid var(--line); font: 600 10.5px/1 var(--f-mono); color: var(--muted); padding: 8px 0 6px 4px; }
.tl-hours span.mid { color: var(--ink); border-left-color: var(--line-2); }
.tl-grid { position: absolute; inset: 0; display: flex; pointer-events: none; }
.tl-grid span { flex: 1; border-left: 1px solid #eef2f2; }
.tl-shift { position: absolute; top: 7px; bottom: 7px; border-radius: 8px; background: repeating-linear-gradient(135deg, #f1f6f6 0 6px, #e9f1f2 6px 12px); border: 1px solid #d6e3e5; }
.tl-task { position: absolute; top: 11px; bottom: 11px; border-radius: 5px; background: var(--petrol); color: #fff; font: 600 10.5px/1 var(--f-mono); display: flex; align-items: center; padding: 0 5px; overflow: hidden; white-space: nowrap; box-shadow: 0 2px 6px -2px rgba(0, 80, 90, .5); cursor: pointer; text-decoration: none; }
.tl-task.late { background: var(--red); box-shadow: 0 2px 6px -2px rgba(150, 30, 20, .5); }
.tl-task.single { background: #2b3d8f; }
.tl-win { position: absolute; top: 4px; height: 3px; background: rgba(0, 143, 159, .35); border-radius: 2px; }
.tl-drive { position: absolute; top: 50%; height: 2px; background: #9aa6a8; transform: translateY(-1px); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; }
.tl-ghost { position: absolute; top: 9px; bottom: 9px; border-radius: 5px; border: 2px dashed var(--petrol); background: rgba(0, 143, 159, .1); }
.sugg-list { display: flex; flex-direction: column; gap: 8px; }
.sugg-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.sugg-item.best { border-color: var(--petrol); background: var(--petrol-050); }

/* Einstellungen wie SequriX: gruppierte Liste */
.set-groups { display: flex; flex-direction: column; }
.set-groups .g { padding: 12px 18px; border-top: 1px solid var(--line); }
.set-groups .g:first-child { border-top: 0; }
.set-groups .g h4 { margin: 0 0 6px; font: 700 11px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.set-groups a { display: block; padding: 6px 10px; border-radius: 6px; text-decoration: none; font-size: 13.5px; }
.set-groups a:hover { background: var(--paper); }
.set-groups a.on { background: var(--petrol-050); color: var(--petrol-600); font-weight: 600; }

@media (max-width: 1200px) {
  .w-8, .w-6, .w-4 { grid-column: span 12; }
  .kpibar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-dash { grid-template-columns: minmax(0, 1fr); }
  .kpi-dash > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .dgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .topnav { padding: 8px 12px 0; }
  .topnav .logo { padding-bottom: 6px; }
  .firms { padding-bottom: 6px; }
  .subbar { padding: 8px 12px; }
  .page { padding: 16px 12px 40px; }
  .kpibar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .hbar { grid-template-columns: minmax(0, 1fr) 90px 30px; }
  .user .who { display: none; }
}

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Ziehen aus „Ungeplante Aufgaben“ auf die Plantafel */
.drag-src { cursor: grab; touch-action: none; user-select: none; }
.grip { color: var(--faint); font-size: 16px; line-height: 1; cursor: grab; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; background: var(--ink); color: #fff; padding: 9px 12px; border-radius: 10px; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45); font-size: 12.5px; max-width: 320px; will-change: transform; display: flex; flex-direction: column; gap: 3px; }
.drag-ghost small { font: 600 11px/1.3 var(--f-mono); color: #b9c2c2; }
.drag-ghost small.ok { color: #7fe0a0; }
.drag-ghost small.bad { color: #ff9a8f; }
.tl-row.drop-cand .tl-lbl { box-shadow: inset 3px 0 0 var(--petrol); }
.tl-row.drop-ok { background: var(--petrol-050); }
.tl-row.drop-ok .tl-lbl { background: var(--petrol-050); }
.tl-row.drop-bad { background: var(--red-050); }
.tl-row.drop-bad .tl-lbl { background: var(--red-050); }
.tl-row .tl-ghost { animation: none; }

/* Kopfbild (daru.ch), ruhig: entsättigt, Anthrazit-Verlauf, keine Animation */
.hero { position: relative; height: 128px; background: #1d1d1b; overflow: hidden; }
.hero.big { height: 176px; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--img) center 38% / cover no-repeat; filter: saturate(.55) contrast(.95) brightness(.95); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(24, 26, 25, .94) 0%, rgba(24, 26, 25, .82) 34%, rgba(0, 72, 80, .38) 70%, rgba(0, 72, 80, .18) 100%); }
.hero-in { position: relative; z-index: 1; height: 100%; max-width: 1680px; margin: 0 auto; padding: 0 28px; display: flex; flex-direction: column; justify-content: center; gap: 4px; color: #fff; }
.hero .kicker { font: 600 11px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: #8fd3db; }
.hero h2 { margin: 0; font: 600 30px/1.1 var(--f-display); letter-spacing: .01em; }
.hero.big h2 { font-size: 38px; }
.hero p { margin: 0; max-width: 560px; color: rgba(255, 255, 255, .78); font-size: 13.5px; }
.hero:not([hidden]) + .page { margin-top: -28px; position: relative; z-index: 2; }

/* Ruhigere Flächen */
.panel { background: #fff; border-color: #dfe5e6; box-shadow: 0 1px 2px rgba(20, 30, 30, .04), 0 10px 30px -20px rgba(20, 40, 40, .25); }
.panel section + section { border-top-color: #edf1f1; }
.blk { border-radius: 10px; box-shadow: 0 1px 2px rgba(20, 30, 30, .035), 0 8px 24px -18px rgba(20, 40, 40, .22); }
.bh h2::before, .bh h3::before { width: 3px; height: 16px; }
.panel .tabs.vert { grid-auto-flow: row; grid-auto-columns: auto; padding: 6px 0; }
.panel .tabs.vert a { text-align: left; padding: 10px 18px; border-bottom: 0; border-left: 3px solid transparent; }
.panel .tabs.vert a.on { border-left-color: var(--red); background: #f3f8f8; }
.panel .tabs.vert a:hover { color: var(--ink); background: #f7fafa; }
@media (max-width: 760px) { .hero, .hero.big { height: 112px; } .hero h2, .hero.big h2 { font-size: 26px; } .hero p { display: none; } .hero:not([hidden]) + .page { margin-top: 0; } }

/* Alarm-Ablauf */
.flow { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-step { padding: 7px 12px; border-radius: 8px; background: #f1f4f4; color: var(--faint); font: 600 12.5px/1 var(--f-body); }
.flow-step.done { background: var(--petrol-050); color: var(--petrol-600); }
.flow-step.cur { background: var(--ink); color: #fff; }

/* Menü kompakt, damit alle SequriX-Module nebeneinander Platz haben */
.topnav { gap: 12px; padding-left: 22px; padding-right: 22px; }
.menu { gap: 0; }
.menu a { min-width: 0; padding: 2px 7px 12px; font-size: 10px; letter-spacing: .05em; }
.menu a i { width: 42px; height: 42px; }
.menu a svg { width: 21px; height: 21px; }
@media (max-width: 1360px) { .logo-t small { display: none; } .menu a { padding: 2px 5px 12px; font-size: 9.5px; letter-spacing: .03em; } .menu a i { width: 38px; height: 38px; } }

/* Karte */
.map-el { height: 520px; background: #e8eded; }
.map-el .leaflet-container, .map-el.leaflet-container { font: inherit; }

/* Berichte drucken */
.print-head { display: none; }
@media print {
  .topnav, .subbar, .hero, .panel, .toast, .modal-back { display: none !important; }
  .page { padding: 0; max-width: none; }
  .layout { display: block; }
  .print-head { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; }
  .blk { box-shadow: none; border: 0; }
  .blk .tbl th { position: static; }
  body { background: #fff; }
}

/* Lange Einstellungsliste scrollt in sich */
.panel:has(.set-groups) { max-height: calc(100vh - 32px); overflow: auto; }

/* Live-Karte auf der Startseite */
.live-map { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.live-map .map-el { height: 380px; }
.live-list { border-left: 1px solid var(--line); max-height: 380px; overflow: auto; }
.live-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.live-list a:hover { background: #f7fafa; }
.live-list a span { font-size: 12px; color: var(--muted); }
.emp-tip { background: rgba(29, 29, 27, .86); color: #fff; border: 0; border-radius: 6px; padding: 3px 7px; font: 600 11.5px/1.2 var(--f-body); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.emp-tip::before { display: none; }
@media (max-width: 900px) { .live-map { grid-template-columns: 1fr; } .live-list { border-left: 0; border-top: 1px solid var(--line); max-height: 220px; } .live-map .map-el { height: 300px; } }

/* Menü und Titelleiste immer sichtbar */
.appbar { position: sticky; top: 0; z-index: 1200; }
.panel { top: calc(var(--hdr, 0px) + 16px); }
.panel:has(.set-groups) { max-height: calc(100vh - var(--hdr, 0px) - 32px); }
html { scroll-padding-top: calc(var(--hdr, 0px) + 12px); }
body { height: auto; min-height: 100%; }

/* Logo: Kontrollpunkt-Sechseck (Vorschlag 5) */
.logo svg { width: 40px; height: 40px; }
.logo .logo-hex { fill: none; stroke: #e8eceb; stroke-width: 3.2; stroke-linejoin: round; }
.logo .logo-check { fill: none; stroke: var(--petrol); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.logo .logo-dot { fill: var(--red); }

/* Schichtmuster-Tafel */
.pb-list { max-height: 330px; overflow: auto; }
.pb-list.drop-out { outline: 2px dashed var(--red); outline-offset: -2px; }
.pb-list.drop-out.hover { background: var(--red-050); }
.pb-item { cursor: grab; user-select: none; }
.pb-item.sel td { background: var(--petrol-050); }
.pb-item td.grip { color: var(--faint); width: 22px; font-size: 16px; }
.pb-bar { cursor: grab; user-select: none; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.pb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .pb-grid { grid-template-columns: 1fr; } }
.ai-box .bh h3::before { background: var(--petrol); }
.ai-h { margin: 14px 0 6px; font: 700 13px/1.2 var(--f-body); }
.mini-days { display: inline-flex; gap: 2px; }
.mini-days i { font: 600 10px/16px var(--f-mono); width: 16px; text-align: center; border-radius: 3px; color: #b7c0c1; font-style: normal; }
.mini-days i.on { background: var(--petrol-050); color: var(--petrol-600); }
.mini-days i.cur { outline: 1px solid var(--ink); }
.seg.wd { display: grid; grid-template-columns: repeat(7, 1fr); }
.seg.wd button { padding: 6px 0; }
.tl-row.drop-ok { background: var(--green-050); }
.tl-row.drop-bad { background: var(--red-050); }
.tl-row.drop-same { opacity: .7; }
.tl-row.hover { box-shadow: inset 0 0 0 2px var(--ink); }
.drag-ghost[data-info]:not([data-info=""])::after { content: attr(data-info); display: block; font: 500 11px/1.3 var(--f-body); opacity: .85; margin-top: 2px; }

/* über der festen Menüleiste */
.drag-ghost { z-index: 3000; }
.modal-back { z-index: 2500; }
.toast { z-index: 2600; }
.pb-bar { font-size: 10px; padding: 0 4px; justify-content: center; }

/* KI-Hilfe: Symbol in der Titelleiste und Seitenleiste */
.ai-slot { margin-left: auto; display: flex; }
.ai-slot:empty { display: none; }
.ai-slot + .subbar-right { margin-left: 0; }
.ai-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; border-radius: 99px; padding: 5px 12px 5px 9px; font: 600 12.5px/1 var(--f-body); cursor: pointer; transition: background .15s; }
.ai-btn svg { width: 17px; height: 17px; fill: #fff; }
.ai-btn b { background: var(--red); color: #fff; border-radius: 99px; font: 700 11px/1 var(--f-mono); padding: 3px 6px; }
.ai-btn:hover { background: rgba(255, 255, 255, .22); }
.ai-btn.on { background: #fff; color: var(--petrol-600); }
.ai-btn.on svg { fill: var(--petrol); }
.ai-drawer { position: fixed; right: 0; top: var(--hdr, 0px); bottom: 0; width: 380px; max-width: 100vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -18px 0 40px -24px rgba(0, 40, 45, .45); z-index: 1100; display: flex; flex-direction: column; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #e6f4f5, #fff); }
.ai-head h3 { margin: 0; font: 700 15px/1.2 var(--f-body); flex: 1; }
.ai-head .ai-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--petrol); display: grid; place-items: center; }
.ai-head .ai-ic svg { width: 17px; height: 17px; fill: #fff; }
.ai-head .x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.ai-head .x:hover { background: var(--paper); color: var(--ink); }
.ai-body { padding: 16px; overflow: auto; flex: 1; }
@media (min-width: 1300px) { body.ai-open .page { padding-right: 404px; } }

/* Tafel: Zeitachse, Editor-Abschnitt, KI-Kennzahlen */
.pb-h { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding: 8px 0 6px 4px; font: 600 10.5px/1 var(--f-mono); color: var(--muted); }
.pb-h.mid { color: var(--ink); border-left-color: var(--line-2); }
.pb-g { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef2f2; pointer-events: none; }
.tl-row.focus { background: #f6fbfb; }
.tl-row.focus .tl-lbl { box-shadow: inset 3px 0 0 var(--petrol); }
.pb-item.mine td { background: #f3f6f6; }
.pb-tools { display: grid; grid-template-columns: repeat(4, minmax(0, auto)) 1fr; gap: 14px 20px; align-items: end; border-bottom: 1px solid var(--line); }
.pb-tools .field { margin: 0; }
.pb-tools .seg.wd { min-width: 260px; }
.pb-rules { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.pb-rules .field { max-width: 200px; }
@media (max-width: 1100px) { .pb-tools { grid-template-columns: 1fr 1fr; } }
.ai-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ai-stat div { background: #f5f8f8; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.ai-stat b { font: 700 24px/1 var(--f-display); }
.ai-stat b.red { color: var(--red); }
.ai-stat span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }

/* Aufgaben im Muster: geplante Zeiten */
.plan-cell { white-space: nowrap; }
.plan-cell b { display: block; font-weight: 600; }
.plan-cell small { display: block; color: var(--muted); font-size: 11px; font-family: var(--f-body); }
.red-t { color: var(--red); font-weight: 700; }
.seg.wd.sm { display: inline-grid; grid-template-columns: repeat(7, auto); }
.seg.wd.sm button { padding: 4px 7px; font-size: 11px; }
.seg button:disabled { opacity: .35; cursor: default; }

/* Nachkalkulation */
.nk-head { display: flex; gap: 40px; flex-wrap: wrap; }
.nk-head > div { display: flex; flex-direction: column; gap: 2px; }
.nk-t { font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nk-flat, .nk-rate { font: 700 30px/1.1 var(--f-display); }
.nk-head small, .nk-card small { color: var(--muted); font-size: 12px; }
.nk-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.nk-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: #fbfcfc; }
.nk-m { font: 700 28px/1.1 var(--f-display); color: var(--green); }
.nk-m.neg { color: var(--red); }
.nk-p { font-size: 12.5px; color: var(--muted); }
.nk-card dl { display: grid; grid-template-columns: auto auto; gap: 3px 12px; margin: 8px 0 4px; font-size: 13px; }
.nk-card dt { color: var(--muted); }
.nk-card dd { margin: 0; text-align: right; font-family: var(--f-mono); }
.amber-t { color: var(--amber); font-weight: 700; }
@media (max-width: 900px) { .nk-cards { grid-template-columns: 1fr; } }

/* Formulare in Abschnitten (SequriX) */
.fsec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 32px; }
.fsec { display: flex; flex-direction: column; gap: 10px; }
.fsec > b { font: 700 13px/1.2 var(--f-body); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fwrap small { display: block; font-size: 11.5px; margin-top: 2px; }

/* Fahrzeiten Objekt zu Objekt */
.legs { list-style: none; margin: 8px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--petrol-100); font-size: 12.5px; }
.legs li { position: relative; padding: 3px 0 3px 10px; display: flex; flex-direction: column; }
.legs li b { font-weight: 600; }
.legs li .muted { font-size: 11.5px; }
.legs li::before { content: ""; position: absolute; left: -16px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--petrol); border: 2px solid #fff; }
.legs li.lg-start::before { border-radius: 2px; background: var(--ink); }
.legs li.lg-drive { color: var(--muted); font: 600 11.5px/1.2 var(--f-mono); padding: 1px 0 1px 10px; }
.legs li.lg-drive::before { display: none; }
.legs li.lg-new b { color: var(--petrol-600); }
.legs li.lg-new::before { background: var(--green); }
.legs li.lg-late b { color: var(--red); }
.legs li.lg-late::before { background: var(--red); }
.sugg-item details, .ai-tour { margin-top: 6px; }
.sugg-item summary, .ai-tour summary { cursor: pointer; font-size: 12px; color: var(--petrol-600); }
.ai-tour { border-top: 1px solid var(--line); padding-top: 6px; }
.ai-tour summary { color: var(--ink); font-size: 12.5px; }
.ai-src { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.tl-dl { position: absolute; top: 2px; text-align: center; font: 600 9.5px/1 var(--f-mono); color: var(--muted); pointer-events: none; white-space: nowrap; overflow: visible; }

/* Speicher-Anzeige im Server-Betrieb */
.pill.sync.err { background: var(--red-050); color: var(--red); border-color: #f6cfca; }
