/* ===== KADERSITZUNG (ks-) ===== */
  .ks-session-banner {
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
  }
  .ks-pulse { width: 8px; height: 8px; background: #fff; border-radius: 50%; animation: ks-pulse 1.5s infinite; }
  @keyframes ks-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
  .ks-session-banner .ks-meta { font-size: 12px; opacity: 0.92; }

  .ks-pre-meeting {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 14px;
  }
  .ks-pm-card {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--text-dim);
    border-radius: var(--radius); padding: 10px 12px; cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .ks-pm-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
  .ks-pm-card.success { border-left-color: #15803d; }
  .ks-pm-card.warning { border-left-color: #b45309; }
  .ks-pm-card.purple  { border-left-color: #6d28d9; }
  .ks-pm-card.danger  { border-left-color: #b91c1c; }
  .ks-pm-label { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
  .ks-pm-value { font-size: 22px; font-weight: 700; line-height: 1.1; margin: 2px 0; }
  .ks-pm-detail { font-size: 11px; color: var(--text-dim); }

  .ks-filter-bar {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 14px;
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
  }
  .ks-filter-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px;
  }
  .ks-pill {
    padding: 4px 12px; border-radius: 999px; font-size: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
    cursor: pointer; transition: all 0.12s;
  }
  .ks-pill:hover { border-color: var(--border-strong); color: var(--text); }
  .ks-pill.active { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); font-weight: 600; }
  .ks-search {
    margin-left: auto; min-width: 240px;
    padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 12px; font-family: inherit;
  }

  /* Layout: 8 Bereiche untereinander, Buckets horizontal innerhalb jeder Zeile */
  .ks-board { padding-bottom: 30px; }
  .ks-lanes { display: flex; flex-direction: column; gap: 10px; }
  .ks-area-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  .ks-area-row-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: filter 0.12s;
  }
  .ks-area-row-header:hover { filter: brightness(0.96); }
  /* Name reserviert fixe Mindestbreite, damit Quick-Actions über alle Bereiche
     vertikal bündig stehen — auch wenn der Bereichs-Name kürzer ist. */
  .ks-area-row-header .name {
    font-weight: 700;
    min-width: 220px;
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 10px;
  }
  .ks-area-row-header .count {
    margin-left: auto;
    font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 700;
  }
  .ks-area-row-header .chev {
    width: 16px; height: 16px;
    transition: transform 0.18s;
  }
  .ks-area-row.collapsed .chev { transform: rotate(-90deg); }
  .ks-area-actions { display: inline-flex; gap: 6px; align-items: center; }
  .ks-area-qa {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,0.7);
    border: 1px solid; border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter 0.12s, background 0.12s;
  }
  .ks-area-qa:hover { filter: brightness(0.95); background: rgba(255,255,255,0.95); }
  .ks-ab-nr {
    display: inline-grid; place-items: center;
    width: 24px; height: 24px; border-radius: 5px;
    font-size: 12px; font-weight: 800;
  }
  .ks-buckets {
    display: flex; gap: 8px; padding: 10px;
    background: var(--bg);
    overflow-x: auto;
  }
  .ks-area-row.collapsed .ks-buckets { display: none; }
  .ks-area-row.collapsed { background: var(--bg); }
  .ks-bucket {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-height: 60px;
    display: flex; flex-direction: column;
  }
  /* Umfrage-Buckets etwas schmaler — mehr Teilnehmer auf einen Blick */
  .ks-bucket-umfrage { width: 200px; background: #fafdff; }

  /* Modul-Karte: aggregiert eine Gruppe gleichartiger Karten (z.B. Kundenreaktionen) */
  .ks-module-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border: 1px solid #d4a83a;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.12s;
  }
  .ks-module-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: #b8932f; }
  .ks-module-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: #d4a83a; color: #fff;
    display: grid; place-items: center; flex-shrink: 0;
  }
  .ks-module-body { flex: 1; min-width: 0; }
  .ks-module-title { font-weight: 700; font-size: 13px; line-height: 1.2; }
  .ks-module-sub { font-size: 11px; color: #6f5418; margin-top: 2px; }
  .ks-module-chev { color: #8a6a14; }

  /* Variante "red" — für CAPA (Korrektur-/Vorbeugemassnahmen) */
  .ks-module-card-red {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    border-color: #dc2626;
  }
  .ks-module-card-red:hover { border-color: #b91c1c; }
  .ks-module-card-red .ks-module-icon { background: #dc2626; }
  .ks-module-card-red .ks-module-sub { color: #7f1d1d; }
  .ks-module-card-red .ks-module-chev { color: #991b1b; }

  /* Mini-Pills für Register-Tabellen (Status, Risiko, Typ) */
  .ks-pill-mini {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 700;
    background: #f1f5f9; color: #475569;
    line-height: 1.5;
  }

  /* Kundenreaktions-Register View */
  .ks-register {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .ks-register-toolbar {
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  }
  .ks-register-toolbar input, .ks-register-toolbar select {
    padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px;
  }
  .ks-register-toolbar input { flex: 1; min-width: 180px; }
  .ks-register-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
  }
  .ks-register-table th {
    background: var(--bg); padding: 8px 10px; text-align: left;
    font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
  }
  .ks-register-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    vertical-align: top;
  }
  .ks-register-table tr:hover td { background: var(--bg); cursor: pointer; }
  .ks-tonalitaet-pill {
    display: inline-block; padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 600;
  }
  .ks-tonalitaet-pill.positiv { background: #dcfce7; color: #15803d; }
  .ks-tonalitaet-pill.neutral { background: #f1f5f9; color: #475569; }
  .ks-tonalitaet-pill.negativ { background: #fecaca; color: #7f1d1d; }
  .ks-bucket-header {
    font-size: 10px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 2px 4px 8px;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700;
  }
  .ks-bucket-add {
    background: none; border: 1px dashed var(--border-strong); cursor: pointer;
    color: var(--text-muted); width: 18px; height: 18px;
    border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; transition: all 0.12s; opacity: 0.55;
  }
  .ks-bucket:hover .ks-bucket-add { opacity: 1; }
  .ks-bucket-add:hover { background: var(--brand); border-color: var(--brand); color: #fff; opacity: 1; }
  .ks-dropzone {
    flex: 1; min-height: 40px; border-radius: var(--radius-sm);
    transition: background 0.12s, outline 0.12s;
  }
  .ks-dropzone.drag-over {
    background: var(--brand-soft);
    outline: 2px dashed var(--brand); outline-offset: -2px;
  }

  .ks-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 6px;
    cursor: grab; transition: all 0.12s; position: relative;
  }
  .ks-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
  .ks-card:active { cursor: grabbing; }
  .ks-card.dragging { opacity: 0.4; }
  .ks-card.selected {
    border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft);
  }
  .ks-card .ks-card-badges { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
  .ks-badge {
    font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.3px;
  }
  .ks-badge.neu        { background: #dcfce7; color: #15803d; }
  .ks-badge.schlepper  { background: #fef3c7; color: #b45309; }
  .ks-badge.vertraulich{ background: var(--bg); color: var(--text-muted); }
  .ks-badge.vertagt    { background: #ede9fe; color: #6d28d9; }
  .ks-card .ks-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 6px; }
  .ks-card .ks-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
  .ks-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; border: 1px solid var(--surface);
  }
  .ks-avatar-stack { display: flex; }
  .ks-avatar-stack .ks-avatar:not(:first-child) { margin-left: -6px; }
  .ks-due {
    font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600;
  }
  .ks-due.overdue  { background: #fecaca; color: #7f1d1d; }
  .ks-due.upcoming { background: #dcfce7; color: #15803d; }
  .ks-due.wv       { background: #ede9fe; color: #6d28d9; }
  .ks-meta-icons { display: flex; gap: 6px; align-items: center; color: var(--text-dim); font-size: 11px; }
  .ks-meta-icons .ks-ic { display: inline-flex; align-items: center; gap: 2px; }

  /* Side Panel */
  .ks-side-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 640px; max-width: 96vw;
    background: var(--surface);
    border-left: 2px solid var(--brand); box-shadow: var(--shadow-md);
    z-index: 60; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.22s ease;
  }
  .ks-side-panel.open { transform: translateX(0); }
  .ks-panel-header {
    padding: 16px 50px 16px 20px; border-bottom: 1px solid var(--border); position: relative;
  }
  .ks-panel-close {
    position: absolute; top: 10px; right: 10px;
    background: var(--surface); border: 1px solid var(--border); cursor: pointer;
    color: var(--text-muted); padding: 6px; border-radius: 6px;
    z-index: 5; line-height: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .ks-panel-close:hover { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
  .ks-panel-close svg, .ks-panel-close i { pointer-events: none; }
  .ks-crumb {
    font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em;
  }
  .ks-panel-header h3 { margin: 4px 0 8px; font-size: 17px; }
  .ks-badges { display: flex; gap: 4px; flex-wrap: wrap; }
  .ks-panel-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
  .ks-panel-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px 32px;
    margin-bottom: 18px;
  }
  .ks-section { margin: 0; }
  .ks-section + .ks-section-bottom {
    margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border);
  }
  .ks-section h4 {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
    margin: 0 0 8px; font-weight: 700;
  }
  .ks-section h4 .ks-supabase {
    color: var(--brand-dark);
    text-transform: uppercase; font-weight: 700;
  }
  .ks-line { font-size: 13px; margin-bottom: 4px; line-height: 1.45; }
  .ks-line .ks-k { color: var(--text-muted); margin-right: 6px; }
  .ks-ref-line {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; margin-bottom: 4px; color: var(--text);
  }
  .ks-ref-line i { color: var(--text-muted); width: 14px; height: 14px; }
  .ks-sub-line {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; margin-bottom: 3px;
  }
  .ks-sub-line input { accent-color: var(--brand); }
  .ks-attachments-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .ks-attachment {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; font-size: 12px; color: var(--text);
  }
  .ks-attachment i { width: 12px; height: 12px; color: var(--text-muted); }
  .ks-history-line {
    font-size: 12px; color: var(--text-muted); line-height: 1.55;
    margin-top: 4px;
  }
  .ks-history-line .sep { color: var(--text-dim); margin: 0 4px; }
  .ks-panel-footer {
    border-top: 1px solid var(--border); padding: 12px 20px;
    display: flex; gap: 6px; flex-wrap: wrap;
  }

  /* Kadersitzung Modals (separate stack damit kein Konflikt mit Rapport-Modal) */
  .ks-modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px;
  }
  .ks-modal {
    background: var(--surface); border-radius: 12px;
    width: 100%; max-width: 600px; max-height: 90vh; overflow: auto;
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
  }
  .ks-modal-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
  }
  .ks-modal-header h3 { margin: 0; font-size: 15px; }
  .ks-modal-body { padding: 18px 20px; }
  .ks-modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
  }
  .ks-form-row { margin-bottom: 14px; }
  .ks-form-row label {
    display: block; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; font-weight: 700;
  }
  .ks-form-row input, .ks-form-row select, .ks-form-row textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
    background: var(--surface); color: var(--text);
  }
  .ks-form-row input:focus, .ks-form-row select:focus, .ks-form-row textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft);
  }
  .ks-presence-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ks-presence-item {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px;
    display: flex; align-items: center; gap: 8px;
  }
  .ks-presence-item .name { flex: 1; font-size: 13px; }
  .ks-presence-item select {
    font-size: 11px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px;
  }

  .ks-beschluss-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .ks-beschluss-option {
    padding: 12px; border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.12s; text-align: left;
    background: var(--surface);
  }
  .ks-beschluss-option:hover { border-color: var(--border-strong); }
  .ks-beschluss-option.selected { border-color: var(--brand); background: var(--brand-soft); }
  .ks-beschluss-option .ico { font-size: 16px; margin-bottom: 4px; color: var(--brand); }
  .ks-beschluss-option .name { font-weight: 700; font-size: 13px; }
  .ks-beschluss-option .desc { font-size: 11px; color: var(--text-muted); }

  .ks-protokoll-preview {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; font-size: 12px; max-height: 420px; overflow-y: auto; line-height: 1.6;
  }
  .ks-protokoll-preview h2 { font-size: 14px; margin: 0 0 8px; color: var(--brand-dark); }
  .ks-protokoll-preview h3 {
    font-size: 11px; margin: 12px 0 4px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .ks-protokoll-preview ul { margin: 4px 0; padding-left: 18px; }
  .ks-protokoll-preview li { margin: 2px 0; }
  .ks-protokoll-preview .meta { color: var(--text-dim); font-size: 11px; }
