﻿/* ============================================================
   Camplex — Design-System (portiert aus dem Claude-Design-Projekt
   app/camplex.css) und auf MudBlazor gelegt.

   Unterschiede zum Prototyp:
   - keine feste Maximalbreite: der Inhalt fuellt den Bildschirm
   - MudBlazor-Komponenten (Paper/Card/Table/Dialog) erben den Look
   ============================================================ */

/*
   Farben kommen aus der MudBlazor-Palette (--mud-palette-*). MudBlazor tauscht diese
   Variablen beim Umschalten auf Dark Mode aus - dadurch folgt das ganze Design-System
   automatisch mit, ohne eigene Dark-Klasse.
*/
:root {
    --accent: var(--mud-palette-primary, #0091D9);
    --accent-2: #0079B8;
    --accent-light: #4FB6EC;
    --accent-bg: var(--mud-palette-primary-hover, rgba(0,145,217,.06));
    --accent-deep: #00618C;

    --green: var(--mud-palette-success, #2E9E5B);
    --green-deep: #1F7D44;
    --orange: var(--mud-palette-warning, #E07B39);
    --purple: #8E24AA;
    --pink: #EC407A;

    --bg: var(--mud-palette-background, #F5F7F9);
    --surface: var(--mud-palette-surface, #FFFFFF);
    --surface-2: var(--mud-palette-background-gray, #F3F6F8);
    --text: var(--mud-palette-text-primary, #182430);
    --text-sec: var(--mud-palette-text-secondary, #54626F);
    --text-muted: var(--mud-palette-text-disabled, #93A0AC);
    --divider: var(--mud-palette-divider, #E9EDF1);
    --info-bg: var(--mud-palette-info-hover, #EAF5FC);

    --success: var(--mud-palette-success, #2E9E5B);
    --warning: var(--mud-palette-warning, #E07B39);
    --error: var(--mud-palette-error, #E04443);
    --info: var(--mud-palette-info, #0091D9);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --shadow-1: 0 1px 2px rgba(24,45,72,.05), 0 1px 3px rgba(24,45,72,.04);
    --shadow-2: 0 2px 6px rgba(24,45,72,.05), 0 6px 18px rgba(24,45,72,.05);
    --shadow-3: 0 4px 12px rgba(24,45,72,.06), 0 16px 40px rgba(24,45,72,.08);
    --shadow-hover: 0 8px 20px rgba(24,45,72,.08), 0 20px 48px rgba(24,45,72,.12);

    /* Shell-Masse */
    --appbar-h: 64px;
    --page-gutter: 24px;
    --shell-gap: 18px;
}

/* Im Dunkelmodus tragen die Schatten nicht - kraeftiger setzen. */
.cx-dark {
    --shadow-1: 0 1px 3px rgba(0,0,0,.4);
    --shadow-2: 0 4px 16px rgba(0,0,0,.4);
    --shadow-3: 0 10px 30px rgba(0,0,0,.5);
    --shadow-hover: 0 16px 40px rgba(0,0,0,.6);
    --accent-bg: rgba(0,145,217,.16);
}

body {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    letter-spacing: .1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   VOLLE BREITE — Container duerfen nicht mehr begrenzen
   ============================================================ */
.mud-container.mud-container-maxwidth-false,
.mud-container {
    max-width: none !important;
    width: 100%;
    /* Erzwungen, damit die pa-*-Klassen der einzelnen Seiten die Breite nicht
       verschieben - sonst ist der blaue Kopf auf jeder Seite anders breit. */
    padding-left: var(--page-gutter) !important;
    padding-right: var(--page-gutter) !important;
}

.mud-main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    /* Die AppBar ist fixiert und belegt keinen Platz im Fluss - ihre Hoehe muss hier
       ausgeglichen werden, sonst rutscht der Inhalt darunter und die klebende
       Navigation legt sich ueber den Seitenkopf. Dazu noch etwas Luft. */
    padding-top: calc(var(--appbar-h) + var(--shell-gap)) !important;
    background: var(--bg);
    min-height: calc(100vh - var(--appbar-h));
}

.mud-layout {
    background: var(--bg);
}

@media (max-width: 720px) {
    :root { --page-gutter: 12px; }
}

/* ============================================================
   APP BAR — flaches, helles Blau
   ============================================================ */
.cx-appbar.mud-appbar {
    height: var(--appbar-h);
    background: linear-gradient(180deg, #0699E1 0%, #0091D9 100%) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 16px rgba(0,97,140,.18) !important;
    border-radius: 0 !important;
    padding: 0 22px;
}

.cx-appbar .mud-toolbar {
    height: var(--appbar-h);
    min-height: var(--appbar-h);
    padding: 0;
}

.cx-appbar-left { display: flex; align-items: center; gap: 14px; cursor: pointer; }

.cx-appbar-logo {
    width: 46px; height: 46px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
}
.cx-appbar-logo img { width: 42px; height: 42px; display: block; object-fit: contain; }

.cx-appbar-title { font-size: 20px; font-weight: 700; color: #fff; margin: 0; letter-spacing: -.1px; line-height: 1.05; }
.cx-appbar-sub { font-size: 11px; color: rgba(255,255,255,.85); margin-top: 1px; font-weight: 500; }
.cx-appbar-right { display: flex; align-items: center; gap: 6px; }

.cx-appbar .mud-icon-button { color: #fff; }
.cx-appbar .mud-icon-button:hover { background: rgba(255,255,255,.16); }

.cx-role-chip {
    background: rgba(255,255,255,.18); color: #fff;
    padding: 4px 11px; border-radius: 999px; font-size: 10px; font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase;
    border: 1px solid rgba(255,255,255,.22); white-space: nowrap;
}

/* Lager-Umschalter */
.cx-camp-switch {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.26);
    padding: 8px 16px; border-radius: 11px; cursor: pointer; font-size: 14px; font-weight: 600;
    transition: background .15s, border-color .15s;
}
.cx-camp-switch:hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.4); }
.cx-camp-switch span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Benachrichtigungs-Badge */
.cx-bell { position: relative; }
.cx-bell-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #0091D9;
}

/* Benachrichtigungs-Panel */
.cx-notif { width: 400px; max-width: 92vw; }
.cx-notif-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 10px; font-weight: 700; font-size: 15px;
    border-bottom: 1px solid var(--divider);
}
.cx-notif-list { max-height: 420px; overflow-y: auto; }
.cx-notif-item {
    display: flex; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--divider); cursor: pointer;
    transition: background .12s;
}
.cx-notif-item:hover { background: var(--accent-bg); }
.cx-notif-item.unread { background: var(--accent-bg); }
.cx-notif-item.unread .cx-notif-title::after {
    content: ''; display: inline-block; width: 7px; height: 7px;
    border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle;
}
.cx-notif-icon {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.cx-notif-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cx-notif-text { font-size: 12.5px; color: var(--text-sec); margin-top: 2px; line-height: 1.35; }
.cx-notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.cx-notif-empty { padding: 34px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.cx-notif-foot { padding: 8px; display: flex; justify-content: space-between; gap: 8px; }
.cx-notif-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.cx-notif-tab {
    padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; color: var(--text-muted); border: 0; background: transparent;
}
.cx-notif-tab.active { background: var(--accent-bg); color: var(--accent-2); }

/* ============================================================
   CAMP NAV — blaue Pill-Leiste, volle Breite
   ============================================================ */
.cx-nav {
    position: sticky; top: var(--appbar-h); z-index: 1100;
    background: var(--bg); padding: 14px var(--page-gutter) 6px;
}
.cx-nav-bar {
    display: flex; align-items: center; gap: 3px;
    padding: 6px 8px;
    background: linear-gradient(180deg, #0699E1 0%, #0091D9 100%);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,97,140,.20);
    flex-wrap: wrap; width: 100%;
    overflow: visible;
}
.cx-nav-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 14px; border-radius: 11px;
    font-size: .86rem; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    border: 0; background: transparent; color: rgba(255,255,255,.9);
    transition: all .15s ease; user-select: none; position: relative;
}
.cx-nav-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.cx-nav-btn.active { background: #fff; color: var(--accent-2); font-weight: 600; box-shadow: 0 2px 6px rgba(0,60,90,.16); }
.cx-nav-btn .mud-icon-root { font-size: 18px !important; color: inherit; }
.cx-nav-btn .chevron { font-size: 9px; opacity: .7; transition: transform .2s; }
.cx-nav-btn.open .chevron { transform: rotate(180deg); }
.cx-nav-group { position: relative; }
.cx-nav-dropdown {
    position: absolute; top: calc(100% + 10px); left: 50%;
    transform: translateX(-50%);
    min-width: 250px; background: var(--surface);
    border-radius: 14px; box-shadow: var(--shadow-3);
    padding: 6px; z-index: 9999; border: 1px solid var(--divider);
}
.cx-dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    font-size: .85rem; cursor: pointer; color: var(--text);
    transition: all .15s;
}
.cx-dd-item:hover { background: var(--accent-bg); }
.cx-dd-item.active { font-weight: 600; color: var(--accent-2); background: var(--accent-bg); }
.cx-dd-item .mud-icon-root { font-size: 18px !important; opacity: .85; color: var(--accent-2); }
.cx-dd-sep { height: 1px; background: var(--divider); margin: 4px 8px; }
.cx-dd-head {
    padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted); font-weight: 700;
}
.cx-nav-backdrop { position: fixed; inset: 0; z-index: 1099; }

@media (max-width: 1100px) {
    .cx-nav-btn span:not(.chevron) { display: none; }
    .cx-nav-btn { padding: 9px 11px; }
}

/* ============================================================
   HERO — flache blaue Kopfkarte
   ============================================================ */
/* Fixe Höhe, damit der blaue Kopf auf jeder Seite identisch ist.
   Die Breite ergibt sich aus dem Container - der ist überall gleich. */
.cx-hero, .hero-header {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #12A2E6 0%, #0089CE 60%, #0079B8 100%);
    color: #fff; position: relative; overflow: hidden;
    /* Waechst mit: bei langen Titeln und vielen Aktionen umbrechen die
       Knoepfe sonst in eine zweite Reihe und laufen ueber den Titel. */
    min-height: 79px; box-sizing: border-box;
    padding: 10px 26px; margin-bottom: 18px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px;
    box-shadow: 0 6px 22px rgba(0,97,140,.20);
}
.cx-hero::after, .hero-header::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(120% 140% at 88% -20%, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 55%);
}
.cx-hero-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0; position: relative; z-index: 1;
}
.cx-hero-avatar img { width: 34px; height: 34px; border-radius: 9px; }
.cx-hero-avatar .mud-icon-root { font-size: 24px !important; color: #fff; }
.cx-hero-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: rgba(255,255,255,.8); margin-bottom: 5px; position: relative; z-index: 1;
}
.cx-hero-title {
    font-size: 21px; font-weight: 800; margin: 0; line-height: 1.15; letter-spacing: -.4px;
    position: relative; z-index: 1; flex: 1 1 auto; min-width: 180px;
}
.cx-hero-sub { font-size: 14.5px; color: rgba(255,255,255,.9); margin-top: 5px; position: relative; z-index: 1; }
.cx-hero-bg-icon {
    position: absolute; right: -4px; bottom: -26px; opacity: .09;
    font-size: 130px !important; pointer-events: none; transform: rotate(-6deg);
}
/* Aktionen immer ganz rechts, primaere Aktion zuletzt */
.cx-hero-actions {
    display: flex; gap: 8px; margin-left: auto; z-index: 1;
    flex-wrap: wrap; position: relative; align-items: center; justify-content: flex-end;
}
/* ---- Kopf-Aktionen: ein einziger Button-Stil fuer die ganze App ----
   Pillen fuer Aktionen mit Text, Kreise fuer Icon-Aktionen. Beide mit
   halbtransparentem Grund und weissem Rahmen auf dem blauen Kopf. */
.cx-hero-actions .mud-button-root {
    border-radius: 999px !important;
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.34) !important;
    box-shadow: none !important;
    text-transform: none;
    font-weight: 600;
    padding: 6px 17px;
    min-height: 34px;
}
.cx-hero-actions .mud-button-root:hover { background: rgba(255,255,255,.30) !important; }
.cx-hero-actions .mud-button-root .mud-icon-root { color: #fff !important; }

/* Icon-Buttons als Kreis im gleichen Stil */
.cx-hero-actions .mud-icon-button {
    width: 34px; height: 34px;
    border-radius: 50% !important;
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.34) !important;
    box-shadow: none !important;
}
.cx-hero-actions .mud-icon-button:hover { background: rgba(255,255,255,.30) !important; }
.cx-hero-actions .mud-icon-button .mud-icon-root { color: #fff !important; font-size: 19px !important; }
/* MudTooltip wickelt den Button in ein zusaetzliches Element */
.cx-hero-actions .mud-tooltip-root { display: inline-flex; }
.cx-hero-countdown {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
    border-radius: 10px; padding: 5px 13px; min-width: 78px; position: relative; z-index: 1;
}
.cx-hero-countdown-value { font-size: 23px; font-weight: 800; line-height: 1; color: #fff; }
.cx-hero-countdown-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
    color: rgba(255,255,255,.85); margin-top: 4px; text-align: center; font-weight: 600; line-height: 1.3;
}
@media (max-width: 600px) {
    .cx-hero, .hero-header { height: auto; min-height: 0; padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
    .cx-hero-title { font-size: 22px; }
    .cx-hero-bg-icon { font-size: 130px !important; }
    .cx-hero-actions { margin-left: 0; width: 100%; }
}

/* ============================================================
   KENNZAHLEN-LEISTE (ersetzt die Zaehler-Kacheln)
   Eine Zeile statt vier Karten - gleiche Information, ein Viertel Platz.
   ============================================================ */
.cx-statstrip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 30px;
    background: var(--surface); border: 1px solid var(--divider);
    border-radius: var(--radius-md); box-shadow: var(--shadow-1);
    padding: 13px 20px;
}
.cx-stat { display: flex; align-items: center; gap: 8px; }
.cx-stat .mud-icon-root { font-size: 20px !important; }
.cx-stat-value { font-size: 19px; font-weight: 800; letter-spacing: -.3px; line-height: 1; }
.cx-stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
@media (max-width: 600px) {
    .cx-statstrip { gap: 8px 18px; padding: 11px 14px; }
    .cx-stat-value { font-size: 16px; }
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.cx-section-title {
    font-size: 18px; font-weight: 700; margin: 26px 0 14px;
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text); gap: 10px; flex-wrap: wrap; letter-spacing: -.2px;
}
.cx-section-title > span:first-child { display: flex; align-items: center; gap: 10px; }
.cx-section-title > span:first-child::before {
    content: ''; display: inline-block; width: 4px; height: 17px;
    background: var(--accent); border-radius: 3px;
}

/* ============================================================
   MUDBLAZOR-KOMPONENTEN AN DAS DESIGN ANGLEICHEN
   ============================================================ */
.mud-paper, .mud-card {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-1) !important;
    border: 1px solid var(--divider);
    background-color: var(--surface);
}
.mud-paper-outlined { border: 1px solid var(--divider) !important; }

.mud-table {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-1) !important;
    border: 1px solid var(--divider);
    overflow: hidden;
}
.mud-table-head .mud-table-cell {
    background: var(--surface-2);
    color: var(--text-sec);
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid var(--divider);
}
.mud-table-body .mud-table-cell { font-size: 13px; border-bottom: 1px solid var(--divider); }
.mud-table-body .mud-table-row:hover .mud-table-cell { background: var(--accent-bg); }

/* Listentabellen: erste Spalte linksbuendig (Bezeichnung), alle weiteren
   Spalten zentriert, die letzte Spalte rechtsbuendig fuer die Aktionen.
   Wird ueber Class="cx-table" auf der MudTable aktiviert. */
.cx-table .mud-table-cell { text-align: center; }
.cx-table .mud-table-cell:first-child { text-align: left; }
.cx-table .mud-table-cell:last-child { text-align: right; }

/* Sortier-Labels im Kopf sind Flex-Container - die muessen mitziehen. */
.cx-table .mud-table-head .mud-table-cell .mud-table-sort-label { justify-content: center; }
.cx-table .mud-table-head .mud-table-cell:first-child .mud-table-sort-label { justify-content: flex-start; }
.cx-table .mud-table-head .mud-table-cell:last-child .mud-table-sort-label { justify-content: flex-end; }

/* Aktionsspalte: Buttons buendig am rechten Rand, ohne Umbruch. */
.cx-table .mud-table-cell:last-child { white-space: nowrap; }
.cx-table .mud-table-body .mud-table-cell:last-child > * { vertical-align: middle; }

/* Bei nur einer Spalte bleibt alles links - :first-child gewinnt sonst nicht. */
.cx-table .mud-table-cell:first-child:last-child { text-align: left; }


.mud-button-root { border-radius: 999px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.mud-button-filled { box-shadow: none !important; }

.mud-input-outlined .mud-input-outlined-border { border-radius: 10px; border-color: #D6DDE3; }
.mud-theme-dark .mud-input-outlined .mud-input-outlined-border { border-color: #33424F; }

/* ---- Pillen: ein Aussehen fuer die ganze App ----
   Chips sind in Tabellen der Traeger von Status, Kategorie und Zuordnung.
   Einheitliche Hoehe und Rundung, damit Zeilen ruhig wirken. */
.mud-chip {
    font-weight: 600;
    border-radius: 999px !important;
    height: 23px;
    font-size: 11.5px;
    letter-spacing: .1px;
}
.mud-chip .mud-chip-content { padding: 0 10px; }

/* In Tabellen sitzen die Pillen mittig in ihrer Spalte */
.cx-table .mud-table-cell .mud-chip { vertical-align: middle; }

/* Umrandete Pillen etwas zurueckhaltender, gefuellte etwas weicher */
.mud-chip.mud-chip-outlined { border-width: 1px; }
.mud-chip.mud-chip-filled { box-shadow: none; }

/* Dialoge im Design-Look: zentrierter Titel + Akzent-Trenner */
.mud-dialog { border-radius: 16px !important; box-shadow: 0 24px 70px rgba(10,25,45,.35) !important; }
.mud-dialog-title { text-align: center; padding: 22px 24px 16px; position: relative; }
.mud-dialog-title h6, .mud-dialog-title .mud-typography {
    font-size: 21px !important; font-weight: 700 !important; letter-spacing: -.2px;
}
.cx-dialog-divider { height: 2px; background: var(--accent); margin: 0 24px; border-radius: 2px; }
.mud-dialog-actions { position: relative; padding: 16px 24px 20px; }
.mud-dialog-actions::before {
    content: ''; position: absolute; top: 0; left: 24px; right: 24px;
    height: 2px; background: var(--accent); border-radius: 2px;
}

/* ============================================================
   FILTERBAR
   ============================================================ */
.cx-filterbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--divider);
    border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; box-shadow: var(--shadow-1);
}
.cx-fb-search { flex: 1; min-width: 220px; }
.cx-fb-group { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.cx-fb-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); font-weight: 700; display: flex; align-items: center; gap: 4px;
}
.cx-fb-actions { display: flex; gap: 6px; align-self: flex-end; margin-left: auto; }

/* ============================================================
   LISTEN-ZEILEN statt Kachel-Zaehler
   ============================================================ */
.cx-list { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden; }
.cx-list-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 18px; border-bottom: 1px solid var(--divider);
    cursor: pointer; transition: background .12s;
}
.cx-list-row:last-child { border-bottom: 0; }
.cx-list-row:hover { background: var(--accent-bg); }
.cx-list-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.cx-list-main { flex: 1; min-width: 0; }
.cx-list-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.cx-list-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.cx-list-meta { font-size: 12.5px; color: var(--text-sec); white-space: nowrap; }

/* Info-Zeilen */
.cx-info-row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--divider); }
.cx-info-row:last-child { border-bottom: 0; }
.cx-info-label { color: var(--text-muted); font-size: 14px; width: 170px; flex-shrink: 0; }
.cx-info-value { font-weight: 700; color: var(--text); font-size: 14.5px; flex: 1; }

/* ============================================================
   MODUL-ÜBERBLICKE auf der Lagerübersicht
   ============================================================ */
.cx-mod-card {
    height: 100%; cursor: pointer;
    display: flex; flex-direction: column;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cx-mod-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-3) !important;
    border-color: var(--accent);
}
.cx-mod-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--divider); }
.cx-mod-body { display: flex; align-items: flex-start; gap: 24px; padding-top: 14px; flex: 1; }
.cx-mod-body-text { flex-direction: column; gap: 7px; }
.cx-mod-figure { display: flex; flex-direction: column; gap: 2px; }
.cx-mod-value { font-size: 23px; font-weight: 800; line-height: 1; letter-spacing: -.4px; }
.cx-mod-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.cx-mod-line { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
.cx-mod-line-time { color: var(--text-muted); white-space: nowrap; min-width: 108px; }
.cx-mod-line-text { color: var(--text); font-weight: 500; }
.cx-mod-quote { font-size: 12.5px; }
.cx-mod-quote-text { color: var(--text-sec); margin-top: 3px; line-height: 1.4; }

/* ============================================================
   AKTIVITÄTEN — nach Tagen gruppierte Zeitleiste
   ============================================================ */
.cx-act-day {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; background: var(--surface-2);
    font-size: 12px; font-weight: 700; color: var(--text-sec);
    text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid var(--divider);
}
.cx-act-day-count {
    background: var(--surface); border: 1px solid var(--divider);
    border-radius: 999px; padding: 1px 9px; font-size: 11px; letter-spacing: 0;
}
.cx-act-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px; border-bottom: 1px solid var(--divider);
}
.cx-act-row:last-child { border-bottom: 0; }
.cx-act-row:hover { background: var(--accent-bg); }
.cx-act-time { font-size: 12px; color: var(--text-muted); width: 42px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cx-act-rail { width: 10px; display: flex; justify-content: center; flex-shrink: 0; }
.cx-act-dot { width: 9px; height: 9px; border-radius: 50%; }
.cx-act-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.cx-act-icon .mud-icon-root { font-size: 18px !important; }
.cx-act-main { flex: 1; min-width: 0; }
.cx-act-text { font-size: 13.5px; color: var(--text); line-height: 1.35; }
.cx-act-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 600px) {
    .cx-act-time, .cx-act-rail { display: none; }
}

/* ============================================================
   STAMMDATEN-KARTEN (alle Gruppen identisch)
   ============================================================ */
.cx-md-card { height: 100%; display: flex; flex-direction: column; }
.cx-md-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cx-md-list { flex: 1; max-height: 260px; overflow-y: auto; margin: 0 -6px; }
.cx-md-row {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 8px; border-radius: 8px; min-height: 38px;
}
.cx-md-row:hover { background: var(--surface-2); }
.cx-md-name { flex: 1; font-size: 13.5px; cursor: text; padding: 4px 2px; }
.cx-md-empty { color: var(--text-muted); font-size: 12.5px; padding: 14px 8px; text-align: center; }
.cx-md-add { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }

/* ============================================================
   CHAT
   ============================================================ */
.cx-chat-layout {
    display: grid; grid-template-columns: 320px 1fr; gap: 16px;
    height: calc(100vh - 300px); min-height: 520px;
}
.cx-chat-sidebar, .cx-chat-thread {
    background: var(--surface); border: 1px solid var(--divider); border-radius: 12px;
    display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-1);
}
.cx-chat-sidebar-head, .cx-chat-thread-head {
    padding: 12px 16px; border-bottom: 1px solid var(--divider);
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.cx-chat-sidebar-list { flex: 1; overflow-y: auto; }
.cx-chat-channel {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-bottom: 1px solid var(--divider); cursor: pointer; transition: background .1s;
}
.cx-chat-channel:hover { background: var(--surface-2); }
.cx-chat-channel.active { background: var(--accent-bg); border-left: 3px solid var(--accent); padding-left: 11px; }
.cx-chat-channel-meta { flex: 1; min-width: 0; }
.cx-chat-channel-name { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.cx-chat-channel-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cx-chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.cx-chat-msg { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.cx-chat-msg.me { flex-direction: row-reverse; }
.cx-chat-bubble {
    background: var(--surface); padding: 9px 13px; border-radius: 12px; max-width: 62%;
    box-shadow: var(--shadow-1); border: 1px solid var(--divider);
}
.cx-chat-msg.me .cx-chat-bubble { background: var(--accent); color: #fff; border-color: var(--accent); }
.cx-chat-bubble-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.cx-chat-msg.me .cx-chat-bubble-meta { color: rgba(255,255,255,.85); }
.cx-chat-input { padding: 12px; border-top: 1px solid var(--divider); display: flex; gap: 8px; align-items: center; }
.cx-chat-reacts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.cx-chat-reacts .r {
    background: var(--surface); border: 1px solid var(--divider); border-radius: 12px;
    padding: 2px 8px; font-size: 11px; cursor: pointer;
}
@media (max-width: 900px) {
    .cx-chat-layout { grid-template-columns: 1fr; height: auto; }
    .cx-chat-sidebar { max-height: 300px; }
}

/* ============================================================
   Utilities
   ============================================================ */
.cx-muted { color: var(--text-muted); }
.cx-sec { color: var(--text-sec); }
.cx-xs { font-size: 11px; }
.cx-sm { font-size: 12px; }
.cx-strong { font-weight: 700; }
.cx-spacer { flex: 1; }
.cx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cx-footer {
    margin-top: 36px; padding: 18px; display: flex; justify-content: center;
    color: var(--text-muted); font-size: 13px; background: var(--bg);
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 4px; }

/* ============================================================
   DASHBOARD — Kachelraster im Stil der Modul-Überblicke
   ============================================================ */
.cx-dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
    align-items: stretch;
}
.cx-dash-tile { grid-column: span 4; min-width: 0; }
.cx-dash-tile.cx-dash-wide { grid-column: span 8; }

@media (max-width: 1120px) {
    .cx-dash-tile { grid-column: span 6; }
    .cx-dash-tile.cx-dash-wide { grid-column: span 12; }
}
@media (max-width: 820px) {
    .cx-dash-tile, .cx-dash-tile.cx-dash-wide { grid-column: span 12; }
}

/* Kachelinhalt: gleiche Sprache wie die Modul-Karten, nur ohne Klick-Zwang */
.cx-dash-card {
    height: 100%;
    display: flex; flex-direction: column;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cx-dash-card.cx-dash-clickable { cursor: pointer; }
.cx-dash-card.cx-dash-clickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-3) !important;
    border-color: var(--accent);
}

/* Bearbeitungsmodus: ziehen, ablegen, entfernen */
.cx-dash-edit .cx-dash-card {
    cursor: grab;
    border-style: dashed;
    border-color: var(--accent);
    transform: none !important;
}
.cx-dash-edit .cx-dash-card:active { cursor: grabbing; }
.cx-dash-tile.cx-dash-dragging { opacity: .45; }
.cx-dash-tile.cx-dash-over .cx-dash-card {
    border-style: solid;
    box-shadow: 0 0 0 2px var(--accent) !important;
}
.cx-dash-badge {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}
.cx-dash-handle { color: var(--text-muted); cursor: grab; }

/* Kachel zum Hinzufügen */
.cx-dash-add {
    height: 100%; min-height: 148px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 2px dashed var(--divider); border-radius: var(--radius-md);
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: border-color .18s, color .18s, background .18s;
}
.cx-dash-add:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.cx-dash-add-label { font-size: 13px; font-weight: 600; }

/* Auswahl der verfügbaren Widgets */
.cx-dash-pick {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px;
}
.cx-dash-pick-row {
    display: flex; align-items: center; gap: 11px;
    border: 1px solid var(--divider); border-radius: 10px;
    padding: 9px 12px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.cx-dash-pick-row:hover { border-color: var(--accent); background: var(--surface-2, var(--surface)); }
.cx-dash-pick-text { flex: 1; min-width: 0; }
.cx-dash-pick-title { font-size: 13.5px; font-weight: 600; }
.cx-dash-pick-sub { font-size: 11.5px; color: var(--text-muted); }
