/* FST – Flight School Tool */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --nav-bg: #0b1f33;
  --nav-text: #cbd5e1;
  --nav-active: #ffffff;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --ok: #15803d;   --ok-bg: #dcfce7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c;  --bad-bg: #fee2e2;
  --none: #475569; --none-bg: #e2e8f0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--nav-bg) 250px, var(--bg) 250px); }
.sidebar { background: var(--nav-bg); color: var(--nav-text); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.1rem; padding: .25rem .5rem 1rem; }
/* Logo: weißer Kopfbereich über die volle Breite der Seitenleiste */
.brand-logo { justify-content: center; background: #fff; margin: -1rem -.75rem .6rem; padding: .35rem .4rem .3rem; border-bottom: 1px solid var(--border); }
.brand-logo:hover { text-decoration: none; }
.brand-logo img { display: block; width: 100%; max-height: 140px; object-fit: contain; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #14b8a6, #0ea5e9); display: grid; place-items: center; font-size: .9rem; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--nav-text); }
.nav-group { margin-bottom: .35rem; }
.nav-group > summary { list-style: none; cursor: pointer; padding: .45rem .5rem; border-radius: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; display: flex; justify-content: space-between; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▸"; transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-group a { display: block; color: var(--nav-text); padding: .38rem .5rem .38rem 1rem; border-radius: 6px; font-size: .92rem; }
.nav-group a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-group a.active { background: rgba(20,184,166,.18); color: var(--nav-active); box-shadow: inset 3px 0 0 #14b8a6; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .org { font-weight: 600; }
.topbar .user-menu { display: flex; gap: 1rem; align-items: center; }
.content { padding: 1.5rem; max-width: 1700px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards / grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.grid > * { min-width: 0; }
.grid-3 > .span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; min-width: 0; }
.card > h2 { display: flex; justify-content: space-between; align-items: center; }
.card > h2 a { font-size: .8rem; font-weight: 500; }
.stat { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
table.data tbody tr:hover { background: #f8fafc; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
table.compact th, table.compact td { padding: .3rem .45rem; }
table.wrap-head th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text, #0f172a); }
table.data th.sort-asc::after { content: " ▲"; font-size: .65rem; }
table.data th.sort-desc::after { content: " ▼"; font-size: .65rem; }
table.data th a { color: inherit; text-decoration: none; }
table.data th a:hover { text-decoration: underline; }
tr.is-cancelled td { color: var(--muted); text-decoration: line-through; }

/* Badges */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-expired { background: var(--bad-bg); color: var(--bad); }
.badge-none { background: var(--none-bg); color: var(--none); }
.badge-info { background: #e0f2fe; color: #0369a1; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .9rem; cursor: pointer; font-weight: 500; line-height: 1.2; }
.btn:hover { text-decoration: none; background: #f1f5f9; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #115e59; }
.btn-danger { color: var(--bad); border-color: #fecaca; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: .25rem .55rem; font-size: .8rem; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .8rem 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.field label { display: block; font-size: .88rem; font-weight: 600; color: #334155; margin-bottom: .25rem; }
.field .help { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.field .errorlist { color: var(--bad); font-size: .8rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.field.checkbox { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .5rem; }
.field.checkbox label { margin: 0; font-weight: 500; }
.field.checkbox .help, .field.checkbox .errorlist { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], input[type=url], input[type=file], select, textarea {
  width: 100%; max-width: 100%; min-width: 0; padding: .45rem .6rem; border: 1px solid #cbd5e1; border-radius: 7px; font: inherit; background: #fff; color: var(--text);
}
/* iOS Safari: Datums-/Zeitfelder haben sonst eine feste Eigenbreite und zentrierten Text – dadurch überlappen sie Nachbarfelder */
input[type=date], input[type=time], input[type=datetime-local] {
  -webkit-appearance: none; appearance: none; display: block; min-height: 2.45rem; text-align: left;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; }
select { -webkit-appearance: none; appearance: none; padding-right: 1.9rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.6'/></svg>"); background-repeat: no-repeat; background-position: right .65rem center; }
select[multiple] { background-image: none; padding-right: .6rem; }
.field { min-width: 0; }

select[multiple] { min-height: 7rem; }
textarea { min-height: 5rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--accent); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem 1rem; margin: 0 0 1rem; background: var(--surface); }
legend { font-weight: 700; padding: 0 .4rem; font-size: .9rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.filters { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; background: var(--surface); padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.filters .field { min-width: 140px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .4rem; border: 1px solid; }
.messages .success { background: var(--ok-bg); border-color: #bbf7d0; color: #14532d; }
.messages .error { background: var(--bad-bg); border-color: #fecaca; color: #7f1d1d; }
.messages .warning { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.messages .info { background: #e0f2fe; border-color: #bae6fd; color: #0c4a6e; }
.alert { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .75rem; border: 1px solid; }
.alert-error { background: var(--bad-bg); border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Kalender (Zeitstrahl) */
.cal-toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.cal-toolbar .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-toolbar .seg a { padding: .4rem .7rem; color: var(--text); background: var(--surface); border-right: 1px solid var(--border); }
.cal-toolbar .seg a:last-child { border-right: 0; }
.cal-toolbar .seg a.active { background: var(--accent); color: #fff; }
.timeline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.tl-day-head { padding: .45rem .75rem; background: #f8fafc; border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; left: 0; }
.tl-row { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--border); min-height: 44px; }
.tl-row:last-child { border-bottom: 0; }
.tl-label { padding: .45rem .6rem; border-right: 1px solid var(--border); background: #fcfcfd; position: sticky; left: 0; z-index: 2; font-size: .85rem; }
.tl-label strong { display: block; }
.tl-track { position: relative; min-width: 700px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--hour-w) - 1px), #eef2f7 calc(var(--hour-w) - 1px), #eef2f7 var(--hour-w)); cursor: pointer; }
.tl-hours { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--border); font-size: .72rem; color: var(--muted); position: sticky; top: 0; background: #fff; z-index: 3; }
.tl-hours .scale { position: relative; height: 22px; min-width: 700px; }
.tl-hours .scale span { position: absolute; top: 4px; transform: translateX(-50%); }
.tl-booking { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; color: #fff; padding: 2px 6px; font-size: .75rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,.2); z-index: 1; }
.tl-booking:hover { text-decoration: none; filter: brightness(1.08); z-index: 5; }
.tl-booking small { opacity: .9; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 4; }
.tl-unavailable { background: repeating-linear-gradient(45deg, #fee2e2, #fee2e2 6px, #fff 6px, #fff 12px); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 1rem; overflow-x: auto; }
.kanban .col { background: #eef2f7; border-radius: var(--radius); padding: .6rem; min-height: 200px; }
.kanban .col h3 { margin: .2rem .2rem .6rem; }
.kanban .item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; margin-bottom: .5rem; box-shadow: var(--shadow); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0b1f33 0%, #0f766e 100%); }
.login-card { background: #fff; padding: 2rem; border-radius: 14px; width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

.progress { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(5rem, max-content) minmax(0, 1fr); gap: .3rem 1rem; }
.kv dd { overflow-wrap: anywhere; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.empty { color: var(--muted); padding: 1rem 0; text-align: center; }

.nav-toggle { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; padding: .5rem .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
  .sidebar .brand { padding: .25rem .25rem; font-size: 1rem; flex: 1; }
  .sidebar .brand-logo { margin: 0; padding: .2rem .4rem; border-radius: 8px; border: 0; background: #fff; max-width: 11rem; flex: 0 1 auto; }
  .sidebar .brand-logo img { max-height: 44px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: .45rem .7rem; font: inherit; font-size: .9rem; cursor: pointer; }
  .sidebar nav { display: none; flex-basis: 100%; max-height: calc(100vh - 4rem); overflow-y: auto; padding-bottom: .5rem; }
  .sidebar.open nav { display: block; }
  .topbar { padding: .55rem .9rem; gap: .5rem; flex-wrap: wrap; }
  .topbar .user-menu { gap: .6rem; flex-wrap: wrap; font-size: .92rem; }
  .content { padding: .9rem; }
  .card { padding: .85rem .9rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  h1 { font-size: 1.25rem; }
  table.data { font-size: .88rem; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; text-align: center; }
}
/* Unter ~1010px passt in .grid-3 oft nur eine Spalte (22rem je Spalte); ein „span 2“ würde dann eine zweite,
   unsichtbare Spalte erzeugen und die Seite seitlich überlaufen lassen (Handy-Dashboard 27.10.2026). */
@media (max-width: 1010px) {
  .grid-3 > .span-2 { grid-column: auto; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-4 > * { grid-column: auto !important; }
  .stat { font-size: 1.25rem; }
  .topbar { padding: .45rem .75rem; }
  .topbar .org { font-size: .9rem; }
  .topbar .user-menu { gap: .5rem; font-size: .85rem; }
  .topbar .user-menu .btn { padding: .25rem .5rem; font-size: .8rem; }
  .req-actions input[type=text] { width: 100%; }
  .bk-search input { min-width: 0; width: 100%; }
}
@media print {
  .sidebar, .topbar, .no-print, .filters { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

/* ===================== Buchungen (Kalender & Formular) ===================== */
.nav-badge { float: right; background: #f59e0b; color: #1f2937; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; margin-top: .1rem; }

.bk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bk-date { display: flex; align-items: center; gap: .5rem; }
.bk-date h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.bk-date .sub { color: var(--muted); font-size: .9rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.icon-btn:hover { background: #f1f5f9; text-decoration: none; }
.pill-btn { border-radius: 999px; padding: .5rem 1.1rem; }

.bk-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .5rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.seg2 { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; }
.seg2 a { padding: .35rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .88rem; }
.seg2 a:hover { text-decoration: none; color: var(--text); }
.seg2 a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.bk-toolbar select, .bk-toolbar input[type=text], .bk-toolbar input[type=date] { width: auto; border-radius: 10px; border-color: var(--border); background: #fff; }
.bk-search { position: relative; margin-left: auto; }
.bk-search input { padding-left: 2rem !important; min-width: 200px; }
.bk-search::before { content: "⌕"; position: absolute; left: .7rem; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1rem; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }

.cal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; }
.cal-grid { min-width: 900px; }
.cal-scale, .cal-row { display: grid; grid-template-columns: 210px 1fr; }
.cal-scale { position: sticky; top: 0; z-index: 6; background: rgba(255,255,255,.95); backdrop-filter: blur(4px); border-bottom: 1px solid var(--border); }
.cal-scale .ticks { position: relative; height: 34px; }
.cal-scale .ticks span { position: absolute; bottom: 7px; transform: translateX(-50%); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day { padding: .55rem 1rem; font-weight: 700; font-size: .85rem; background: #f8fafc; border-bottom: 1px solid var(--border); position: sticky; left: 0; color: #334155; }
.cal-day.today { color: var(--accent); }
.cal-row { border-bottom: 1px solid #eef2f7; min-height: 56px; }
.cal-row:last-child { border-bottom: 0; }
.cal-res { display: flex; align-items: center; gap: .65rem; padding: .5rem .9rem; position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid #eef2f7; }
.avatar { width: 38px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .66rem; flex: none; letter-spacing: .02em; }
.cal-res .name { font-weight: 600; font-size: .9rem; line-height: 1.15; }
.cal-res .type { font-size: .75rem; color: var(--muted); }
.cal-res .warn { font-size: .68rem; font-weight: 700; color: var(--bad); }
.cal-track { position: relative; cursor: copy;
  background-image:
    repeating-linear-gradient(to right, #eef2f7 0, #eef2f7 1px, transparent 1px, transparent var(--hour-w)),
    repeating-linear-gradient(to right, transparent 0, transparent calc(var(--hour-w) / 2), #f5f7fa calc(var(--hour-w) / 2), #f5f7fa calc(var(--hour-w) / 2 + 1px), transparent calc(var(--hour-w) / 2 + 1px), transparent var(--hour-w)); }
.cal-track:hover { background-color: #fbfdff; }
.cal-track.blocked { background-color: #fff5f5; }
.cal-ghost { position: absolute; top: 6px; bottom: 6px; border-radius: 10px; border: 2px dashed var(--accent); background: rgba(15,118,110,.06); pointer-events: none; display: none; font-size: .72rem; color: var(--accent); padding: 4px 8px; font-weight: 600; }
.chip { position: absolute; top: 6px; bottom: 6px; border-radius: 10px; padding: 5px 9px 5px 11px; overflow: hidden; z-index: 2; color: #0f172a; text-decoration: none; line-height: 1.2;
  background: color-mix(in srgb, var(--c) 16%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); box-shadow: inset 3px 0 0 var(--c); transition: transform .08s, box-shadow .12s; }
.chip:hover { text-decoration: none; z-index: 5; box-shadow: inset 3px 0 0 var(--c), 0 6px 16px rgba(15,23,42,.14); transform: translateY(-1px); }
.cal-track[data-resource] .chip:not(.waitlist) { cursor: grab; touch-action: pan-y; }
.chip.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 6px 18px rgba(15,23,42,.25); z-index: 5; }
.chip strong { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip small { display: block; font-size: .7rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.request { background: repeating-linear-gradient(135deg, #fff 0 6px, color-mix(in srgb, var(--c) 10%, #fff) 6px 12px); border: 1.5px dashed var(--c); box-shadow: none; }
.chip .tag { display: inline-block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #92400e; background: #fef3c7; border-radius: 4px; padding: 0 4px; margin-right: 3px; }
.zone { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.zone.closed, .zone-swatch.closed { background: repeating-linear-gradient(135deg, rgba(148,163,184,.28) 0 5px, rgba(148,163,184,.10) 5px 10px); }
.zone.no_circuits, .zone-swatch.no_circuits { background: rgba(245,158,11,.16); }
.zone.noise, .zone-swatch.noise { background: repeating-linear-gradient(135deg, rgba(245,158,11,.16) 0 5px, #fff 5px 10px); }  /* Farbe von „keine Platzrunden“ im Wechsel mit Weiß (Dennis 01.11.) */
.zone.info, .zone-swatch.info { background: rgba(96,165,250,.16); }
.legend .zone-swatch { border: 1px solid #cbd5e1; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 1; pointer-events: none; opacity: .85; }
.now-line.with-dot::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .75rem; font-size: .8rem; color: var(--muted); }
.legend span i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; }

.agenda { display: grid; gap: .75rem; }
.agenda-day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--shadow); }
.agenda-day h3 { margin: 0 0 .5rem; font-size: .9rem; }
.agenda-item { display: grid; grid-template-columns: 110px 1fr auto; gap: .75rem; align-items: center; padding: .45rem .6rem; border-radius: 10px; color: var(--text); box-shadow: inset 3px 0 0 var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); margin-bottom: .35rem; }
.agenda-item:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 13%, #fff); }

/* Buchungsformular */
.bf { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.bf-section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.bf-section h2 { display: flex; align-items: center; gap: .6rem; font-size: 1rem; margin: 0 0 .9rem; }
.bf-section h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: .8rem; }
.bf-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: .5rem 0 .4rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; }
.tile { position: relative; display: flex; gap: .65rem; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; padding: .65rem .75rem; cursor: pointer; background: #fff; transition: border-color .12s, box-shadow .12s, transform .08s; }
.tile:hover { border-color: #94a3b8; transform: translateY(-1px); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.15); background: #f0fdfa; }
.tile .t-name { font-weight: 700; font-size: .92rem; }
.tile .t-type { font-size: .75rem; color: var(--muted); }
.tile .t-status { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; }
.when { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: .8rem; }
.chips-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.qchip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; cursor: pointer; color: var(--text); }
.qchip:hover { border-color: var(--accent); color: var(--accent); }
.qchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.cat-pill { position: relative; display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--border); border-radius: 999px; padding: .32rem .8rem .32rem .6rem; cursor: pointer; font-size: .85rem; background: #fff; }
.cat-pill input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pill i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cat-pill:has(input:checked) { border-color: var(--text); background: #f8fafc; font-weight: 600; }
.toggles { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .6rem; }
.bf-aside { position: sticky; top: 70px; }
.summary { background: linear-gradient(160deg, #0b1f33 0%, #12344f 100%); color: #e2e8f0; border-radius: 18px; padding: 1.25rem; box-shadow: 0 10px 30px rgba(11,31,51,.25); }
.summary h3 { margin: 0 0 1rem; color: #fff; font-size: 1rem; }
.summary .big { font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; margin: 1rem 0; font-size: .88rem; }
.summary dt { color: #94a3b8; }
.summary dd { margin: 0; color: #fff; font-weight: 500; }
.summary .note { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.4); color: #fde68a; border-radius: 10px; padding: .6rem .75rem; font-size: .82rem; margin-bottom: 1rem; }
.summary .btn-primary { width: 100%; justify-content: center; padding: .75rem; font-size: 1rem; border-radius: 12px; background: #14b8a6; border-color: #14b8a6; }
.summary .btn-primary:hover { background: #0d9488; }
.summary .field.checkbox label { color: #e2e8f0; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .2rem .7rem; font-size: .78rem; font-weight: 700; }
.status-pill.requested { background: #fef3c7; color: #92400e; }
.status-pill.confirmed { background: var(--ok-bg); color: var(--ok); }
.status-pill.declined, .status-pill.cancelled { background: var(--bad-bg); color: var(--bad); }
.status-pill.waitlist { background: #e0e7ff; color: #3730a3; }
.chip.has-wait { bottom: 46%; padding-top: 3px; padding-bottom: 2px; }
.chip.has-wait small { display: none; }
.chip.waitlist { top: 56%; bottom: 4px; z-index: 1; padding: 2px 8px; border: 1.5px dashed #4f46e5; background: #eef2ff; box-shadow: none; }
.chip.waitlist strong { font-size: .7rem; color: #3730a3; font-weight: 600; }
.req-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; box-shadow: var(--shadow); margin-bottom: .6rem; }
.req-card .when-box { text-align: center; background: #f1f5f9; border-radius: 12px; padding: .45rem .8rem; min-width: 74px; }
.req-card .when-box b { display: block; font-size: 1.25rem; line-height: 1.1; }
.req-card .when-box span { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.req-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.req-actions input[type=text] { width: 180px; }

@media (max-width: 1000px) {
  .bf { grid-template-columns: 1fr; }
  .bf-aside { position: static; }
  .when { grid-template-columns: 1fr 1fr; }
  .req-card { grid-template-columns: auto 1fr; }
  .req-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Bordbuch-Formular */
.route { display: grid; grid-template-columns: 1fr auto 1fr; gap: .8rem; align-items: end; max-width: 520px; }
.route input { text-transform: uppercase; font-weight: 700; letter-spacing: .06em; font-size: 1.05rem; }
.route-arrow { font-size: 1.4rem; color: var(--muted); padding-bottom: .35rem; }
.times { display: grid; grid-template-columns: 1fr; gap: .45rem; margin-top: .9rem; padding: .8rem 1rem; background: #f8fafc; border-radius: 12px; border: 1px solid var(--border); max-width: 24rem; }
.times .field { display: grid; grid-template-columns: 1fr 8.5rem; align-items: center; gap: .75rem; }
.times .field label { margin: 0; }
.times .field .errorlist { grid-column: 1 / -1; }
details.bf-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; }
details.bf-section > summary::-webkit-details-marker { display: none; }
details.bf-section > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.bf-section:not([open]) > summary::after { transform: rotate(-90deg); }
details.bf-section:not([open]) { padding-bottom: 1.1rem; }
/* Hinweis vor der automatischen Abmeldung */
.idle-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.idle-modal { background: var(--surface); color: var(--text); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 1.25rem 1.5rem; max-width: 26rem; width: 100%; text-align: center; }
.idle-modal h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.idle-count { font-size: 3rem; font-weight: 800; color: #2563eb; font-variant-numeric: tabular-nums; margin: .5rem 0 .75rem; }
.idle-actions { display: flex; justify-content: center; }
/* Bei Notfällen */
.tel-big { font-weight: 800; font-size: 1.1rem; }
.contacts tr.group th { padding-top: .8rem; text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 0; }
.contacts td a { font-weight: 600; font-variant-numeric: tabular-nums; }
.pdf-embed { display: block; width: 100%; height: 75vh; margin-top: 1rem; border: 1px solid var(--border); border-radius: 8px; }
@media (max-width: 760px) { .pdf-embed { display: none; } }
/* Cloud-Ordner (Nextcloud) */
.crumbs { margin: .25rem 0 0; color: var(--muted); }
.explorer .file-icon { display: inline-block; width: 1.4em; text-align: center; }
.explorer td:first-child a { display: block; }
.cloud-write { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.cloud-write .field { margin: 0; min-width: 16rem; }
/* Dokumente: ein aufklappbarer Kasten je Ordner */
.doc-folder { margin-bottom: .75rem; padding: 0; }
.doc-folder > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; font-weight: 600; }
.doc-folder > summary::-webkit-details-marker { display: none; }
.doc-folder > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.doc-folder:not([open]) > summary::after { transform: rotate(-90deg); }
.doc-folder > summary .doc-folder-name { flex: 0 1 auto; }
.doc-folder > .table-wrap { border-top: 1px solid var(--border); }
.doc-folder table td:first-child, .doc-folder table th:first-child { padding-left: 1.1rem; }

/* Bordbuch-Liste */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow); }
.stat-card .v { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; }
.table-card table.data th { background: #fff; border-bottom: 1px solid var(--border); padding-top: .8rem; }
.table-card table.data td { border-bottom: 1px solid #f1f5f9; }
.table-card table.data tbody tr { cursor: pointer; }
.reg { display: inline-block; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; background: #f1f5f9; font-size: .82rem; letter-spacing: .02em; }
.route-cell { font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
.route-cell small { display: block; font-weight: 400; color: var(--muted); letter-spacing: 0; }
@media (max-width: 1000px) { .times { grid-template-columns: 1fr 1fr; max-width: none; } }
@media (max-width: 640px) {
  .times { grid-template-columns: 1fr; }
  .times .field { grid-template-columns: minmax(0, 1fr) 7.5rem; }
  .route { max-width: none; grid-template-columns: 1fr auto 1fr; align-items: start; }
  .route .field label { min-height: 2.6rem; display: flex; align-items: flex-end; }
  .route-arrow { padding-top: 2.9rem; padding-bottom: 0; }
}
.times input.hhmm { font-size: 1.15rem; font-weight: 600; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; }
.times input.hhmm::placeholder { font-weight: 400; letter-spacing: .05em; color: #cbd5e1; }
.times input.hhmm.bad { border-color: var(--bad); background: #fef2f2; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.15); max-height: 280px; overflow-y: auto; }
.combo-list li { padding: .45rem .6rem; border-radius: 7px; cursor: pointer; font-size: .92rem; }
.combo-list li:hover, .combo-list li.on { background: #f0fdfa; color: var(--accent); }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }
.combo-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.combo-chips:empty { display: none; }
.combo-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .35rem .25rem .7rem; border-radius: 999px; background: #f0fdfa; border: 1px solid #99f6e4; color: var(--accent); font-size: .85rem; font-weight: 600; }
.combo-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.req-actions.charter { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px dashed var(--border); padding-top: .75rem; }
.req-actions .hangar { display: grid; grid-template-columns: repeat(2, minmax(180px, 240px)); gap: .6rem; margin-right: auto; }
.req-actions .hangar .field label { margin-bottom: .15rem; }
.req-type { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 6px; margin-right: .35rem; vertical-align: middle; }
.req-type.training { background: #fef3c7; color: #92400e; }
.req-type.charter { background: #e0e7ff; color: #3730a3; }
@media (max-width: 700px) { .req-actions .hangar { grid-template-columns: 1fr; width: 100%; } }
.bf input[readonly] { background: #f1f5f9; color: #475569; }
.field[hidden] { display: none !important; }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 3px; vertical-align: -.1em; margin-right: .2rem; }
.color-dd { position: relative; }
.color-dd-btn { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; font: inherit; cursor: pointer; text-align: left; }
.color-dd-btn:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.color-dd-btn .caret { margin-left: auto; font-weight: 400; color: var(--muted); font-size: .8em; }
.color-dd i { display: inline-block; width: 1.4rem; height: 1rem; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.color-dd-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.15); max-height: 320px; overflow-y: auto; }
.color-dd-list li { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: 7px; cursor: pointer; }
.color-dd-list li:hover, .color-dd-list li.on { background: #f1f5f9; }
.color-dd-list li.on span { font-weight: 700; }
.area-tabs { display: flex; gap: .25rem; margin: 0 0 .75rem; border-bottom: 1px solid var(--border); }
.area-tabs a { padding: .55rem 1rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.area-tabs a:hover { color: var(--text); }
.area-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.consumables { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.consumables h3 { margin: 0 0 .6rem; }
.consumables .opt { margin-top: .5rem; }
.consumables [hidden], #fuel-row[hidden], #oil-row[hidden] { display: none !important; }
.consumables #oil-row { grid-template-columns: minmax(0, 20rem); }
#hangar-box[hidden] { display: none !important; }
.bf-aside.tall { position: static; }
.training-box .training-fields { display: grid; gap: .7rem; margin-top: .8rem; }
.training-box .training-fields[hidden] { display: none; }
.training-box .mins { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.training-box .mins label { font-size: .75rem; min-height: 2.2em; }
.training-box select[multiple] { width: 100%; }
.ex-list { border: 1px solid var(--border); border-radius: 10px; max-height: 340px; overflow-y: auto; background: #fff; }
.ex-row { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; align-items: center; padding: .45rem .6rem; border-bottom: 1px solid #f1f5f9; font-size: .88rem; }
.ex-row:last-child { border-bottom: 0; }
.ex-row[hidden] { display: none; }
.ex-row.on { background: #f0fdfa; }
.ex-row .ex-main { display: flex; gap: .45rem; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; font-size: inherit; color: var(--text); }
.ex-row .ex-main input { margin-top: .2rem; }
.ex-row .ex-done { display: flex; gap: .3rem; align-items: center; font-size: .9rem; color: var(--muted); margin: 0; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ex-row .ex-done:has(input:disabled) { opacity: .35; cursor: default; }
.ex-row .ex-done:has(input:checked) { color: #15803d; }
.ex-row .ex-prev { grid-column: 1; font-size: .75rem; color: #15803d; padding-left: 1.4rem; }
.ex-row .ex-prev[hidden] { display: none; }
/* Flug erfassen: links kompakt (mehr Felder untereinander), rechts Ausbildung, Abrechnung, Zusammenfassung */
.bf.flight-form { grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); max-width: 96rem; }
.bf.flight-form .bf-full { grid-column: 1 / -1; }
.bf.flight-form .training-box .training-fields { max-width: none; }
.bf.flight-form .summary { color: #e2e8f0; }
.bf.flight-form .bf-aside { position: static; }
.bf.flight-form .bf-aside .bf-section { margin-bottom: 1rem; }
.bf.flight-form .billing-box .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); }
@media (max-width: 1000px) { .bf.flight-form { grid-template-columns: 1fr; } }
.bf.flight-form .billing-box .form-grid > .field:first-child { grid-column: 1 / -1; }
#fuel-main[hidden] { display: none !important; }
.opt[hidden], #fuel-row[hidden] { display: none !important; }
.radio-pills > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.radio-pills label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--text); margin: 0; }
.radio-pills label:has(input:checked) { border-color: var(--accent); background: #f0fdfa; color: var(--accent); }
.radio-pills.mel label:has(input[value="restricted"]:checked) { border-color: #d97706; background: #fffbeb; color: #b45309; }
.radio-pills.mel label:has(input[value="no"]:checked) { border-color: var(--bad); background: #fef2f2; color: var(--bad); }
.radio-pills input { margin: 0; }
.due-cell .badge { margin-right: .15rem; } table.dues td { vertical-align: top; }
/* Safety: Risikomatrix, Einstufungen, Taskboard */
.info-box { background: #ecfeff; border-left: 4px solid #0891b2; padding: .6rem .8rem; border-radius: 6px; font-size: .88rem; color: #155e75; margin: 0 0 .8rem; }
.risk-matrix table { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .85rem; }
.risk-matrix th { font-weight: 600; text-align: left; color: #334155; padding: .2rem .4rem; }
.risk-matrix .rm-letter { text-align: center; color: var(--muted); }
.risk-matrix .rm-num { text-align: center; color: var(--muted); width: 2rem; }
.risk-matrix .rm-corner { font-weight: 400; font-size: .75rem; color: var(--muted); vertical-align: top; }
.risk-matrix .rm-current { margin-top: .3rem; font-size: .9rem; color: var(--text); }
.rm-cell { width: 100%; border: 0; border-radius: 6px; padding: .5rem 0; font: inherit; font-weight: 700; cursor: pointer; color: #1f2937; opacity: .75; }
.rm-cell:hover { opacity: 1; }
.rm-cell.on { opacity: 1; outline: 3px solid #0f172a; outline-offset: 1px; }
.risk-red { background: #e57373; } .risk-orange { background: #ffb74d; } .risk-green { background: #4db6ac; } .risk-none { background: #e2e8f0; color: #64748b; }
.risk-badges { display: inline-flex; gap: .2rem; }
.risk-badge { display: inline-block; min-width: 2.1rem; text-align: center; font-size: .72rem; font-weight: 700; padding: .12rem .3rem; border-radius: 4px; color: #1f2937; }
.sr-status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: #e2e8f0; color: #475569; }
.sr-status.st-new { background: #dbeafe; color: #1d4ed8; } .sr-status.st-review { background: #ede9fe; color: #6d28d9; }
.sr-status.st-measures { background: #fef3c7; color: #b45309; } .sr-status.st-resubmit { background: #cffafe; color: #0e7490; }
.sr-status.st-closed { background: #e2e8f0; color: #475569; }
.sr-board { display: grid; grid-template-columns: repeat(5, minmax(14rem, 1fr)); gap: .75rem; overflow-x: auto; align-items: start; }
.sr-col { background: #eef2f7; border-radius: 12px; padding: .6rem; min-height: 12rem; }
.sr-col h3 { margin: .1rem .2rem .6rem; font-size: .95rem; }
.sr-card { display: block; background: #fff; border-radius: 10px; border-left: 4px solid #94a3b8; padding: .6rem .7rem; margin-bottom: .6rem; color: inherit; box-shadow: var(--shadow); font-size: .82rem; }
.sr-card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(15,23,42,.12); }
.sr-card.st-new { border-left-color: #2563eb; } .sr-card.st-review { border-left-color: #7c3aed; } .sr-card.st-measures { border-left-color: #f59e0b; }
.sr-card.st-resubmit { border-left-color: #f97316; } .sr-card.st-closed { border-left-color: #14b8a6; }
.sr-top { display: flex; justify-content: space-between; gap: .4rem; align-items: flex-start; }
.sr-stamp { font-size: .68rem; color: var(--muted); text-align: right; }
.sr-meta { display: flex; justify-content: space-between; margin: .4rem 0 .3rem; color: #475569; }
.sr-meta .right { text-align: right; }
.sr-title { font-weight: 700; margin-bottom: .2rem; }
.sr-text { color: #475569; }
.mail-body { white-space: pre-wrap; font: inherit; margin: 0; line-height: 1.5; }

/* Ausbildungsinhalte / Lesson Cards im Flugformular */
.ex-list { max-height: none; }
.ex-row { font-size: 1.05rem; padding: .6rem .8rem; }
.ex-row .ex-items { font-size: 1rem; line-height: 1.45; }
.ex-section { padding: .5rem .8rem; background: #f1f5f9; font-size: .92rem; color: var(--muted); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.ex-section[hidden] { display: none; }
.ex-row .ex-items { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); margin: 0 0 .2rem 1.6rem; }
.ex-row .ex-items[hidden] { display: none; }
.ex-row .ex-items summary { cursor: pointer; color: var(--accent); }
.ex-row .ex-items ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.ex-row .ex-items li { margin: .1rem 0; }
.ex-row .ex-target { margin: .3rem 0 .5rem; white-space: pre-line; }
.rating-table { width: 100%; border-collapse: collapse; font-size: 1.02rem; margin: .5rem 0; }
.rating-table td, .rating-table th { padding: .4rem .5rem; }
.rating-table input[type=radio] { width: 1.15rem; height: 1.15rem; }
.rating-table th, .rating-table td { padding: .25rem .35rem; border-bottom: 1px solid #f1f5f9; text-align: center; }
.rating-table th:first-child, .rating-table td:first-child { text-align: left; color: var(--text); }
.rating-table th { font-weight: 600; color: var(--muted); font-size: .9rem; width: 4rem; }
.rating-table input[type=radio] { margin: 0; }

.time-bad { border-color: var(--bad) !important; background: #fef2f2 !important; }
#time-hint[hidden] { display: none; }

.hold-box { margin-top: .8rem; padding: .8rem 1rem; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 12px; font-size: .95rem; }
.hold-box[hidden] { display: none; }
.hold-box .rating-table td { vertical-align: middle; }
.rating-status { margin-top: .3rem; color: var(--muted); }
.rating-status.bad { color: #b45309; font-weight: 600; }

.rating-table tbody tr:nth-child(even) { background: rgba(15, 23, 42, .045); }
.rating-table tbody tr:hover { background: rgba(13, 148, 136, .10); }
.rating-table tbody tr:has(input:checked) td:first-child { color: #0f766e; }
.rating-table th.hi, .rating-table td.hi { border-left: 2px solid #fcd34d; background: #fffbeb; }
.checks { display: grid; gap: .35rem; margin-top: .3rem; }
.checks .check { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; }
.checks .check input { width: auto; margin: 0; }

/* Zwei-Listen-Auswahl (Rundmail-Empfänger) */
.duallist { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: stretch; }
.duallist .dual-col { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.duallist .dual-col select { width: 100%; min-height: 14rem; font-size: .9rem; }
.duallist .dual-search { width: 100%; }
.duallist .dual-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.duallist .dual-mid { display: flex; flex-direction: column; justify-content: center; gap: .35rem; }
.duallist .dual-mid .btn { min-width: 2.4rem; justify-content: center; }
@media (max-width: 760px) { .duallist { grid-template-columns: 1fr; } .duallist .dual-mid { flex-direction: row; justify-content: center; } }

/* ===================== Handy-Ansicht (Durchsicht iPhone-Breite, 14.11.2026) =====================
   Steht bewusst am Ende der Datei, damit die Regeln die Desktop-Vorgaben oben überschreiben. */
.content { overflow-wrap: break-word; }                              /* überlange Wörter brechen statt überzulaufen */
.card > h2 { gap: .15rem .75rem; flex-wrap: wrap; }                   /* Überschrift und Zusatz stoßen nicht aneinander */
.kv { grid-template-columns: fit-content(45%) minmax(0, 1fr); }       /* Bezeichnung nie breiter als 45 % – Werte brechen nicht buchstabenweise um */
.kv dt { overflow-wrap: anywhere; }
.stat-label, .stat-card .l { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.login-card { width: min(360px, calc(100vw - 2rem)); }
.risk-matrix { overflow-x: auto; }
.cloud-write .field { flex: 1 1 16rem; min-width: min(16rem, 100%); }
.bk-toolbar input[type=date] { min-width: 8.5rem; }                   /* leere Datumsfelder fallen auf iOS sonst auf wenige Pixel zusammen */
.form-actions .btn { justify-content: center; }
.bk-range { display: inline-flex; align-items: center; gap: .4rem; }
/* Zwei gleich breite Spalten, auf dem Handy untereinander (statt fester Inline-Spalten in den Templates) */
.grid-half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rules-pop { position: absolute; right: 0; top: 2.8rem; width: 380px; z-index: 20; }

@media (max-width: 1000px) {
  .bf, .bf.flight-form { grid-template-columns: minmax(0, 1fr); }     /* 1fr allein ließe breite Inhalte (Risikomatrix) die Seite sprengen */
}
@media (max-width: 900px) {
  /* Kopf: ohne feste Zeilenhöhen streckt das Raster den dunklen Kopf auf kurzen Seiten über den halben Bildschirm */
  .layout { grid-template-rows: auto 1fr; }
  .sidebar nav { max-height: calc(100dvh - 4.5rem); }
  .nav-group a { padding-top: .6rem; padding-bottom: .6rem; }
  .nav-group > summary { padding-top: .6rem; padding-bottom: .6rem; }
  .topbar { position: static; }
  /* iOS zoomt beim Antippen in Felder mit Schrift unter 16px hinein */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: max(1em, 16px) !important; }
  /* Reiter: eine Zeile zum Wischen statt drei bis vier umbrochener Zeilen */
  .tabs, .area-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .area-tabs::-webkit-scrollbar { display: none; }
  .tabs a, .area-tabs a { flex: none; white-space: nowrap; }
  /* Tabellen: nie über den Kartenrand; viele Spalten bekommen Platz und werden seitlich gewischt statt zerquetscht */
  .card:has(> table.data), fieldset:has(> table.data), .bf-section:has(> table.data), details:has(> table.data) { overflow-x: auto; }
  table.data:has(> thead th:nth-child(6)) { min-width: 40rem; }
  table.data:has(> thead th:nth-child(8)) { min-width: 50rem; }
  table.data:has(> thead th:nth-child(11)) { min-width: 62rem; }
  .page-head .actions .btn, .bk-head .btn { white-space: nowrap; }
  .page-head .actions, .page-head .actions > form { max-width: 100%; min-width: 0; }
  .page-head .actions select { max-width: 100%; flex: 1 1 8rem; min-width: 0; }
  .page-head > div { min-width: 0; }
  details.bf-section > summary { flex-wrap: wrap; row-gap: .2rem; }
  .bk-toolbar input[type=text] { min-width: 0 !important; flex: 1 1 10rem; }
  .bk-head > div { min-width: 0; }
  .bk-head > div[style*="display:flex"] { flex-wrap: wrap; }
  .grid-half { grid-template-columns: minmax(0, 1fr); }
  .rules-pop { position: fixed; left: .75rem; right: .75rem; top: 6.5rem; width: auto; max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 700px) {
  /* Kalender: Namensspalte schmal, damit die Zeitachse Platz hat */
  .cal-scale, .cal-row { grid-template-columns: 6.5rem 1fr; }
  .cal-res { padding: .4rem .5rem; gap: .4rem; }
  .cal-res .avatar { display: none; }
  .cal-res .name { font-size: .85rem; overflow-wrap: anywhere; }
  .cal-day { padding: .45rem .6rem; }
  .tl-row, .tl-hours { grid-template-columns: 6.5rem 1fr; }
  .agenda-item { grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .5rem; }
}
@media (max-width: 600px) {
  /* Filter: Felder füllen die Zeile, statt als schmale Kästchen links zu kleben */
  .filters .field { flex: 1 1 8.5rem; min-width: 0; }
  .filters input[type=text], .filters input[type=search] { min-width: 0 !important; }
  .bk-toolbar select, .bk-toolbar input[type=date] { flex: 1 1 8.5rem; }
  .bk-search { flex: 1 1 100%; margin-left: 0; }
  .bk-range { flex: 1 1 10rem; }
  .bk-range input[type=date] { flex: 1 1 auto; min-width: 0; }
}
@media (pointer: coarse) {
  .btn-sm { padding: .4rem .65rem; }                                  /* Fingerbedienung: kleine Knöpfe etwas größer */
}
