/* VIUStime - Oberflaeche
   Aus index.html des Vergabeatlas herausgeloest, Regel fuer Regel
   unveraendert. Der Modulumschalter und der goldene Akzent des Moduls
   Honorar kommen mit Paket A4 (Systemkonzept 9).
 */
    /* ── CSS Reset & Variables ─────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:           #0f1117;
      --surface:      #1a1f2e;
      --surface-2:    #212840;
      --surface-3:    #2a3150;
      --accent:       #3b82f6;
      --accent-hover: #2563eb;
      --accent-dim:   rgba(59,130,246,.15);
      --success:      #22c55e;
      --danger:       #ef4444;
      --warning:      #f59e0b;
      --text:         #e2e8f0;
      --text-muted:   #94a3b8;
      --text-dim:     #64748b;
      --border:       #2d3748;
      --border-light: #374151;
      --sidebar-w:    260px;
      --radius:       8px;
      --radius-lg:    12px;
      --shadow:       0 4px 24px rgba(0,0,0,.4);
      --shadow-sm:    0 2px 8px rgba(0,0,0,.3);
      --font:         'Inter', system-ui, sans-serif;
    }

    html, body {
      height: 100%;
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      line-height: 1.5;
      overflow: hidden;
    }

    /* ── App Shell ─────────────────────────────────────────────────────── */
    #app {
      display: flex;
      height: 100vh;
      overflow: hidden;
    }

    /* ── Sidebar ───────────────────────────────────────────────────────── */
    #sidebar {
      width: var(--sidebar-w);
      min-width: var(--sidebar-w);
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      overflow-x: hidden;
      z-index: 100;
    }

    .sidebar-logo {
      padding: 20px 18px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .logo-svg { flex-shrink: 0; }

    .logo-text {
      display: flex;
      flex-direction: column;
      line-height: 1.1;
    }

    .logo-title {
      font-weight: 700;
      font-size: 15px;
      color: var(--text);
      letter-spacing: -0.3px;
    }

    .logo-sub {
      font-size: 10px;
      color: var(--text-muted);
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    /* ── Nav ───────────────────────────────────────────────────────────── */
    .nav-section { padding: 12px 8px 4px; }
    .nav-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .8px;
      color: var(--text-dim);
      padding: 0 10px 6px;
      font-weight: 600;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: var(--radius);
      cursor: pointer;
      color: var(--text-muted);
      font-size: 13px;
      font-weight: 500;
      transition: background .15s, color .15s;
      user-select: none;
    }

    .nav-item:hover { background: var(--surface-2); color: var(--text); }
    .nav-item.active { background: var(--accent-dim); color: var(--accent); }
    .nav-item svg { flex-shrink: 0; }

    /* ── Filter Panel ──────────────────────────────────────────────────── */
    .filter-panel {
      padding: 12px 14px;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }

    .filter-header {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .8px;
      color: var(--text-dim);
      font-weight: 600;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .filter-group { margin-bottom: 12px; }

    .filter-label {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 5px;
      display: block;
    }

    .filter-select {
      width: 100%;
      background: var(--surface-2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 6px 8px;
      border-radius: 6px;
      font-family: var(--font);
      font-size: 12px;
      outline: none;
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 8px center;
      padding-right: 24px;
    }

    .filter-select:focus { border-color: var(--accent); }

    .filter-checkboxes {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 90px;
      overflow-y: auto;
    }

    .filter-checkboxes::-webkit-scrollbar { width: 3px; }
    .filter-checkboxes::-webkit-scrollbar-track { background: transparent; }
    .filter-checkboxes::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

    .check-label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text-muted);
      cursor: pointer;
    }

    .check-label input[type="checkbox"] {
      accent-color: var(--accent);
      width: 13px;
      height: 13px;
    }

    .filter-actions {
      display: flex;
      gap: 6px;
      margin-top: 12px;
    }

    /* ── Buttons ───────────────────────────────────────────────────────── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 14px;
      border-radius: var(--radius);
      font-family: var(--font);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      border: none;
      transition: background .15s, opacity .15s, box-shadow .15s;
      white-space: nowrap;
    }

    .btn:disabled { opacity: .5; cursor: not-allowed; }

    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

    .btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
    .btn-secondary:hover:not(:disabled) { background: var(--surface-3); }

    .btn-danger { background: var(--danger); color: #fff; }
    .btn-danger:hover:not(:disabled) { background: #dc2626; }

    .btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
    .btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

    .btn-sm { padding: 4px 10px; font-size: 12px; }
    .btn-xs { padding: 2px 8px; font-size: 11px; }
    .btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }

    .btn-filter-apply { flex: 1; font-size: 12px; padding: 6px 8px; }
    .btn-filter-reset { font-size: 12px; padding: 6px 8px; background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
    .btn-filter-reset:hover { background: var(--surface-2); color: var(--text); }

    /* ── Main Content ──────────────────────────────────────────────────── */
    #main {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .main-header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 14px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    .main-header h1 {
      font-size: 18px;
      font-weight: 600;
      color: var(--text);
    }

    .main-header-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .main-content {
      flex: 1;
      overflow-y: auto;
      padding: 20px 24px;
    }

    .main-content::-webkit-scrollbar { width: 6px; }
    .main-content::-webkit-scrollbar-track { background: transparent; }
    .main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

    /* ── KPI Cards ─────────────────────────────────────────────────────── */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      margin-bottom: 20px;
    }

    .kpi-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px;
      position: relative;
      overflow: hidden;
    }

    .kpi-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 2px;
      background: var(--kpi-color, var(--accent));
    }

    .kpi-label {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: .5px;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .kpi-value {
      font-size: 26px;
      font-weight: 700;
      color: var(--text);
      line-height: 1;
      margin-bottom: 8px;
    }

    .kpi-footer {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--text-muted);
    }

    .kpi-progress {
      height: 4px;
      background: var(--surface-3);
      border-radius: 2px;
      margin-top: 8px;
      overflow: hidden;
    }

    .kpi-progress-bar {
      height: 100%;
      border-radius: 2px;
      background: var(--success);
      transition: width .5s ease;
    }

    .trend-up { color: var(--success); }
    .trend-down { color: var(--danger); }

    /* ── Dashboard Split ───────────────────────────────────────────────── */
    .dashboard-split {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }

    .card-header {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .card-body { padding: 0; }

    /* ── Leaflet Map ───────────────────────────────────────────────────── */
    #map {
      height: 480px;
      width: 100%;
      background: var(--surface-2);
    }

    .leaflet-container {
      background: #1a1f2e !important;
      font-family: var(--font) !important;
    }

    .leaflet-popup-content-wrapper {
      background: var(--surface) !important;
      color: var(--text) !important;
      border: 1px solid var(--border) !important;
      border-radius: var(--radius) !important;
      box-shadow: var(--shadow) !important;
    }

    .leaflet-popup-tip { background: var(--surface) !important; }

    .popup-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
    .popup-row { font-size: 12px; color: var(--text-muted); margin: 2px 0; }

    /* ── Tables ────────────────────────────────────────────────────────── */
    .table-wrap {
      overflow-x: auto;
      overflow-y: auto;
      max-height: 480px;
    }

    .table-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
    .table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

    table {
      width: 100%;
      min-width: 560px;
      border-collapse: collapse;
      font-size: 13px;
    }

    thead th {
      background: var(--surface-2);
      color: var(--text-muted);
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .4px;
      padding: 9px 12px;
      text-align: left;
      position: sticky;
      top: 0;
      z-index: 10;
      white-space: nowrap;
      cursor: pointer;
      user-select: none;
      border-bottom: 1px solid var(--border);
    }

    thead th:hover { color: var(--text); }
    thead th.sorted { color: var(--accent); }
    .sort-icon { margin-left: 4px; }

    tbody tr { border-bottom: 1px solid rgba(45,55,72,.5); transition: background .1s; cursor: pointer; }
    tbody tr:nth-child(even) { background: rgba(26,31,46,.4); }
    tbody tr:hover { background: var(--accent-dim); }

    td { padding: 9px 12px; color: var(--text); vertical-align: middle; }
    td.muted { color: var(--text-muted); }
    td .cell-title { font-weight: 500; font-size: 13px; margin-bottom: 1px; }
    td .cell-sub { font-size: 11px; color: var(--text-muted); }

    /* ── Badges ────────────────────────────────────────────────────────── */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .badge-zusage  { background: rgba(34,197,94,.15);  color: var(--success); }
    .badge-absage  { background: rgba(239,68,68,.15);  color: var(--danger); }
    .badge-aufhebung { background: rgba(245,158,11,.15); color: var(--warning); }
    .badge-offen   { background: rgba(59,130,246,.15); color: var(--accent); }
    .badge-abgegeben { background: rgba(148,163,184,.15); color: var(--text-muted); }

    /* ── Action Buttons in Table ───────────────────────────────────────── */
    .actions { display: flex; gap: 4px; }

    /* ── Empty State ───────────────────────────────────────────────────── */
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--text-muted);
    }

    .empty-state svg { margin-bottom: 16px; opacity: .4; }
    .empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
    .empty-state p { font-size: 13px; max-width: 300px; margin: 0 auto 16px; }

    /* ── Skeleton Loading ──────────────────────────────────────────────── */
    .skeleton {
      background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      border-radius: 4px;
    }

    @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .skeleton-row { height: 44px; margin-bottom: 1px; }
    .skeleton-card { height: 88px; border-radius: var(--radius-lg); margin-bottom: 14px; }

    /* ── Form Styles ───────────────────────────────────────────────────── */
    .form-section {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      margin-bottom: 16px;
    }

    .form-section-header {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .form-section-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .form-section-body { padding: 18px; }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
    }

    .form-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .col-span-2 { grid-column: span 2; }
    .col-span-3 { grid-column: span 3; }

    .form-group { display: flex; flex-direction: column; gap: 5px; }

    .form-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .form-label .required { color: var(--danger); }

    .form-control {
      background: var(--surface-2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 8px 10px;
      border-radius: 6px;
      font-family: var(--font);
      font-size: 13px;
      outline: none;
      transition: border-color .15s;
      width: 100%;
    }

    .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
    .form-control::placeholder { color: var(--text-dim); }
    .form-control[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }

    select.form-control {
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      padding-right: 28px;
      cursor: pointer;
    }

    textarea.form-control { resize: vertical; min-height: 80px; }

    .input-group {
      display: flex;
      gap: 6px;
    }

    .input-group .form-control { flex: 1; }

    .input-addon {
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 8px 10px;
      color: var(--text-muted);
      font-size: 13px;
      white-space: nowrap;
    }

    /* ── LB Block ──────────────────────────────────────────────────────── */
    .lb-block {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      margin-bottom: 12px;
      overflow: hidden;
    }

    .lb-block-header {
      background: var(--surface-3);
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border);
    }

    .lb-block-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .lb-block-body { padding: 14px; }

    .sub-section {
      background: var(--surface);
      border: 1px solid var(--border-light);
      border-radius: var(--radius);
      margin-top: 12px;
      overflow: hidden;
    }

    .sub-section-header {
      padding: 8px 12px;
      background: rgba(45,55,72,.3);
      border-bottom: 1px solid var(--border-light);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .sub-section-body { padding: 10px 12px; }

    .kg-row, .bl-row {
      display: flex;
      gap: 6px;
      align-items: center;
      margin-bottom: 6px;
    }

    .kg-row:last-child, .bl-row:last-child { margin-bottom: 0; }

    /* ── Summen ────────────────────────────────────────────────────────── */
    .summen-box {
      background: var(--surface);
      border: 1px solid var(--accent);
      border-radius: var(--radius-lg);
      padding: 16px 20px;
      margin-bottom: 16px;
    }

    .summen-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--accent);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 12px;
    }

    .summen-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
    }

    .summen-item { }
    .summen-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
    .summen-value { font-size: 17px; font-weight: 700; color: var(--text); }
    .summen-total { font-size: 22px; color: var(--success); }

    /* ── Stats ─────────────────────────────────────────────────────────── */
    .stats-kpi-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 12px;
      margin-bottom: 20px;
    }

    .stats-kpi {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 14px;
      text-align: center;
    }

    .stats-kpi-value { font-size: 22px; font-weight: 700; }
    .stats-kpi-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
    .stats-kpi-sub { font-size: 12px; font-weight: 600; margin-top: 2px; }

    .charts-grid {
      display: grid;
      grid-template-columns: 1fr 1.5fr 1.5fr;
      gap: 16px;
      margin-bottom: 20px;
    }

    .chart-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px;
    }

    .chart-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
    .chart-container { position: relative; }

    /* ── Modal ─────────────────────────────────────────────────────────── */
    #modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.65);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    #modal-overlay.open { display: flex; }

    .modal {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
      width: 100%;
      max-width: 900px;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .modal-header {
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    .modal-title {
      font-size: 16px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .modal-close {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px;
      border-radius: 4px;
      transition: color .15s;
    }

    .modal-close:hover { color: var(--text); }

    .modal-tabs {
      display: flex;
      border-bottom: 1px solid var(--border);
      padding: 0 20px;
      flex-shrink: 0;
    }

    .modal-tab {
      padding: 10px 16px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: color .15s, border-color .15s;
      margin-bottom: -1px;
    }

    .modal-tab:hover { color: var(--text); }
    .modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

    .modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
    }

    .modal-body::-webkit-scrollbar { width: 5px; }
    .modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

    .modal-footer {
      padding: 14px 20px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      flex-shrink: 0;
    }

    /* ── Detail View ───────────────────────────────────────────────────── */
    .detail-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-bottom: 20px;
    }

    .detail-item { }
    .detail-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
    .detail-value { font-size: 14px; color: var(--text); font-weight: 500; }

    .accordion-item {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-bottom: 8px;
      overflow: hidden;
    }

    .accordion-header {
      padding: 12px 16px;
      background: var(--surface-2);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 600;
      font-size: 13px;
    }

    .accordion-body {
      padding: 14px 16px;
      display: none;
      border-top: 1px solid var(--border);
    }

    .accordion-body.open { display: block; }

    /* ── Toast ─────────────────────────────────────────────────────────── */
    #toast-container {
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 2000;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .toast {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px 16px;
      font-size: 13px;
      color: var(--text);
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 280px;
      animation: slideIn .2s ease;
    }

    @keyframes slideIn {
      from { transform: translateX(100%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    .toast-success { border-left: 3px solid var(--success); }
    .toast-error   { border-left: 3px solid var(--danger); }
    .toast-info    { border-left: 3px solid var(--accent); }
    .toast-warning { border-left: 3px solid var(--warning); }

    /* ── Search ────────────────────────────────────────────────────────── */
    .search-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
    }

    .search-input-wrap {
      position: relative;
      flex: 1;
    }

    .search-input-wrap svg {
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
      color: var(--text-dim);
    }

    .search-input {
      width: 100%;
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 8px 10px 8px 34px;
      border-radius: 6px;
      font-family: var(--font);
      font-size: 13px;
      outline: none;
      transition: border-color .15s;
    }

    .search-input:focus { border-color: var(--accent); }

    /* ── Spinner ───────────────────────────────────────────────────────── */
    .spinner {
      width: 24px;
      height: 24px;
      border: 3px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin .7s linear infinite;
      display: inline-block;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    .loading-state {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 40px;
      color: var(--text-muted);
      font-size: 14px;
    }

    /* ── Bundesland Table ──────────────────────────────────────────────── */
    .bl-quota {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .mini-bar {
      flex: 1;
      height: 4px;
      background: var(--surface-3);
      border-radius: 2px;
      overflow: hidden;
    }

    .mini-bar-fill {
      height: 100%;
      background: var(--success);
      border-radius: 2px;
    }

    /* ── Scrollbar global ──────────────────────────────────────────────── */
    #sidebar::-webkit-scrollbar { width: 4px; }
    #sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

    /* ── Leaflet overrides ─────────────────────────────────────────────── */
    .leaflet-control-zoom a {
      background: var(--surface) !important;
      color: var(--text) !important;
      border-color: var(--border) !important;
    }

    .leaflet-control-attribution {
      background: rgba(26,31,46,.85) !important;
      color: var(--text-dim) !important;
    }

    .leaflet-control-attribution a { color: var(--text-muted) !important; }

    .warning-box {
      background: rgba(245,158,11,.1);
      border: 1px solid rgba(245,158,11,.3);
      border-radius: var(--radius);
      padding: 10px 14px;
      font-size: 12px;
      color: var(--warning);
      margin-top: 12px;
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    /* ── Form bottom bar ───────────────────────────────────────────────── */
    .form-actions {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .form-total {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }

    .form-total span {
      font-size: 20px;
      color: var(--success);
      margin-left: 8px;
    }
.p-kalender { display:grid; grid-template-columns:repeat(7,minmax(115px,1fr)); gap:6px; overflow-x:auto; }
.p-kalendertag { min-height:95px; padding:9px; border:1px solid var(--border,#313a4d); border-radius:6px; background:var(--bg-card,#1a2030); }
.p-wochentag { padding:8px; font-weight:600; }
.p-abwesend { margin-top:6px; padding:6px; background:#244368; color:#e9f2ff; border-radius:4px; }
#personal-fenster [hidden] { display:none !important; }
#personal-fenster .ho-fenster-rumpf { max-height:72vh; overflow:auto; }
#personal-fenster hr { margin:24px 0; border:0; border-top:1px solid #394155; }
.ho-leiste #p-monat { color-scheme:dark; background:#202940; color:#edf2fa; border:1px solid #394155; border-radius:6px; padding:7px 10px; }
