/* variables.css */
/* ============================================================
   FIELDTAKT - CSS VARIABLES v4.0 (K2, tenant v1.21.0)
   ============================================================
   
   Alle Design-Tokens an EINER Stelle - und in EINEM :root-Block (K2: der S6-Block am Ende ist eingearbeitet,
   das alte Blau ist weg). Marke: Field Navy #12314D, Takt Gelb #F2A900, Off-White #F5F6F4, Ink #17212B, Plan Grau #E8EDF1,
   Schrift Inter. --ft-* sind die Markennamen wie in admin.css; --brand-* bleiben als Umbieger fuer die Altregeln.
   Steuerhoehen --ctl-h/-sm/-xs gelten fuer Knopf UND Feld (so fluchten sie), Fokus immer gelb (--focus-ring).
   Farbe aendern? Hier aendern, fertig.
   
   Datei: /assets/css/variables.css
   ============================================================ */

:root {
    /* === BRAND === */
    /* Marke (S6, seit K2 hier statt in einem zweiten Block) */
    --ft-navy: #12314D;
    --ft-navy-hover: #245C8F;
    --ft-navy-dark: #0F2A44;
    --ft-yellow: #F2A900;
    --ft-off: #F5F6F4;
    --ft-ink: #17212B;
    --ft-grey: #E8EDF1;
    --brand-primary: var(--ft-navy);
    --brand-primary-hover: var(--ft-navy-hover);
    --brand-primary-light: var(--ft-grey);
    --brand-primary-text: var(--ft-navy);   /* Textfarbe der Marke: hell Navy, dunkel Gelb - fuer color:, nie --brand-primary (das ist auf dunklem Grund unsichtbar) */
    --brand-primary-rgb: 18, 49, 77;
    /* Kachel-Icon im Markenton (v1.43.0, .stat-icon.blue): eigenes Paar, weil --brand-primary-light/-text im dunklen Modus
       Gelb werden - dann war die Navy-Kachel von der orangen nicht zu unterscheiden */
    --tile-navy-bg: var(--ft-grey);
    --tile-navy-fg: var(--ft-navy);
    --brand-accent: var(--ft-yellow);
    --brand-accent-rgb: 242, 169, 0;
    /* Bedienelemente: eine Hoehe je Groesse fuer Knopf und Feld, Rand, Rundung, gelber Fokus */
    --ctl-h: 38px;
    --ctl-h-sm: 32px;
    --ctl-h-xs: 28px;
    --ctl-border: #C9D3DC;
    --ctl-radius: 8px;
    --focus-ring: 0 0 0 3px rgba(242, 169, 0, 0.4);

    /* === SEMANTIC COLORS === */
    /* Jeweils: Basis (kraeftig) / -light (Hintergrund) / -border / -text (Text auf -light) */
    --success: #16a34a;
    --success-light: #dcfce7;
    --success-border: #bbf7d0;
    --success-text: #166534;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --info: #0891b2;
    --info-light: #e0f2fe;
    --info-border: #bae6fd;
    --info-text: #075985;
    --accent-light: #ede9fe;
    --accent-text: #5b21b6;

    /* === SPACING SCALE === */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* === TYPOGRAPHY === */
    --font-family: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
    /* v1.67.0 (Ralf: "alles sehr klein, zu mikromaessig"): Stufen je +1 bis +2 px - Grundschrift 16 px (Web-Standard fuer Arbeitsprogramme, Material Design) */
    --font-xs: 13px;
    --font-sm: 14px;
    --font-base: 16px;
    --font-md: 18px;
    --font-lg: 22px;
    --font-xl: 26px;
    --font-2xl: 32px;
    --line-height: 1.55;

    /* === BORDERS & RADIUS === */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* === SHADOWS === */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

    /* === LAYOUT === */
    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --header-height: 60px;

    /* === TRANSITIONS === */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}


/* ============================================================
   LIGHT THEME (Standard)
   ============================================================ */
[data-theme="light"],
:root {
    --bg: var(--ft-off);
    --bg-subtle: var(--ft-grey);
    --card-bg: #ffffff;
    --text: var(--ft-ink);
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #D9E0E7;
    --border-light: var(--ft-grey);
    --hover-bg: var(--ft-grey);

    /* Sidebar */
    --sidebar-bg: var(--ft-navy);
    --sidebar-text: #B7C3CF;
    --sidebar-hover: rgba(255,255,255,0.07);
    --sidebar-active-bg: rgba(242,169,0,0.14);
    --sidebar-active-text: var(--ft-yellow);
    --sidebar-border: rgba(255,255,255,0.06);
    --sidebar-category-text: #8A9AAB;

    /* Overlay */
    --overlay: rgba(18,49,77,0.5);
}


/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-subtle: #1e293b;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --hover-bg: #334155;

    /* Sidebar */
    --sidebar-bg: var(--ft-navy-dark);
    --sidebar-text: #8A9AAB;
    --sidebar-hover: rgba(255,255,255,0.04);
    --sidebar-active-bg: rgba(242,169,0,0.16);
    --sidebar-active-text: var(--ft-yellow);
    --sidebar-border: rgba(255,255,255,0.04);
    --sidebar-category-text: #475569;

    /* Overlay */
    --overlay: rgba(0,0,0,0.6);

    /* Shadows staerker im Dark Mode */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);

    /* === SEMANTIC COLORS (Dark) === */
    /* -light = get&ouml;nter dunkler Hintergrund, -text = heller Text, -border = dezent */
    --success-light: rgba(34,197,94,0.15);
    --success-border: rgba(34,197,94,0.30);
    --success-text: #4ade80;
    --warning-light: rgba(245,158,11,0.15);
    --warning-border: rgba(245,158,11,0.30);
    --warning-text: #fbbf24;
    --danger-light: rgba(239,68,68,0.15);
    --danger-border: rgba(239,68,68,0.30);
    --danger-text: #f87171;
    --info-light: rgba(14,165,233,0.15);
    --info-border: rgba(14,165,233,0.30);
    --info-text: #38bdf8;
    --accent-light: rgba(139,92,246,0.18);
    --accent-text: #c4b5fd;

    /* Brand-Tint fuer aktive Eintraege (Listen-Nav etc.) */
    --brand-primary-light: rgba(242,169,0,0.18);
    --brand-primary-text: var(--ft-yellow);

    /* Kachel-Icon im Markenton (v1.43.0): helles Blau statt Gelb, sonst gleicht es der orangen Kachel */
    --tile-navy-bg: rgba(36,92,143,0.30);
    --tile-navy-fg: #9CC3E6;
}

/* styles.css */
/* ============================================================
   fieldtakt - Stylesheet der Kunden-App
   ============================================================
   
   Alle Komponenten-Styles. Nutzt variables.css.
   
   Datei: /assets/css/styles.css
   
   INHALT:
   1. Reset & Base
   2. Layout (Sidebar + Main)
   3. Navigation
   4. Content Header & Body
   5. Stat Cards
   6. Cards
   7. Tables
   8. Badges
   9. Buttons
   10. Icons
   11. Forms
   12. Toasts
   13. Modals
   14. Activity List
   15. Empty State
   16. Helpers & Utilities
   17. Responsive
   ============================================================ */


/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: var(--line-height);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection {
    background: var(--brand-primary);
    color: #fff;
}


/* ============================================================
   2. LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: width var(--transition-normal);
    border-right: 1px solid var(--sidebar-border);
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: var(--header-height);
}

.sidebar-brand-icon {
    width: 34px; height: 34px;
    background: var(--brand-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon .icon svg { stroke: #fff; }

.sidebar-brand-text strong {
    color: #f1f5f9;
    font-size: var(--font-base);
    font-weight: 700;
    display: block;
    letter-spacing: -0.2px;
}

.sidebar-brand-text small {
    color: var(--sidebar-text);
    font-size: var(--font-xs);
    font-weight: 400;
}
.sidebar-brand-text { min-width: 0; }
/* v1.120.1: Leitspruch in eigener Zeile ueber die volle Breite - einzeilig und ganz lesbar */
.sidebar-brand { flex-wrap: wrap; row-gap: 2px; }
.sidebar-brand-tag { flex: 1 0 100%; text-align: center; color: var(--sidebar-text); font-size: 11px; font-weight: 400; letter-spacing: 0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .sidebar-brand-tag { display: none; }
/* v1.120.0: Mein Konto als Zahnrad neben dem Namen */
.admin-account { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--sidebar-text); flex: 0 0 auto; }
.admin-account:hover, .admin-account.active { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar.collapsed .admin-account { display: none; }

/* Sidebar Toggle */
.sidebar-toggle {
    position: absolute;
    right: -13px;
    top: 22px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.sidebar-toggle:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 14px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
}

.admin-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.admin-info-text .admin-name {
    color: #cbd5e1;
    font-size: var(--font-sm);
    font-weight: 500;
    display: block;
}

.admin-info-text .admin-role {
    display: inline-block;
    background: rgba(37,99,235,0.15);
    color: var(--sidebar-active-text);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-footer .nav-item.logout:hover {
    background: rgba(220,38,38,0.12);
    color: #f87171;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    margin-bottom: 4px;
}

.lang-switcher a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: var(--font-md);
    opacity: 0.5;
    transition: all var(--transition-fast);
    background: rgba(255,255,255,0.05);
}

.lang-switcher a:hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
}

.lang-switcher a.active {
    opacity: 1;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 2px var(--brand-primary);
}


/* ============================================================
   3. NAVIGATION
   ============================================================ */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

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

/* Nav Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-weight: 450;
    transition: all var(--transition-fast);
    cursor: pointer;
    margin-bottom: 1px;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item .icon { flex-shrink: 0; }

/* Nav Categories */
.nav-category { margin-bottom: 2px; }

.nav-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-category-text);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.nav-category-header:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

.nav-category-header .icon { flex-shrink: 0; opacity: 0.6; }

.nav-category-header .chevron-icon {
    margin-left: auto;
    transition: transform var(--transition-fast);
    opacity: 0.4;
}

.nav-category:not(.expanded) .chevron-icon {
    transform: rotate(180deg);
}

.nav-category-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

/* Waehrend des initialen Ladens keine Animation (verhindert Aufblitzen) */
.sidebar.nav-preload .nav-category-items {
    transition: none;
}

.nav-category.expanded .nav-category-items {
    max-height: 500px;
}

.nav-subitem {
    padding-left: 42px;
    font-size: var(--font-sm);
}


/* ============================================================
   4. CONTENT HEADER & BODY
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
}

.content-header h1 {
    font-size: var(--font-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: -0.3px;
}

.content-header h1 .icon { color: var(--brand-primary-text); }
/* v1.119.0: farbige Symbole nach Geldfluss (Einstellungen -> Darstellung; MoneyColors) - Seitenleiste dunkel: helle Toene, Kopf: kraeftige Toene */
/* Einstellungen -> Darstellung: Farbkombinationen zur Auswahl */
.ft-pal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-md); margin-top: var(--space-md); }
.ft-pal { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.ft-pal.is-selected, .ft-pal:has(input:checked) { border-color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary); }
.ft-pal input { position: absolute; opacity: 0; pointer-events: none; }
.ft-pal-name { font-weight: 600; }
.ft-pal-demo { display: flex; flex-direction: column; gap: 4px; font-size: var(--font-sm, 13px); color: var(--text-secondary); }
.ft-pal-row { display: inline-flex; align-items: center; gap: 6px; }
.ft-pal-dark { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 5px 8px; border-radius: 6px; background: #1B2A3F; }
.ft-pal-dark-lbl { color: #C9D3E0; font-size: var(--font-xs); }
.ft-money .nav-item.nav-money-in .icon { color: var(--money-in-soft); }
.ft-money .nav-item.nav-money-out .icon { color: var(--money-out-soft); }
.ft-money .content-header h1.ft-money-in > .icon { color: var(--money-in); }
.ft-money .content-header h1.ft-money-out > .icon { color: var(--money-out); }
[data-theme="dark"] .ft-money .content-header h1.ft-money-in > .icon { color: var(--money-in-soft); }
[data-theme="dark"] .ft-money .content-header h1.ft-money-out > .icon { color: var(--money-out-soft); }
/* v1.116.0 (Ralf): Titel "Nummer / Vorgangsnummer - Betreff" - die Nummer bleibt ganz, der Betreff wird je nach Platz mit ... gekuerzt */
.content-header h1 { min-width: 0; flex: 1 1 auto; }
.content-header h1 .ft-title-main { flex: 0 0 auto; white-space: nowrap; }
/* v1.118.0: Status-Pillen im Seitenkopf - 2x2-Feld vor der Belegnummer, nur was zutrifft; Farbe = Dringlichkeit */
.content-header h1 .ft-head-pills { display: grid; grid-template-columns: repeat(2, max-content); gap: 3px 6px; flex: 0 0 auto; }
.ft-hp { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 6px; border-radius: 999px; font-size: var(--font-xs); font-weight: 600; line-height: 1.6; letter-spacing: 0; white-space: nowrap; border: 1px solid transparent; }
.ft-hp-neutral { background: var(--bg-subtle); color: var(--text-secondary); border-color: var(--border); }
.ft-hp-info { background: var(--info-light); color: var(--info-text); border-color: var(--info-border); }
.ft-hp-warn { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning-border); }
.ft-hp-danger { background: var(--danger-light); color: var(--danger-text); border-color: var(--danger-border); }
.ft-hp-ok { background: var(--success-light); color: var(--success-text); border-color: var(--success-border); }
.content-header h1 .ft-title-sub { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text-secondary); }

.header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.content-body {
    padding: var(--space-lg) var(--space-xl) var(--space-2xl);
    flex: 1;
}


/* ============================================================
   5. STAT CARDS
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* v1.43.0: der zweite Behaelter .stat-cards ist entfallen - alle Kacheln kommen aus render_stat_cards()
   (includes/render-stats.php) und stehen in .stat-grid; Icon-Feld, Zahl und Beschriftung siehe .stat-icon weiter unten */

/* === LISTEN-TOOLBAR (Suche + Filter) === */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

/* Such-Box mit Icon */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 280px;
    min-width: 220px;
}
.search-box .icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}
.search-box input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    transition: all var(--transition-fast);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    outline: none;
    border-color: var(--ft-yellow);      /* K2 (v1.21.0): Fokus gelb, wie in der Schaltzentrale */
    box-shadow: var(--focus-ring);
}
/* K2 (v1.21.0): JEDES Feld im Inhaltsbereich - auch ausserhalb von .form-group (Filterleisten, Tabellen). :where() haelt die
   Spezifitaet bei 0, gezielte Regeln gewinnen weiter (CSS-Muster Abschnitt 6). */
:where(.main-content, .login-card) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]), select) {
    height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--ctl-border); border-radius: var(--ctl-radius); background: var(--card-bg); color: var(--text); font-family: inherit; font-size: var(--font-sm);
}
:where(.main-content, .login-card) :where(textarea) { border: 1px solid var(--ctl-border); border-radius: var(--ctl-radius); background: var(--card-bg); color: var(--text); font-family: inherit; font-size: var(--font-sm); padding: 9px 12px; }
:where(.main-content, .login-card) :where(input, select, textarea):focus-visible { outline: none; border-color: var(--ft-yellow); box-shadow: var(--focus-ring); }

/* Filter-Tabs (Alle / Kunde / Lieferant / ...) */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.filter-tab:hover {
    background: var(--hover-bg);
    color: var(--text);
}
.filter-tab.active {
    background: var(--brand-primary-light);
    border-color: transparent;
    color: var(--brand-primary-text);
    font-weight: 600;
}
.filter-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 700;
    line-height: 1;
    background: var(--border);
    color: var(--text-secondary);
}
.filter-tab.active .tab-count {
    background: var(--brand-primary);
    color: #fff;
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--tile-navy-bg); color: var(--tile-navy-fg); }   /* v1.43.0: eigenes Token-Paar, dunkel nicht mehr gelb */
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan   { background: var(--info-light); color: var(--info); }
.stat-icon.grey   { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }   /* v1.43.0: abgeschlossen/archiviert - Rahmen statt Flaeche, sonst im Kartengrund unsichtbar */

/* v1.43.0: kleines Icon-Feld fuer .stat-mini im Reiterkopf einer Akte (render_stat_cards(..., 'mini')) */
.stat-icon.stat-icon-sm {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
}

.stat-value {
    font-size: var(--font-2xl);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 450;
}

.stat-trend {
    font-size: var(--font-xs);
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

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


/* ============================================================
   6. CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.card:last-child { margin-bottom: 0; }

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

.card-header h2, .card-title {   /* .card-title: L5 (v1.146.0) */
    font-size: var(--font-md);
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-body { padding: var(--space-lg); }
.card-body.flush { padding: 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: var(--space-lg);
}


/* ============================================================
   7. TABLES
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-base);
    vertical-align: middle;
}
/* v1.103.0 (Ralf: "Tabelleneintraege verrueckt zur Ueberschrift"): .data-table th (0,1,1) schlug .ta-right (0,1,0) - Kopf links, Werte
   rechts. Ausrichtung gilt jetzt fuer Kopf UND Zellen jeder Tabelle gleich (CSS-Muster, Abschnitt Spezifitaet). */
.data-table th.ta-right, .data-table td.ta-right { text-align: right; }
.data-table th.ta-center, .data-table td.ta-center { text-align: center; }

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover { background: var(--hover-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

.action-cell {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}


/* ============================================================
   8. BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-success, .badge-active, .badge-confirmed { background: var(--success-light); color: var(--success-text); }
.badge-warning, .badge-trial, .badge-in_progress { background: var(--warning-light); color: var(--warning-text); }
.badge-danger, .badge-suspended, .badge-cancelled { background: var(--danger-light); color: var(--danger-text); }
.badge-info, .badge-open, .badge-planned, .badge-scheduled { background: var(--info-light); color: var(--info-text); }
.badge-neutral, .badge-completed { background: var(--bg); color: var(--text-secondary); }

/* Auftrags-Status: Farbe je semantischer Kategorie. Zuordnung Code -> Kategorie
   in includes/RequestStatus.php. Nutzt die Farb-Tokens -> Light/Dark automatisch. */
.badge-status-new         { background: var(--bg);            color: var(--text-secondary); }
.badge-status-planned     { background: var(--accent-light);  color: var(--accent-text); }
.badge-status-in_progress { background: var(--warning-light); color: var(--warning-text); }
.badge-status-done        { background: var(--success-light); color: var(--success-text); }
.badge-status-closed      { background: var(--info-light);    color: var(--info-text); }
.badge-status-cancelled   { background: var(--danger-light);  color: var(--danger-text); }

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-success .badge-dot, .badge-active .badge-dot { background: var(--success); }
.badge-warning .badge-dot, .badge-trial .badge-dot  { background: var(--warning); }
.badge-danger .badge-dot, .badge-suspended .badge-dot { background: var(--danger); }
.badge-info .badge-dot   { background: var(--info); }


/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--ctl-h);           /* K2 (v1.21.0): eine Hoehe fuer Knopf und Feld */
    padding: 0 16px;
    border-radius: var(--ctl-radius);
    font-size: var(--font-sm);
    font-weight: 550;
    font-family: inherit;
    border: 1px solid var(--ctl-border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
}

/* K2 (v1.21.0): jeder Knopf faerbt sich beim Ueberfahren - der neutrale fuellt sich mit Navy (dieselbe Familie wie .btn-primary) */
.btn:hover { background: var(--ft-navy); color: #fff; border-color: var(--ft-navy); box-shadow: 0 2px 8px rgba(var(--brand-primary-rgb), 0.25); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 2px 8px rgba(var(--brand-primary-rgb), 0.3);
}

.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; }

.btn-warn    { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning-border); }
.btn-warn:hover { background: var(--warning-border); }
/* K2 (v1.21.0): das eine Knopfsystem der Schaltzentrale - Warnung = Gelb auf Ink, Info; .btn-warn/.btn-ghost/... sind Altnamen bis K10 */
.btn-warning { background: var(--ft-yellow); color: var(--ft-ink); border-color: var(--ft-yellow); }
.btn-warning:hover { background: #D99700; border-color: #D99700; color: var(--ft-ink); }
.btn-info    { background: var(--info); color: #fff; border-color: var(--info); }
.btn-info:hover { background: var(--info-text); border-color: var(--info-text); }

.btn-ghost   { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--hover-bg); }

.btn-sm  { height: var(--ctl-h-sm); padding: 0 10px; font-size: var(--font-xs); }
.btn-xs  { height: var(--ctl-h-xs); padding: 0 8px; font-size: var(--font-xs); }
.btn-lg  { height: 44px; padding: 0 22px; font-size: var(--font-base); }
.btn-full { width: 100%; text-align: center; justify-content: center; }

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}


/* ============================================================
   10. ICON SYSTEM
   ============================================================ */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon svg {
    width: 24px; height: 24px;   /* v1.67.0: Material-Symbole wirken im selben Kasten kleiner - je Stufe +2 px */
    stroke-width: 2;
}

.icon-xs svg { width: 18px; height: 18px; }   /* v1.67.0: xs hatte keine Regel (offener Punkt BED-1) */
.icon-sm svg { width: 20px; height: 20px; }
.icon-lg svg { width: 28px; height: 28px; }
.icon-xl svg { width: 40px; height: 40px; }


/* ============================================================
   11. FORMS
   ============================================================ */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: var(--space-lg);
}

.form-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h3 {
    font-size: var(--font-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: var(--space-md);
}

.form-group label, .form-label {   /* .form-label: L5 (v1.146.0), Beschriftung ausserhalb einer .form-group */
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea,
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
.form-group select,
.form-group textarea {
    padding: 0 12px;
    border: 1px solid var(--ctl-border);
    border-radius: var(--ctl-radius);
    font-size: var(--font-base);
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
    height: var(--ctl-h);           /* K2 (v1.21.0): wie der Knopf - so fluchten Feld und Knopf in einer Zeile */
}
.form-textarea, .form-group textarea { height: auto; padding: 9px 12px; }

.form-input:focus, .form-select:focus, .form-textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.1);
}

.form-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
    cursor: pointer;
}

.checkbox-inline input { width: 16px; height: 16px; }   /* v1.38.1: als Schieber ueberschrieben, siehe unten */


/* ============================================================
   12. TOASTS
   ============================================================ */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: var(--font-sm);
    font-weight: 500;
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-success .icon { color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-error .icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .icon { color: var(--warning); }
.toast-info    { border-left: 3px solid var(--brand-primary); }
.toast-info .icon { color: var(--brand-primary-text); }

.toast.removing { animation: toastSlideOut 0.3s ease forwards; }

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

@keyframes toastSlideOut {
    to { transform: translateX(110%); opacity: 0; }
}


/* ============================================================
   12b. RUECKFRAGE (v1.14.0) - eigener Dialog statt Browser-confirm(); Frage fett, Beschreibung normal
   ============================================================ */
.ft-ask { position: fixed; inset: 0; background: var(--overlay); z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ft-ask[hidden] { display: none; }
.ft-ask-box { width: min(460px, 100%); background: var(--card-bg); color: var(--text); border-radius: var(--radius-lg); padding: 22px 24px 18px; box-shadow: var(--shadow-xl); }
.ft-ask-title { margin: 0; font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.ft-ask-desc { margin: 8px 0 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.ft-ask-desc[hidden] { display: none; }
.ft-ask-input { width: 100%; margin-top: 12px; }
.ft-ask-input[hidden] { display: none; }
.ft-ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ============================================================
   13. MODALS
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.modal-backdrop.visible { opacity: 1; visibility: visible; }

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 95%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
}

.modal-backdrop.visible .modal { transform: scale(1) translateY(0); }

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }

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

.modal-title {
    font-size: var(--font-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-size: var(--font-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}


/* ============================================================
   14. ACTIVITY LIST
   ============================================================ */
.activity-list { display: flex; flex-direction: column; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-icon-wrap {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon-wrap.green  { background: var(--success-light); color: var(--success); }
.activity-icon-wrap.blue   { background: var(--brand-primary-light); color: var(--brand-primary-text); }
.activity-icon-wrap.orange { background: var(--warning-light); color: var(--warning); }
.activity-icon-wrap.red    { background: var(--danger-light); color: var(--danger); }

.activity-text { font-size: var(--font-sm); line-height: 1.5; }
.activity-text strong { font-weight: 600; }

.activity-meta {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-xs);
    margin-top: 2px;
}


/* ============================================================
   15. ALERTS & EMPTY STATE
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: var(--font-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success { background: var(--success-light); color: var(--success-text); border: 1px solid var(--success-border); }
.alert-error   { background: var(--danger-light); color: var(--danger-text); border: 1px solid var(--danger-border); }
.alert-warning { background: var(--warning-light); color: var(--warning-text); border: 1px solid var(--warning-border); }
.alert-info    { background: var(--info-light); color: var(--info-text); border: 1px solid var(--info-border); }

.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-state .icon { color: var(--text-muted); margin: 0 auto var(--space-md); }
.empty-state h3 { margin-bottom: var(--space-sm); font-weight: 650; }
.empty-state p { color: var(--text-muted); margin-bottom: var(--space-lg); max-width: 400px; margin-inline: auto; }


/* ============================================================
   16. HELPERS
   ============================================================ */

/* Techniker-Punkt */
.tech-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Skill Tags */
.skill-tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-xs);
    margin: 1px 2px;
}

/* Code Highlight */
code.highlight {
    background: var(--warning-light);
    color: var(--warning-text);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Flex & Spacing Helpers */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-sm      { font-size: var(--font-sm); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
/* v1.100.0: Zahnrad direkt an einem Listenfeld (includes/ListRegistry.php) - wer die Liste pflegen darf, kommt von hier auf die Pflegeseite */
.ft-list-gear { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--text-muted); }
.ft-list-gear:hover, .ft-list-gear:focus-visible { color: var(--brand-primary-text); }
/* v1.109.0: Symbole der Verknuepfungen (includes/LinkIcons.php, Bedien-Muster 57) - Farbe = Seite: Adresse gruen, Ort violett, Verbindung grau */
.ft-link-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: var(--font-xs); font-weight: 600; line-height: 1.6; text-decoration: none; border: 1px solid transparent; }
.ft-link-pill:hover { text-decoration: none; filter: brightness(0.97); }
.ft-link-label { display: inline-flex; vertical-align: middle; width: 18px; height: 18px; border-radius: 5px; align-items: center; justify-content: center; }
.ft-link-addr { background: var(--success-light); color: var(--success-text); border-color: var(--success-border); }
.ft-link-site { background: var(--accent-light); color: var(--accent-text); }
.ft-link-conn { background: var(--bg-subtle); color: var(--text-secondary); border-color: var(--border); }
.ft-record-links { margin-top: 6px; }
/* v1.122.0 (Bedien-Muster 65): Summe mit Schieber Netto/Brutto - beide Zahlen gleich gross, nicht fett; Kopfzeile mittig */
.ft-sum { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); }
.ft-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; min-height: 24px; }
.ft-sum-title { font-size: var(--font-xs); color: var(--text-secondary); line-height: 1; }
.ft-sum-switch { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--font-xs); color: var(--text-secondary); line-height: 1; }
.ft-sum[data-mode="net"] .ft-sum-switch > span:first-child, .ft-sum[data-mode="gross"] .ft-sum-switch > span:last-child { color: var(--text-primary); font-weight: 600; }
/* v1.135.0: Schieber "Firma | Privat" - Symbol vor dem Wort, senkrecht mittig; die gewaehlte Seite dunkel und fett (Regel darueber) */
.ft-sum-side { display: inline-flex; align-items: center; gap: 4px; }
.ft-sum-side .icon { flex: none; }
/* v1.136.0 (Bedien-Muster 69): Versionen eines Vorgangs - Pille im Kopf mit Liste (schwebend wie die Hilfe), gelbe Leiste bei ersetzter Version */
.ft-ver-wrap { margin-left: 8px; }
.ft-ver-btn { cursor: pointer; font: inherit; font-size: var(--font-xs); font-weight: 600; }
.ft-ver-btn:hover, .ft-ver-btn[aria-expanded="true"] { filter: brightness(0.96); }
.ft-ver-pop { padding: 6px; min-width: 300px; }
.ft-ver-pop-title { display: block; padding: 4px 8px 6px; font-size: var(--font-xs); color: var(--text-secondary); }
.ft-ver-row { display: grid; grid-template-columns: max-content max-content 1fr max-content; gap: 12px; align-items: center; padding: 6px 8px; border-radius: var(--radius-sm, 6px);
  color: var(--text-primary); text-decoration: none; }
.ft-ver-row:hover { background: var(--bg-subtle); text-decoration: none; }
.ft-ver-row.is-me { background: var(--info-light); }
.ft-ver-no { font-weight: 600; }
.ft-ver-sum { text-align: right; }
.ft-ver-banner { flex-wrap: wrap; }
.ft-ver-banner-text { flex: 1 1 auto; }
.ft-ver-banner-tools { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.data-table tr.ft-ver-me > td { background: var(--info-light); }
.ft-sum-vals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ft-sum-val { display: flex; flex-direction: column; }
.ft-sum-num { font-size: var(--font-lg, 18px); font-weight: 500; }
.ft-sum[data-mode="net"] [data-show="gross"], .ft-sum[data-mode="gross"] [data-show="net"] { display: none; }
.ft-record-sep { margin-top: var(--space-md); }
/* v1.114.0: Hilfe auf Klick (includes/help.php, Bedien-Muster 58) - ?-Symbol, schwebendes Fenster, kein Hover */
.ft-help-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; }
.ft-help { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; line-height: 1; }
.ft-help:hover, .ft-help:focus-visible, .ft-help[aria-expanded="true"] { color: var(--brand-primary-text); }
.ft-help-pop { position: fixed; top: 0; left: 0; z-index: 1200; width: max-content; max-width: min(320px, 80vw); padding: 10px 12px;
  background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: var(--font-sm, 13px); font-weight: 400; line-height: 1.5; text-transform: none; letter-spacing: 0; white-space: normal; }
/* v1.113.0: Anschriften in der Vorgangskarte in Druckreihenfolge - das Anschriftfeld hervorgehoben */
.ft-print-addr { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); margin-top: 8px; }
.ft-print-addr.ft-print-window { border-color: var(--success-border); background: var(--success-light); }
.ft-print-addr-head { font-size: var(--font-xs); color: var(--text-secondary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.ft-print-addr-lines { font-size: var(--font-sm, 13px); line-height: 1.45; }
/* v1.123.0: weitere Anschriften als Sprung-Symbole in der Kopfzeile des Anschriftfelds (LinkIcons::jump) */
/* v1.126.0: Baustein "Feld sperrt Bereich" ([data-locks]) - gesperrter Bereich sichtbar ausgegraut */
fieldset.ft-lock-area { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.ft-lock-area[disabled] { opacity: 0.5; }
.form-section-sub { grid-column: 1 / -1; font-size: var(--font-xs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; padding: 0; margin: 4px 0 0; }
.ft-link-jumps { display: inline-flex; gap: 4px; margin-left: 2px; }
.ft-link-jump { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: 1px solid transparent; text-decoration: none; }
.ft-link-jump:hover { filter: brightness(0.95); text-decoration: none; }
.ft-print-addr-tools { margin-left: auto; }
.ft-print-addr-tools .btn { padding: 2px 6px; }
/* v1.104.0: kleine Flagge der Korrespondenzsprache (includes/CommLanguage.php) - Grafik, weil Windows Flaggen-Emojis nur als Buchstaben zeigt */
.ft-flag { display: inline-flex; vertical-align: middle; width: 20px; height: 14px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); margin-left: 6px; }
.ft-flag svg { width: 100%; height: 100%; display: block; }
.ft-flag-code { width: auto; height: auto; padding: 0 4px; font-size: var(--font-xs); font-weight: 700; color: var(--text-muted); box-shadow: 0 0 0 1px var(--border); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.text-link {
    color: var(--brand-primary-text);
    text-decoration: none;
    font-size: var(--font-sm);
}
.text-link:hover { text-decoration: underline; }

/* Spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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


/* ============================================================
   SIDEBAR COLLAPSED STATE
   ============================================================ */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}
/* v1.124.0 (Bedien-Muster 66): eingeklappt + Maus drueber -> klappt UEBER den Inhalt auf; der Inhalt bleibt, wo er ist */
.sidebar.peek { width: var(--sidebar-width); z-index: 1100; box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25); }
.sidebar.peek ~ .main-content { margin-left: var(--sidebar-collapsed); }

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-category-header .chevron-icon,
.sidebar.collapsed .admin-info-text,
.sidebar.collapsed .lang-switcher {
    display: none;
}

.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 18px 0; }
.sidebar.collapsed .sidebar-nav { padding: 12px 6px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-subitem { padding-left: 10px; }
.sidebar.collapsed .nav-category-header { justify-content: center; padding: 9px 10px; }
.sidebar.collapsed .sidebar-footer { padding: 12px 6px; }
.sidebar.collapsed .admin-info { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-toggle { right: -13px; }

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Tooltip bei collapsed Sidebar */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: #f1f5f9;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    white-space: nowrap;
    z-index: 300;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}


/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: var(--space-lg);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.login-logo {
    width: 56px; height: 56px;
    background: var(--brand-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.login-logo .icon svg { stroke: #fff; }

.login-header h1 {
    font-size: var(--font-xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.login-form {
    padding: 0 var(--space-lg) var(--space-lg);
}

.login-form .form-group { margin-bottom: var(--space-md); }

.login-form .btn { margin-top: var(--space-sm); }

.login-footer {
    text-align: center;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.login-footer small {
    display: block;
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-xs);
}

.login-footer .lang-switcher {
    justify-content: center;
}


/* ============================================================
   PROGRESS BAR (Limits)
   ============================================================ */
.progress-bar-wrap {
    background: var(--border);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    transition: width 0.3s ease;
}

.progress-bar-fill.danger { background: var(--danger); }
.progress-bar-fill.warning { background: var(--warning); }


/* ============================================================
   ROLE PICKER
   ============================================================ */
.role-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-sm);
}

.role-card {
    cursor: pointer;
    display: block;
}

.role-card input { display: none; }

.role-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    transition: all var(--transition-fast);
    text-align: center;
}

.role-card:hover .role-card-inner { border-color: var(--brand-primary); background: var(--hover-bg); }
.role-card.selected .role-card-inner { border-color: var(--brand-primary); background: var(--brand-primary-light); box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15); }

.role-icon { font-size: var(--font-xl); display: flex; }
.role-name { font-weight: 600; font-size: var(--font-sm); }
.role-desc { font-size: var(--font-xs); color: var(--text-muted); line-height: 1.3; }


/* ============================================================
   COLOR PICKER
   ============================================================ */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option { cursor: pointer; }
.color-option input { display: none; }

.color-swatch-pick {
    display: block;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all var(--transition-fast);
}

.color-option input:checked + .color-swatch-pick {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px currentColor;
    transform: scale(1.15);
}


/* ============================================================
   CREDENTIALS BOX (User Created)
   ============================================================ */
.credentials-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.cred-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.cred-row:last-child { border-bottom: none; }
.cred-label { font-size: var(--font-sm); color: var(--text-secondary); font-weight: 500; }
.cred-value { font-size: var(--font-sm); font-weight: 600; }


/* ============================================================
   PASSWORD GRID (User Edit)
   ============================================================ */
.pw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

.pw-option {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.pw-option h4 {
    font-size: var(--font-base);
    margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
    .pw-grid { grid-template-columns: 1fr; }
    .role-picker { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   ACCORDION (global wiederverwendbar)
   ============================================================
   Verwendung:
   <div class="accordion">
     <div class="accordion-item open">
       <button class="accordion-header">
         <span class="accordion-title">Titel</span>
         <span class="accordion-chevron"><svg ...></span>
       </button>
       <div class="accordion-body">Inhalt</div>
     </div>
   </div>
   ============================================================ */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child { border-bottom: none; }

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--text-primary);
    transition: background var(--transition-fast);
    text-align: left;
    gap: 8px;
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.accordion-badge {
    font-size: var(--font-xs);
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.accordion-chevron {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
    color: var(--text-muted);
}

.accordion-item:not(.open) .accordion-chevron {
    transform: rotate(-180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.accordion-item.open > .accordion-body {
    max-height: 2000px;
}

/* Varianten */
.accordion-flush {
    border: none;
    border-radius: 0;
}

.accordion-flush .accordion-item {
    border-bottom: 1px solid var(--border-light);
}

.accordion-flush .accordion-item:last-child { border-bottom: none; }

.accordion-flush .accordion-header {
    padding: 10px 16px;
}

/* Kompakt (weniger Padding) */
.accordion-sm .accordion-header {
    padding: 8px 12px;
    font-size: var(--font-xs);
}


/* ============================================================
   PERMISSION MATRIX
   ============================================================ */

/* Rollen-Header-Leiste (ueber den Accordions) */
.perm-roles-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-subtle);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 0;
}

.perm-roles-spacer {
    flex: 1;
    min-width: 180px;
}

.perm-role-col-head {
    width: 100px;
    min-width: 100px;
    text-align: center;
    font-size: var(--font-xs);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Matrix-Tabelle (innerhalb Accordion-Body) */
.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
    display: block;
}

.perm-matrix tbody {
    display: block;
}

.perm-matrix tbody tr {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.perm-matrix tbody tr:last-child {
    border-bottom: none;
}

.perm-matrix tbody tr:hover {
    background: var(--bg-hover);
}

.perm-action-cell {
    flex: 1;
    min-width: 180px;
    padding: 10px 16px;
}

.perm-action-desc {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-xs);
    line-height: 1.3;
    margin-top: 2px;
}

.perm-check-cell {
    width: 100px;
    min-width: 100px;
    text-align: center;
    padding: 8px 6px;
}

.perm-always {
    color: var(--brand-primary-text);
    opacity: 0.5;
}

.perm-yes { color: var(--success); }
.perm-no { color: var(--text-muted); }


/* Permission Toggle Switch */
.perm-toggle {
    display: inline-block;
    cursor: pointer;
}

.perm-toggle input { display: none; }

.perm-toggle-track {
    display: block;
    width: 36px; height: 20px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
}

.perm-toggle-track::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.perm-toggle input:checked + .perm-toggle-track {
    background: var(--success);
}

.perm-toggle input:checked + .perm-toggle-track::after {
    transform: translateX(16px);
}


/* Icon Picker (Rolle erstellen) */
.icon-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.icon-option { cursor: pointer; }
.icon-option input { display: none; }

.icon-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.icon-option input:checked + .icon-pick {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    color: var(--brand-primary-text);
}


/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TOOLBAR & FILTER
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    flex: 1;
}
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Search inline */
.search-inline { display: flex; }
.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon .icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon .form-input,
.input-icon input {
    padding-left: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    font-size: var(--font-sm);
    min-width: 220px;
    outline: none;
    transition: border-color var(--transition-fast);
}
.input-icon input:focus { border-color: var(--brand-primary); }

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
}
.pill:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}
.pill.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.pill-sm { padding: 4px 10px; font-size: var(--font-xs); }
.pill-count {
    font-size: var(--font-xs);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left { flex-direction: column; }
    .toolbar-right { justify-content: flex-end; }
    .input-icon input { min-width: 100%; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .content-header { padding: var(--space-md); }
    .content-body { padding: var(--space-md); }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* S6 (v1.5.0): Marke fieldtakt - Schrift und Farben seit K2 (v1.21.0) in variables.css */
.sidebar-brand-logo img { width: 26px; height: 26px; display: block; }     /* weisse Bildmarke im Navy-Kasten */
.login-logo-brand img { width: 40px; height: 40px; display: block; }
.nav-item.active { border-left: 3px solid var(--brand-accent); }
.nav-item.active .icon svg { stroke: var(--brand-accent); }
/* M2 (v1.6.0): Passwort vergessen */
.login-forgot { text-align: center; margin-top: 12px; font-size: 14px; }
.login-forgot a { color: var(--brand-primary-text); }
#forgot .hint { font-size: 13px; color: var(--text-muted); margin: 6px 0 10px; }
/* T1 (v1.7.0): Support-Tickets */
.tk-thread { display: flex; flex-direction: column; gap: 12px; }
.tk-msg { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); }
.tk-kunde { border-left: 4px solid var(--brand-accent); background: var(--warning-light); }
.tk-team { border-left: 4px solid var(--brand-primary); }
.tk-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.tk-body { font-size: 15px; line-height: 1.55; }
.row-highlight td { background: var(--warning-light); }
.nav-pill { margin-left: auto; background: var(--brand-accent); color: var(--brand-primary); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.sidebar.collapsed .nav-pill { position: absolute; right: 6px; top: 6px; margin: 0; }
.tk-files { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.tk-files a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); text-decoration: none; }
.ft-modal { position: fixed; inset: 0; background: rgba(18,49,77,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ft-modal[hidden] { display: none; }
.ft-modal-box { width: min(960px, 100%); height: min(88vh, 900px); background: var(--card-bg); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ft-modal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--brand-primary-text); }
.ft-modal-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-modal-head button { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
#ft-modal-frame { flex: 1; border: 0; background: var(--bg); }

/* K1 (v1.17.0): Nur Ansicht - Leiste und gesperrte Bereiche (Muster der Schaltzentrale, ro-banner / data-locked) */
.ro-banner { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); padding: 10px 14px; border: 1px solid var(--border); border-left: 4px solid var(--brand-accent); border-radius: var(--radius-md); background: var(--card-bg); color: var(--brand-primary-text); font-size: var(--font-sm); font-weight: 600; }
form.is-locked input:disabled, form.is-locked select:disabled, form.is-locked textarea:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
[data-locked] .btn:disabled, [data-locked] .btn.is-locked { opacity: .45; cursor: not-allowed; }
.ro-banner-danger { border-left-color: var(--danger); color: var(--danger-text); background: var(--danger-light); }
/* v1.23.0: Entwickler-Hinweise (devhints.js) - gepunktete Unterstreichung, damit man sieht, wo ein Tooltip liegt */
.ft-devhint { text-decoration: underline dotted rgba(242,169,0,.6); text-underline-offset: 3px; cursor: help; }

/* S1 (v1.30.0): Tabellen mit Pflege in der Zeile - Muster der Schaltzentrale (.users-table, tr.row-edit, td.cell-actions, form.form-inline) */
.users-table td.cell-actions { white-space: nowrap; }
.users-table td.cell-actions form.form-inline { display: inline; margin: 0; }
.users-table .row-muted td { opacity: .62; }
.users-table .row-muted td.cell-actions { opacity: 1; }
.users-table .row-edit td { background: var(--bg-subtle); padding: var(--space-md) var(--space-lg); }
.data-table .row-muted td { opacity: .62; }
label.check input[type="checkbox"] { width: auto; height: auto; }
/* S2 (v1.31.0): Haekchen-Reihen (Rollen) mit Luft - Ralfs Bild aus S1, die Labels klebten aneinander */
.check-list, .row-gap > label.check { display: inline-flex; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.row-gap > label.check { margin-right: 14px; }

/* v1.34.0: Popup-Erfassung (data-modal) - Quelle bleibt versteckt; Hauptkontakt als gefuellter Stern */
.ft-modal-src { display: none; }
.modal-body .form-grid { grid-template-columns: 1fr 1fr; }
.modal-body .form-hint { display: block; }
.ft-star { color: var(--brand-accent); display: inline-flex; vertical-align: middle; margin-left: 4px; }
.ft-star .icon, .ft-star svg { fill: var(--brand-accent); }
.btn .icon-star-on svg { fill: var(--brand-accent); color: var(--brand-accent); }

/* v1.35.0: Suchfeld statt Auswahlliste (ft-combo) und Listen-Suche ohne Neuladen (ft-live) */
.ft-combo-wrap { position: relative; }
.ft-combo-hidden { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; margin: 0; padding: 0; border: 0; }
.ft-combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; background: var(--bg-card, var(--surface, #fff)); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; margin-top: 2px; }
.ft-combo-item { padding: 8px 12px; cursor: pointer; font-size: var(--font-sm); }
.ft-combo-item:hover, .ft-combo-item.active { background: var(--brand-primary); color: #fff; }
.ft-combo-item.current { font-weight: 600; }
.ft-combo-item.ft-combo-keep { border-top: 1px solid var(--border); color: var(--brand-primary); }
.ft-combo-more { padding: 6px 12px; font-size: var(--font-xs); color: var(--text-muted); }
.ft-live-busy { opacity: .6; transition: opacity .15s; }

/* v1.35.0: Suchfeld-Menue (ftCombo) und Listensuche ohne Neuladen */
.ft-combo { position: relative; }
.ft-combo .ft-combo-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }
.ft-combo-list { position: absolute; z-index: 1200; left: 0; right: 0; top: 100%; margin-top: 2px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.ft-combo-item { padding: 8px 12px; cursor: pointer; font-size: var(--font-sm); }
.ft-combo-item:hover, .ft-combo-item.active { background: var(--brand-primary); color: #fff; }
.ft-combo-item.current { font-weight: 600; }
.ft-combo-item.ft-combo-new { border-top: 1px solid var(--border); color: var(--brand-primary); font-weight: 600; }
.ft-combo-more { padding: 6px 12px; font-size: var(--font-xs); color: var(--text-muted); }
.ft-live-busy { opacity: .6; transition: opacity .15s; }
tr[data-href] { cursor: pointer; }
.ft-combo-input.ft-combo-isnew { border-color: var(--brand-accent); box-shadow: inset 0 0 0 1px var(--brand-accent); }

/* v1.35.3 (Ralf): Popup waechst mit dem Inhalt - keine zwei Scrollleisten. Der Hintergrund scrollt als Ganzes, wenn das Fenster
   hoeher als der Bildschirm ist; das Suchfeld-Menue ragt frei aus dem Fenster. */
.modal-backdrop { align-items: flex-start; overflow-y: auto; padding: 5vh 0; }
.modal { max-height: none; overflow: visible; margin: auto 0; }
.modal-body { max-height: none; overflow: visible; }
.modal-header { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.modal-footer { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* v1.36.0: Formular-Abschnitte als Akkordeon (ftInitSections) - Optik der Rechte-Matrix */
.form-section.ft-acc { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-md); overflow: hidden; }
.form-section.ft-acc > .form-section-title { margin: 0; padding: 10px 14px; background: var(--bg-subtle); border-bottom: 1px solid transparent; cursor: pointer; user-select: none; font-size: var(--font-sm); color: var(--text-primary); }
.form-section.ft-acc > .form-section-title:hover { background: var(--bg-hover); }
.form-section.ft-acc > .form-section-title .accordion-chevron { margin-left: auto; }
.form-section.ft-acc:not(.open) > .form-section-title .accordion-chevron { transform: rotate(-180deg); }
.form-section.ft-acc.open > .form-section-title { border-bottom-color: var(--border); }
.form-section.ft-acc > .form-section-body { padding: var(--space-md) 14px; }
.form-section.ft-acc:not(.open) > .form-section-body { display: none; }
.ft-acc-bar { margin-bottom: var(--space-sm); justify-content: flex-end; }
.modal-body .form-section.ft-acc { margin-bottom: var(--space-sm); }

/* v1.36.1: Helfer .row-gap / .row-between fehlten in der Kunden-App (nur in der Schaltzentrale) - deshalb klebten Knoepfe und
   Haekchen aneinander. Akkordeon-Leiste rechts, Knoepfe .btn-sm wie bei den Berechtigungen. */
.row-gap { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.ft-acc-bar { justify-content: flex-end; margin-bottom: var(--space-md); }

/* v1.38.1 (Ralf): Haekchen ueberall als Schieber wie im Rechtesystem - global, ohne Markup-Aenderung: jedes Kontrollkaestchen
   in label.check oder .form-group zeichnet sich selbst als Schalter (appearance: none). Tabellen-Auswahlkaestchen (data-table)
   bleiben Haekchen. */
label.check input[type="checkbox"], .form-group > input[type="checkbox"], .form-check input[type="checkbox"], .checkbox-inline input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 36px; height: 20px; margin: 0; flex: none; cursor: pointer;
    background: var(--border); border: none; border-radius: var(--radius-full); position: relative; transition: background var(--transition-fast); vertical-align: middle;
}
label.check input[type="checkbox"]::after, .form-group > input[type="checkbox"]::after, .form-check input[type="checkbox"]::after, .checkbox-inline input[type="checkbox"]::after {
    content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 2px; left: 2px;
    transition: transform var(--transition-fast); box-shadow: var(--shadow-xs);
}
label.check input[type="checkbox"]:checked, .form-group > input[type="checkbox"]:checked, .form-check input[type="checkbox"]:checked, .checkbox-inline input[type="checkbox"]:checked { background: var(--success); }
label.check input[type="checkbox"]:checked::after, .form-group > input[type="checkbox"]:checked::after, .form-check input[type="checkbox"]:checked::after, .checkbox-inline input[type="checkbox"]:checked::after { transform: translateX(16px); }
label.check input[type="checkbox"]:focus-visible, .form-group > input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(242,169,0,.4); }
label.check input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
label.check { gap: 10px; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type="checkbox"] { width: 36px !important; height: 20px !important; }
.checkbox-inline input[type="checkbox"] { width: 36px !important; height: 20px !important; }

/* v1.39.0: Adresse mit Tipp-Suche (Geocoder::field / ftInitAddress) */
.ft-address { display: contents; }
.ft-address-search { position: relative; }
.ft-address-search .ft-combo-list { top: 100%; }
.ft-address-geo { font-size: var(--font-sm); color: var(--danger); padding: 8px 0; }
.ft-address-geo.ok { color: var(--success); font-family: var(--font-mono, monospace); }

/* v1.40.0: Assistent (ftInitWizard) - Schrittleiste und Schritte in der Optik des Admin-Portals */
.wiz-head-bar { margin-bottom: var(--space-sm); }
.wiz-steps { display: flex; margin: 4px 0 var(--space-md); }
.wiz-sb { flex: 1; text-align: center; position: relative; padding-top: 34px; font-size: var(--font-xs); color: var(--text-muted); cursor: default; }
.wiz-sb::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--border); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; z-index: 1; }
.wiz-sb::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.wiz-sb:first-child::after { display: none; }
.wiz-sb.active::before { background: var(--brand-primary); }
.wiz-sb.done::before { content: "\2713"; background: var(--success); }
.wiz-sb.done { cursor: pointer; }
.wiz-sb.active { color: var(--text-primary); font-weight: 600; }
form.wiz-on .form-section.wiz-hidden { display: none; }
form.wiz-on .form-section.ft-acc > .form-section-title { pointer-events: none; }
form.wiz-on .form-section.ft-acc > .form-section-title .accordion-chevron { display: none; }
.wiz-nav { justify-content: flex-end; margin-top: var(--space-md); }
form.wiz-on .ft-acc-bar { display: none; }
form.ft-wizard .wiz-head-bar { gap: var(--space-lg); }
.wiz-nav { justify-content: space-between; }
.ft-wizard-foot { display: none; }
/* v1.40.4: Schieberleiste des Assistenten - gleicher Abstand wie zwischen den Bloecken (der Block traegt schon margin-bottom) */
.wiz-nav { margin-top: 0; }
.wiz-nav .check { margin: 0; }
/* v1.40.5: Schieber "Assistent" auf der Vollseite - gleicher Abstand zum Kopf und zu den Reitern wie zwischen den Karten */
.ft-wizard-back-row { margin: var(--space-lg) 0; padding-left: 4px; }
/* v1.41.0: Filterpille "nicht verortet" (nur wenn > 0) */
.filter-tab.filter-tab-warn { border-color: var(--danger); color: var(--danger); }
.filter-tab.filter-tab-warn.active { background: var(--danger); color: #fff; }
/* v1.41.3: Absende-Knopf wartet auf Pflichtfelder */
.btn.btn-waiting, .btn.btn-waiting:hover { opacity: .45; cursor: not-allowed; }
/* v1.42.0: Zeilen mit Doppelklick */
tr[data-open] { user-select: none; cursor: pointer; }
tr[data-open] td { cursor: pointer; }
tr[data-open]:hover td { background: var(--hover-bg); }
/* v1.42.2: Aufklapp-Pfeil als eigenes Ziel */
.expand-caret { cursor: pointer; padding: 4px 6px; margin-left: -6px; border-radius: 4px; }
.expand-caret:hover { background: var(--border); }

/* ---- Einstellungen Unternehmen (companies/settings.php) - seit v1.44.0 ---- */
.cty-name { display: inline-flex; align-items: center; gap: var(--space-sm); }
.cty-del { border-top: 1px solid var(--border); margin-top: var(--space-md); padding-top: var(--space-md); align-items: flex-end; }
.cty-del .form-group { margin-bottom: 0; }

/* ---- Symbol-Wahl (includes/icon-field.php + ftIconPick in core.js) - seit v1.45.0 ----
   Feld: Knopf mit dem aktuellen Symbol. Ebene: ueber dem Popup (Modal 9000), unter der Rueckfrage (#ft-ask 9500). */
.ft-iconfield-btn { gap: var(--space-sm); padding-left: 4px; }
.ft-iconfield-btn .ft-iconfield-ico { width: 28px; height: 28px; }
.ft-iconpick { position: fixed; inset: 0; background: var(--overlay); z-index: 9400; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ft-iconpick-box { width: min(620px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--card-bg); color: var(--text); border-radius: var(--radius-lg); padding: 22px 24px 18px; box-shadow: var(--shadow-xl); }
.ft-iconpick-title { margin: 0 0 var(--space-md); font-weight: 700; font-size: var(--font-base); }
.ft-iconpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: var(--space-sm); overflow-y: auto; padding: 2px; }
.ft-iconpick-opt { display: flex; align-items: center; justify-content: center; height: 48px; border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--card-bg); color: var(--text-secondary); cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast); }
.ft-iconpick-opt:hover { border-color: var(--tile-navy-fg); color: var(--tile-navy-fg); }
.ft-iconpick-opt:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ft-iconpick-opt.active { border-color: var(--tile-navy-fg); background: var(--tile-navy-bg); color: var(--tile-navy-fg); }
.ft-iconpick-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: var(--space-md); }
/* v1.89.0: Suche, Hinweis ohne Treffer, Name des gewaehlten Symbols (Gruppen: includes/icon-groups.php) */
.ft-iconpick-search { height: var(--ctl-h); width: 100%; margin: 0 0 var(--space-md); padding: 0 12px; border: 1px solid var(--ctl-border); border-radius: var(--ctl-radius); background: var(--card-bg); color: var(--text); font-family: inherit; font-size: var(--font-sm); }
.ft-iconpick-search:focus-visible { outline: none; border-color: var(--ft-yellow); box-shadow: var(--focus-ring); }
.ft-iconpick-opt[hidden] { display: none; }
.ft-iconpick-none { margin: var(--space-sm) 0 0; color: var(--text-muted); font-size: var(--font-sm); }
.ft-iconpick-sel { flex: 1; min-width: 0; align-self: center; color: var(--text-secondary); font-size: var(--font-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Symbolsatz nach Bereichen (symbole.php) - seit v1.89.0 ---- */
.sym-search { max-width: 420px; margin-top: var(--space-sm); }
.sym-none { margin-top: var(--space-sm); }
.sym-group[hidden], .sym-tile[hidden] { display: none; }
/* v1.131.0: Einstellungen -> Gewerke - je Gewerk eine Karte mit Haekchen und Vorschau der Anlagentypen */
.ft-trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-sm); }
.ft-trade { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; background: var(--card-bg); }
.ft-trade.is-on, .ft-trade:has(input:checked) { border-color: var(--success-border); background: var(--success-light); }
.ft-trade-head { display: flex; align-items: center; gap: 8px; }
.ft-trade-types { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-secondary); }
.ft-trade-types small { margin-left: auto; }
.ft-trade-sites { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--space-sm); color: var(--text-secondary); font-size: var(--font-sm, 13px); }   /* v1.134.0 */
.ft-trade-area > .form-section-title .ft-pack-switch { margin-left: auto; margin-right: 8px; font-size: var(--font-xs); font-weight: 500; }   /* v1.132.0 */
.ft-iconfield-more { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: var(--font-xs); }
.sym-group > .form-section-title .badge { margin-left: 6px; } .sym-group > .form-section-title .sym-count { font-weight: 400; font-size: var(--font-xs); margin-left: 4px; }   /* v1.130.0: Akkordeon */
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--space-sm); margin-top: var(--space-md); }
.sym-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card-bg); text-align: center; min-width: 0; }
.sym-tile .icon { color: var(--text); }
.sym-label { font-size: var(--font-sm); font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.sym-name { font-size: var(--font-xs); color: var(--text-muted); background: none; padding: 0; overflow-wrap: anywhere; }

/* ---- Anlegen-Knopf links an der Ueberschrift (Seitenkopf $createAction, Kartenkopf div.ft-create) - seit v1.45.2 ----
   Ralf 28.09.2026: "Neu anlegen immer links an die Ueberschrift - uebersichtlicher, passt zum Reiter". Die Gruppe steht
   direkt hinter h1/h2; margin-right:auto schiebt alle uebrigen Knoepfe (Zurueck, Zur Planung, Speichern ...) nach rechts. */
.content-header > .ft-create, .card-header > .ft-create { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-left: var(--space-md); margin-right: auto; }

/* ---- Rechte am Ort (includes/render-rights.php, R1) - seit v1.48.0 ---- */
.ft-rights-roles { margin: var(--space-sm) 0 var(--space-md); }
.ft-rights-list { display: flex; flex-direction: column; }
.ft-rights-row { display: flex; align-items: flex-start; gap: var(--space-sm); padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ft-rights-row:last-child { border-bottom: 0; }
.ft-rights-row.is-capped { opacity: .55; cursor: not-allowed; }
.ft-rights-text { display: flex; flex-direction: column; gap: 2px; }
.ft-rights-desc { font-size: var(--font-xs); color: var(--text-muted); }
.ft-rights-foot { display: flex; justify-content: flex-end; margin-top: var(--space-md); }

/* ---- Vorschau "Ansicht als ..." (R2, includes/Preview.php + render-rights.php) - seit v1.49.0 ----
   Gelbe Leiste zwischen Seitenkopf und Inhalt, bleibt beim Scrollen oben; ausserhalb von .content-body, damit die
   Nur-Ansicht-Sperre (data-locked) den Knopf "Vorschau beenden" nicht mitsperrt. */
.ft-preview-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
    padding: 10px var(--space-xl); background: var(--warning-light); color: var(--warning-text); border-bottom: 1px solid var(--warning-border); font-size: var(--font-sm); }
.ft-preview-bar form { margin-left: auto; }

/* ---- Adressliste (companies/index.php) - seit v1.50.2 ----
   Symbole der gesetzten abweichenden Adressen hinter dem Namen (Tooltip = Rolle: Name), Land als ISO-Kuerzel vor PLZ/Ort. */
.co-roles { display: inline-flex; align-items: center; gap: 6px; margin-left: var(--space-sm); vertical-align: middle; color: var(--text-muted); }
.co-role { display: inline-flex; cursor: help; }
.co-role:hover { color: var(--tile-navy-fg); }
.co-place { white-space: nowrap; }
.co-cc { display: inline-block; min-width: 24px; font-size: var(--font-xs); font-weight: 600; color: var(--text-muted); letter-spacing: .3px; }

/* ---- Matchcode (companies/tabs/tab-stammdaten.php) - seit v1.51.0: tippt sichtbar in Grossbuchstaben (gespeichert wird ohnehin gross) */
.ft-upper { text-transform: uppercase; }
.ft-upper::placeholder { text-transform: uppercase; }

/* ---- Globaler Zurueck-Knopf (app_header.php + includes/Trail.php) - seit v1.52.0: rechts im Seitenkopf, letzter Knopf ---- */
.header-actions .ft-back { white-space: nowrap; }

/* ---- Adressliste: Typ-Symbol vorn, Nummer in einer Flucht mit dem Namen - seit v1.53.0 ---- */
/* alle Zellen an der ERSTEN Textzeile ausrichten - bricht der Name (Symbole) um, bleibt die Nummer auf Hoehe des Namens */
.data-table.co-list td { vertical-align: baseline; }
.data-table .co-typecell { width: 36px; padding-right: 0; text-align: center; white-space: nowrap; }
.co-typecell .co-type + .co-type { margin-left: 4px; }   /* A2 (v1.59.0): mehrere Rollen */
.co-type { display: inline-flex; color: var(--text-secondary); cursor: help; }
.co-type:hover { color: var(--tile-navy-fg); }
.data-table .co-nr { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* ---- Filter-Kacheln (includes/render-tiles.php, T1) - seit v1.54.0 ----
   6 je Reihe ("Alle" + hoechstens 5), jede Kachel ein Link, die aktive mit Navy-Rahmen. Popup "Kacheln anpassen": Zeilen zum
   Ziehen (data-sortable, Griff .ft-drag) mit Schieber. */
.stat-grid.ft-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .stat-grid.ft-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .stat-grid.ft-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ft-tile { color: inherit; text-decoration: none; cursor: pointer; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.ft-tile:hover { border-color: var(--ctl-border); box-shadow: var(--shadow-md); }
.ft-tile.is-active { border-color: var(--tile-navy-fg); box-shadow: inset 0 0 0 1px var(--tile-navy-fg); }   /* v1.152.0: Rahmen 1 px + Innenschatten - die Kachel wird beim Aktivieren nicht hoeher */
.ft-tile .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-tiles-bar { display: flex; justify-content: flex-end; margin-bottom: var(--space-sm); }
.ft-tile-row { display: flex; align-items: center; gap: var(--space-sm); padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card-bg); margin-bottom: 6px; }
.ft-tile-row.is-fixed { background: var(--bg-subtle); color: var(--text-secondary); }
.ft-tile-row .ft-tile-name { flex: 1; }
.ft-tile-row label.check { margin: 0; }
.ft-drag { display: inline-flex; color: var(--text-muted); cursor: grab; touch-action: none; border-radius: var(--radius-sm); }
.ft-drag:focus-visible { outline: 2px solid var(--brand-accent); }
[data-sortable].is-sorting, [data-sortable].is-sorting * { cursor: grabbing; user-select: none; }
[data-sort-item].is-dragging { border-style: dashed; border-color: var(--tile-navy-fg); opacity: .85; }

/* ---- Reihenfolge per Ziehen in Tabellen (T2, SortOrder.php) - seit v1.55.0: schmale Griff-Spalte vorn ---- */
.data-table .sort-handle-cell { width: 28px; padding-right: 0; }
.data-table tr[data-sort-item].is-dragging td { background: var(--hover-bg); }

/* ---- v1.147.0 Beleg-Positionen (Bedien-Muster 76): Vorschaubild mit Grossansicht (ft_thumb, global) und Kennzeichen (ItemFlags) ---- */
.data-table.ft-items td { vertical-align: middle; }   /* Zeilen mit Vorschaubild: alles mittig zum Bild */
.data-table .ft-col-thumb { width: 52px; padding-right: 0; }
.data-table .ft-col-flags { width: 1%; white-space: nowrap; }
.data-table .ft-col-num { width: 8.5rem; }   /* v1.148.0 (Ralf): Menge, Preis, Rabatt gleich breit - die Bezeichnung bekommt den Rest */
.data-table .ft-col-sum { width: 1%; white-space: nowrap; }
.ft-item-link { color: inherit; text-decoration: none; }
.ft-item-link:hover strong { color: var(--brand-primary-text); text-decoration: underline; }
.ft-thumb { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; overflow: hidden;
    border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--card-bg); vertical-align: middle; }
.ft-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ft-thumb.is-empty { color: var(--text-muted); background: var(--bg-subtle); }
.ft-zoom { position: fixed; z-index: 10001; pointer-events: none; padding: 6px; background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .08s; }
.ft-zoom.is-on { opacity: 1; }
.ft-zoom img { display: block; max-width: 320px; max-height: 320px; width: auto; height: auto; }
.ft-itemflags { display: inline-flex; gap: 4px; vertical-align: middle; }
.ft-itemflag { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.ft-itemflag.is-empty { border: 0; }
.ft-itemflag-info { background: var(--info-light); color: var(--info-text); border-color: var(--info-border); }
.ft-itemflag-neutral { background: var(--bg-subtle); color: var(--text-secondary); border-color: var(--border); }
.ft-itemflag-warn { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning-border); }
.ft-itemflag-ok { background: var(--success-light); color: var(--success-text); border-color: var(--success-border); }
a.ft-itemflag.is-link { cursor: pointer; text-decoration: none; transition: box-shadow var(--transition-fast); }
a.ft-itemflag.is-link:hover { box-shadow: 0 0 0 2px currentColor; }   /* v1.148.0: Kennzeichen mit Ziel sichtbar anklickbar */

/* ---- Zahlungsbedingungen / Zahlungsarten (v1.57.0) ----
   Gesperrte Werte in der Akte (kommen aus der gewaehlten Bedingung, aendern nur ueber das Zahnrad); Stern = Standard in den Listen */
.ft-locked { position: relative; }
/* gleiche Kette wie die allgemeine Feldregel (.form-group input:not(...) x5, Zeile ~813) + .ft-locked - sonst verliert sie (CSS-Muster 9) */
.form-group .ft-locked input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]) { background: var(--bg-subtle); color: var(--text-secondary); padding-right: 32px; cursor: default; }
.ft-locked .ico, .ft-locked svg { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.ft-locked-hint { display: flex; align-items: center; gap: 6px; margin-top: calc(-1 * var(--space-sm)); }
.ft-std { display: inline-flex; color: var(--brand-accent); }
.ft-std svg { fill: currentColor; }

/* ---- Rollen einer Adresse (A2, includes/AddressRoles.php) - seit v1.59.0 ----
   Je Rolle eine Zeile: Schieber + Symbol + Name | unsere Nummer | Meine Nr. bei ihm */
.role-grid { display: grid; gap: 6px; }
.role-grid-head, .role-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }   /* v1.59.2: halbe Breite (rechte Spalte) */
.role-grid-simple .role-row { grid-template-columns: 1fr; }
.role-row:not(:has(input[type="checkbox"]:checked)) input[type="text"] { opacity: .45; }   /* nicht gewaehlte Rolle: Nummern abgeblendet */
.role-row:not(:has(input[type="checkbox"]:checked)) input[type="text"]:focus { opacity: 1; }
.role-grid-head span { font-size: var(--font-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.role-row label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.role-checks { display: flex; flex-wrap: wrap; gap: 6px var(--space-lg); }
.role-checks label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
@media (max-width: 720px) { .role-grid-head { display: none; } .role-row { grid-template-columns: 1fr; } }

/* ---- Konditionen als Stufen-Zeilen (Reiter Kaufmaennisch) - seit v1.59.1: "Skonto 1: [3] % innerhalb [14] Tagen" ---- */
.pay-stages .pay-stage { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 6px; }
.pay-stages .pay-stage[hidden] { display: none; }
.pay-stage-label { min-width: 150px; font-weight: 600; color: var(--text-secondary); }
.pay-num { width: 96px; flex: none; }

/* ---- Einsatzort-Liste (E1, v1.60.0; E2 v1.61.0 Ralf: "Icon nicht verrueckt, wenn ausklappbar"): das Art-Symbol steht in JEDER Zeile an
   derselben Stelle (links, feste Breite), der Aufklapp-Pfeil kommt nur zusaetzlich dahinter und verschiebt nichts */
.data-table.co-list .co-typecell { text-align: left; width: 48px; }
.co-typecell .co-type { display: inline-block; width: 18px; text-align: center; vertical-align: middle; }
.co-typecell .expand-caret { display: inline-block; margin-left: 4px; color: var(--text-muted); cursor: pointer; vertical-align: middle; }

/* ---- Speichern-Leiste (v1.62.0, Bedien-Muster 29, core.js ftInitSaveBar): links Speichern, rechts "Alle auf-/zuklappen" ---- */
.ft-acc-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.ft-acc-bar .ft-acc-left { display: flex; align-items: center; gap: var(--space-sm); }
.ft-acc-bar .ft-acc-right { margin-left: auto; }

/* ---- v1.63.0 (Ralf: "das Dropdown geht ins Nichts - muss ueber den anderen Akkordeon-Block gehen"): der Block darf ueberstehen,
   damit Suchfeld-Menues (.ft-combo-list) und aehnliche Aufklapper ueber den folgenden Bloecken liegen statt abgeschnitten zu werden.
   Die runden Ecken traegt jetzt die Kopfzeile selbst (vorher schnitt overflow:hidden sie zurecht). ---- */
.form-section.ft-acc { overflow: visible; }
.form-section.ft-acc > .form-section-title { border-radius: calc(var(--radius-md) - 1px); }
.form-section.ft-acc.open > .form-section-title { border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0; }
.form-section.ft-acc .ft-combo-list { z-index: 1200; }

/* ---- v1.64.0 (Ralf, Bedien-Muster 30): Reiterleiste EINZEILIG - engere Abstaende; reicht der Platz nicht, scrollt der Reiter-Bereich
   (.tabs-scroll, render_tabs) waagerecht statt umzubrechen. Die Knoepfe rechts stehen fest daneben (nicht mehr absolut). Die Grundlinie
   ist ein innerer Schatten der Leiste, damit die Unterstreichung des aktiven Reiters im Scrollbereich nicht abgeschnitten wird. ---- */
.tabs-bar:has(> .tabs-scroll) { flex-wrap: nowrap; border-bottom: 0; box-shadow: inset 0 -2px 0 var(--border); padding-right: var(--space-sm); gap: var(--space-sm); }
/* die alten Platzhalter fuer absolut gesetzte Knoepfe (components/tabs.css, Gewicht 0,3,0, wird NACH styles.css geladen) gelten hier
   nicht - deshalb hoeher gewichtet (0,4,0, Klasse doppelt), ohne !important */
.tabs-bar.tabs-bar:has(> .tabs-scroll):has(> .tabs-right) { padding-right: var(--space-sm); }
.tabs-bar > .tabs-scroll { display: flex; align-items: stretch; align-self: stretch; gap: 0; flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs-bar > .tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-bar > .tabs-scroll > .tab-link { margin-bottom: 0; padding: 12px 8px; gap: 6px; white-space: nowrap; flex: none; }
/* verdeckte Reiter: die Leiste laeuft an diesem Rand weich aus (core.js setzt more-l / more-r); Mausrad scrollt waagerecht */
.tabs-scroll.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tabs-scroll.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.tabs-scroll.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.tabs-bar:has(> .tabs-scroll) > .tabs-right { position: static; flex: none; margin-left: auto; display: flex; gap: 6px; align-items: center; }
/* Hauptbereich darf schmaler werden als sein Inhalt (Flex-Standard min-width:auto gab die volle Breite der Reiter nach oben weiter -
   die Seite wurde breiter als das Fenster); so scrollt die Reiterleiste in sich */
.app-layout > .main-content, .main-content > .content-body { min-width: 0; }

/* ---- v1.64.0 (Ralf): zugeklappte Bloecke ohne leeren Streifen - der Block selbst hat keinen Innenabstand, den traegt der Inhalt ---- */
.form-section.ft-acc { padding: 0; }

/* ---- v1.65.0 (global fuer Listen nach Schema, .co-list): Werte wie Nummer, Telefon, E-Mail brechen nie um (td.nw, .co-nr); wird die
   Tabelle breiter als ihre Karte, scrollt sie IN der Karte waagerecht statt die Seite zu verbreitern ---- */
.co-list td.nw, .co-list td.co-nr, .co-list td.co-place { white-space: nowrap; }
.card-body-flush:has(> table.co-list) { overflow-x: auto; }
.ct-list td { white-space: nowrap; }   /* Kontaktliste: jede Zeile einzeilig (Name, Funktionen, Zuordnung) - Flucht wie Adressen */

/* ---- Baustein Blaettern (v1.66.0, includes/render-pagination.php, Bedien-Muster 33) ----
   links Bereich, Mitte Pfeile + hoechstens 7 Zahlen mit "...", rechts "Je Seite"; alle Knoepfe 32 px wie .btn-sm, aktuelle Seite Navy */
.ft-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; padding: var(--space-md) var(--space-md); border-top: 1px solid var(--border); }
.ft-pager-info { font-size: var(--font-sm); color: var(--text-secondary); white-space: nowrap; }
.ft-pager-nav, .ft-pager-nums { display: flex; align-items: center; gap: 4px; }
.ft-pg { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-md);
         background: var(--bg-card, #fff); color: var(--text-primary); font-size: var(--font-sm); text-decoration: none; transition: background var(--transition-fast), border-color var(--transition-fast); }
a.ft-pg:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.ft-pg-on { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; font-weight: 600; }
.ft-pg-off { opacity: .4; cursor: default; }
.ft-pg-dots { min-width: 20px; text-align: center; color: var(--text-muted); font-size: var(--font-sm); }
.ft-pager-short { display: none; font-size: var(--font-sm); color: var(--text-secondary); padding: 0 8px; white-space: nowrap; }
.ft-pager-per { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-sm); color: var(--text-secondary); margin: 0; white-space: nowrap; }
.ft-pager-per select { width: auto; min-width: 72px; height: 32px; padding: 0 8px; }
@media (max-width: 720px) {
  .ft-pager { justify-content: center; }
  .ft-pager-info, .ft-pager-per, .ft-pager-nums { display: none; }
  .ft-pager-short { display: inline; }
}

/* ---- Symbole: Material Symbols Outlined (v1.66.0, includes/icons.php, CSS-Muster) - Flaeche statt Strich; Farbe ueber color.
   Die drei alten Strich-Regeln (Seitenleisten-Logo, aktiver Menuepunkt, Login-Logo) bekommen ihre Farbe hier als color. ---- */
.icon svg.mi { fill: currentColor; stroke: none; stroke-width: 0; }
.sidebar-brand-icon .icon, .login-logo .icon { color: #fff; }
.nav-item.active .icon { color: var(--brand-accent); }
.icv-table td { vertical-align: middle; }
.icv-table .icv-old, .icv-table .icv-new { width: 70px; }
.icv-table .icv-sizes .icon { margin-right: 10px; }

/* ---- Persoenliche Anzeigegroesse (v1.67.0, Mein Konto -> Darstellung, wie im Altsystem): skaliert Schrift, Symbole und Abstaende gleich-
   maessig wie der Browser-Zoom; Wert je Benutzer in user_settings (ui_scale 90/100/110/125/140), vom Seitenkopf als --ui-scale gesetzt ---- */
html { zoom: var(--ui-scale, 1); }
.ui-scale-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-scale-pick button { min-width: 64px; }
.ui-scale-pick button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.ui-scale-pick button[data-scale="90"] { font-size: 13px; } .ui-scale-pick button[data-scale="110"] { font-size: 16px; }
.ui-scale-pick button[data-scale="125"] { font-size: 18px; } .ui-scale-pick button[data-scale="140"] { font-size: 20px; }

/* ---- Akten-Kopf (v1.68.0, Ralf 28.09.2026, Bedien-Muster 35): Name steht oben im Seitenkopf neben dem Symbol; die Kopfkarte darunter ist
   EINE schmale Zeile - Pillen vorn (Aktiv, Art, Funktion, Herkunft), dann die Angaben (Nr., Ort, Zuordnung, Telefon ...). Gilt fuer
   Adresse, Einsatzort, Kontakt und jede kommende Akte (.company-header-card.record-head). ---- */
.company-header-card.record-head { padding: 10px var(--space-md); min-height: 0; }
.record-head .company-header-info { display: block; min-width: 0; }
.record-head .company-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-width: 0; }
.record-head-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record-head-pills:empty { display: none; }
.record-head .company-header-details { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; }
.record-head .company-header-actions:empty { display: none; }
.company-header-card.record-head:not(:has(.badge, .meta-item, .ft-star)) { display: none; }   /* neue Akte: noch nichts zu zeigen */
.content-header h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* lange Namen im Seitenkopf */
/* v1.68.0: Blaettern im Browser (Akten-Reiter) - dieselben Knoepfe als <button>; verdeckte Eintraege */
button.ft-pg { cursor: pointer; font: inherit; font-size: var(--font-sm); }
button.ft-pg:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.tab-content .ft-pg-hide { display: none; }   /* Gewicht 0,2,0 reicht - kein !important (CSS-Muster 9) */
.ft-pager-client { border-top: 1px solid var(--border); }

/* ---- v1.70.0: Filter-Kacheln in kleiner Fassung (Akten-Reiter, ft_filter_tiles(..., 'mini')) - klickbar, aktive Kachel mit Rahmen ---- */
a.stat-mini.ft-tile { text-decoration: none; color: inherit; cursor: pointer; transition: border-color var(--transition-fast); }
a.stat-mini.ft-tile:hover { border-color: var(--brand-primary); }
a.stat-mini.ft-tile.is-active { border-color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); }   /* v1.152.0: Hoehe bleibt gleich */
.rt-head { margin-bottom: var(--space-md); }
/* v1.71.0 (Ralf: "im Verhaeltnis zu den grossen mehr platzieren"): kleine Kacheln gleich breit (~2/3 der grossen, halbe Hoehe), die Reihe
   fuellt die Breite - Alle + 6 in einer Reihe bei 1500 px (Alle + 7 schnitt die Namen ab); sehr lange Namen mit "..." (Tooltip); Knopf nur als Symbol */
.ft-tiles-row { display: flex; align-items: flex-start; gap: 8px; }
.ft-tiles-row > .stat-mini-grid.ft-tiles { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 8px; margin: 0; }
.ft-tiles-row a.stat-mini.ft-tile { padding: 8px; gap: 6px; }
.ft-tiles-row a.stat-mini.ft-tile .stat-icon-sm { width: 28px; height: 28px; flex: none; }
.ft-tiles-row a.stat-mini.ft-tile { min-width: 0; }
.ft-tiles-row a.stat-mini.ft-tile > div:last-child { min-width: 0; }
.ft-tiles-row .stat-mini-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-tiles-row .ft-tiles-btn { flex: none; width: 32px; padding: 0; justify-content: center; }
/* v1.72.0: gesperrter Akkordeon-Block (kein Bearbeiten-Recht) */
.form-section[data-ro] .ft-ro-pill { margin-left: 8px; font-weight: 500; }

/* ---- v1.73.0 / v1.74.0: Rechte-Tafel der Anker als Akkordeon mit Schiebern (Ralf: "Optik wie in den Bloecken") ----
   Feste Spalten: sehen | aendern | ergaenzen (Aktionen: ausfuehren in Spalte 1), Kopf einmal oben; rechts Platz fuer den Akkordeon-Pfeil */
.ft-anchor-panel { display: flex; flex-direction: column; gap: 8px; --anc-col: 104px; --anc-arrow: 36px; }
.ft-anc-head, .ft-anc-root, .ft-anc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: calc(12px + var(--anc-arrow)); }
.ft-anc-head { padding-left: 12px; font-size: var(--font-xs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.ft-anc-root { padding-left: 12px; padding-top: 8px; padding-bottom: 8px; background: var(--bg-subtle); border-radius: var(--radius-md); }
.ft-anc-root.ft-anc-leaf { background: none; border: 1px solid var(--border); font-weight: 600; }   /* Einzelpunkt ohne Unterpunkte (v1.77.0) */
.ft-anc-sec .form-section-title { gap: 12px; }
.ft-anc-sec .form-section-title .ft-anc-label { flex: 1 1 auto; }
.ft-anc-rows { display: flex; flex-direction: column; }
.ft-anc-row { padding-top: 6px; padding-bottom: 6px; padding-left: calc(12px + var(--d, 0) * 20px); border-top: 1px solid var(--border); }
.ft-anc-rows .ft-anc-row { padding-right: calc(var(--anc-arrow) - 3px); }   /* Innenabstand des aufgeklappten Blocks ausgleichen - Spalten buendig mit Titel und Kopf */
.ft-anc-row.k-block { font-weight: 600; background: var(--bg-subtle); }
.ft-anc-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ft-anc-cells { display: grid; grid-template-columns: repeat(3, var(--anc-col)); gap: 8px; flex: none; align-items: center; }
.ft-anc-head .ft-anc-cells span { text-align: center; }
.ft-anc-cell { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 400; grid-column: 1; }
.ft-anc-cell[data-anchor-type="edit"] { grid-column: 2; }
.ft-anc-cell[data-anchor-type="add"] { grid-column: 3; }
.ft-anc-colhead { grid-column: 1; text-align: center; font-size: var(--font-xs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.ft-anc-cell .ft-anc-sw { margin: 0; }
.ft-anc-cell.is-inh .ft-anc-sw { opacity: .55; }
.ft-anc-inh { font-size: 12px; color: var(--text-muted); min-width: 28px; }   /* "Vorgabe" (v1.75.0, vorher "erbt") */
.ft-anc-reset { border: 0; background: none; padding: 0; width: 28px; color: var(--brand-primary); cursor: pointer; display: inline-flex; justify-content: center; }
.ft-anc-reset:hover { color: var(--brand-accent); }
.ft-anc-cell [hidden] { display: none; }   /* erbt ODER Zuruecksetzen - nie beides (hidden gegen display:inline-flex) */


/* ---- Ladeanzeige (assets/js/busy.js) - seit v1.84.0, Ralf 29.09.2026: "damit der User weiss, es passiert was" ----
   Balken oben (Takt-Gelb), Kreisel im Knopf und im Suchfeld, Hinweis ueber dem Inhalt ab 400 ms. Gleiche Regeln wie admin.css. */
.ft-busy-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand-accent); z-index: 10000; opacity: 0; pointer-events: none; }
.ft-busy-bar.is-on { opacity: 1; animation: ft-busy-grow 8s cubic-bezier(.1, .7, .3, 1) forwards; }
.ft-busy-bar.is-done { opacity: 0; width: 100%; transition: width .2s, opacity .3s .2s; }
@keyframes ft-busy-grow { 0% { width: 0; } 100% { width: 92%; } }
@keyframes ft-busy-spin { to { transform: rotate(360deg); } }
.ft-busy-ov { position: fixed; inset: 0; z-index: 9990; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--brand-primary); font-size: var(--font-md); text-align: center; padding: 24px; }
.ft-busy-ov.is-on { display: flex; }
.ft-busy-spin { will-change: transform; width: 36px; height: 36px; border: 3px solid var(--brand-accent); border-right-color: transparent; border-radius: 50%; animation: ft-busy-spin .8s linear infinite; }
.ft-busy-title { font-weight: 600; }
.ft-busy-hint { font-size: var(--font-sm); color: var(--text-muted); }
.btn.is-busy { cursor: progress; }
.btn.is-busy > svg, .btn.is-busy > .icon { display: none; }
.ft-busy-sp { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ft-busy-spin .7s linear infinite; flex: none; }
.search-box.is-busy { position: relative; }
.search-box.is-busy::after { content: ""; position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--brand-accent); border-right-color: transparent; border-radius: 50%; animation: ft-busy-spin .7s linear infinite; }
/* "weniger Bewegung" (Windows: Animationseffekte aus): Balken steht, Kreisel dreht LANGSAMER statt gar nicht - ein stehender
   Kreis sagt nichts (v1.84.1/v1.123.1, Ralf: "der Kreis dreht sich nicht"). Drehung ueber transform = laeuft auch waehrend des Ladens. */
@media (prefers-reduced-motion: reduce) {
    .ft-busy-bar.is-on { animation: none; width: 100%; opacity: .8; }
    .ft-busy-spin, .ft-busy-sp, .search-box.is-busy::after { animation-duration: 1.6s; }
}

/* ---- Akten-Layout (includes/render-record.php) - seit v1.85.0, Ralf 29.09.2026: "Stammdaten immer links, rechts die Reiter" ----
   Bezugsbreite 1536 px (Bedien-Muster 40). Links 380 px, bleibt stehen; rechts die Reiter - brechen in eine zweite Reihe um.
   Unter 1200 px: Karte oben als eine Zeile, "Stammdaten" klappt sie auf. */
.ft-record { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.ft-record-side { position: sticky; top: calc(var(--header-height) + var(--space-md)); max-height: calc(100vh - var(--header-height) - 2 * var(--space-md));
    overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ft-record-main { min-width: 0; }
.ft-record-main > .tab-container { margin-top: 0; }
.ft-record-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); min-height: 52px; }
.ft-record-title { font-weight: 600; color: var(--brand-primary); flex: 1 1 auto; }
.ft-record-btns { display: flex; gap: 6px; align-items: center; }
.ft-record-toggle, .ft-record-line { display: none; }
.ft-record-body { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }
.ft-record-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md); }
.ft-record-wide { grid-column: 1 / -1; }
.ft-record-label { font-size: 13px; color: var(--text-secondary); }
.ft-record-value { font-weight: 500; overflow-wrap: anywhere; }
.ft-record-sec { border-top: 1px solid var(--border); padding-top: var(--space-sm); display: flex; flex-direction: column; gap: 6px; }
.ft-record-sec-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.ft-record-sec a { overflow-wrap: anywhere; }
.ft-record-geo { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ft-record-geo .srv-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ft-record-geo.ok { color: var(--success); } .ft-record-geo.ok .srv-dot { background: var(--success); }
.ft-record-geo.no { color: var(--danger); } .ft-record-geo.no .srv-dot { background: var(--danger); }
.ft-record-note { padding: var(--space-sm); border-radius: var(--radius-md); background: var(--warning-light); color: var(--warning-text); }
.ft-record-meta { font-size: 13px; color: var(--text-secondary); }
/* Formular in der linken Karte: eine Spalte, Abschnitte ohne Rahmen */
.ft-record-form { padding: var(--space-sm) var(--space-md) var(--space-md); }
.ft-record-form .form-grid { grid-template-columns: minmax(0, 1fr); }
.ft-record-form .form-col-span-2 { grid-column: auto; }
.ft-record-form .form-section { margin-bottom: var(--space-sm); }
/* Reiter rechts: umbrechen statt waagerecht scrollen (Ralf: "dann eine zweite Reihe darunter") */
.ft-record .tabs-bar > .tabs-scroll { flex-wrap: wrap; overflow: visible; }
.ft-record .tabs-scroll.more-l, .ft-record .tabs-scroll.more-r { -webkit-mask-image: none; mask-image: none; }
@media (max-width: 1199px) {
    .ft-record { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
    .ft-record-side { position: static; max-height: none; }
    .ft-record-toggle { display: inline-flex; }
    .ft-record-line { display: block; padding: 0 var(--space-md) var(--space-sm); color: var(--text-secondary); }
    .ft-record-side:not(.is-open) .ft-record-body, .ft-record-side:not(.is-open) .ft-record-btns { display: none; }
    .ft-record-side.is-open .ft-record-line { display: none; }
}
/* v1.85.1 (Ralf): Bearbeiten breiter (520 px), rechts abgeblendet; Matchcode klein, Firmenname darunter; "verortet" rechts im Titel;
   Aktiv als Schieber in der Karte; Firmenname im Formular als Textbox */
.ft-record.is-editing { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }   /* v1.123.0 (Ralf): beim Bearbeiten die halbe Breite (vorher 600 px) */
/* v1.117.0: linke Karte einklappbar - eingeklappt bleibt ein schmaler Streifen mit Aufklapp-Knopf (nie beim Bearbeiten) */
.ft-record-expand { display: none; }
/* v1.120.0 (Bedien-Muster 63): im Bearbeiten-Modus klebt der Kartenkopf (Speichern + Abbrechen) oben; der Speichern-Knopf im Formular entfaellt */
.ft-record.is-editing .ft-record-head { position: sticky; top: 0; z-index: 6; background: var(--card-bg); }
.ft-record-form .ft-save-moved { display: none !important; }
@media (min-width: 1025px) {
  .ft-record.is-collapsed:not(.is-editing) { grid-template-columns: 40px minmax(0, 1fr); }
  .ft-record.is-collapsed:not(.is-editing):not(.is-peek) .ft-record-side > :not(.ft-record-expand) { display: none; }
  .ft-record.is-collapsed:not(.is-editing):not(.is-peek) .ft-record-side { padding: 0; overflow: visible; }
  /* v1.128.0 (Bedien-Muster 66, Baustein FtPeek): eingeklappt + Maus drueber -> Karte klappt UEBER den Inhalt auf, der Inhalt bleibt stehen */
  .ft-record.is-collapsed.is-peek:not(.is-editing) .ft-record-side { width: 380px; z-index: 60; box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18); }
  .ft-record.is-collapsed.is-peek:not(.is-editing) .ft-record-expand { display: none; }
  .ft-record.is-collapsed:not(.is-editing):not(.is-peek) .ft-record-expand { display: flex; align-items: flex-start; justify-content: center; width: 100%; height: 40px; padding: 10px 0; border: 0; background: none; color: var(--text-secondary); cursor: pointer; }
  /* v1.128.0: eingeklappter Streifen ueber die volle Hoehe - Maus auf den Streifen klappt auf; nur der Knopf > oben loest nichts aus (dauerhaft aufklappen) */
  .ft-record.is-collapsed:not(.is-editing):not(.is-peek) .ft-record-side { height: calc(100vh - var(--header-height) - 2 * var(--space-md)); cursor: pointer; }   /* v1.129.0: Hand wie im Menue */
  .ft-record.is-collapsed.is-peek:not(.is-editing) .ft-record-side { cursor: auto; }
  .ft-record.is-collapsed:not(.is-editing) .ft-record-expand:hover { color: var(--brand-primary-text); }
}
@media (max-width: 1024px) { .ft-record-collapse { display: none; } }   /* v1.85.3: 600 statt 520 px (Ralf: "noch ein wenig breiter") */
.ft-record.is-editing > .ft-record-main { opacity: .55; }
.ft-record.is-editing > .ft-record-main:hover, .ft-record.is-editing > .ft-record-main:focus-within { opacity: 1; }
.ft-record.is-editing .ft-record-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ft-record.is-editing .ft-record-form .form-col-span-2 { grid-column: 1 / -1; }
.ft-record-form .form-group:has(> .ft-name-box) { grid-column: 1 / -1; }
.ft-name-box { min-height: 60px; resize: vertical; }
.ft-record-sec-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.ft-record-sec-title .ft-record-geo { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ft-record-small .ft-record-value { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.ft-record-name .ft-record-value { font-size: var(--font-md); font-weight: 600; line-height: 1.35; }
.ft-record-active { display: inline-flex; align-items: center; margin-right: 4px; }
.ft-record-active .check { margin: 0; font-weight: 600; }
@media (max-width: 1199px) { .ft-record.is-editing { grid-template-columns: minmax(0, 1fr); } }
/* v1.85.3: Kommunikation je Zeile - Symbol senkrecht mittig zum Text (vorher leicht versetzt) */
.ft-record-link { display: flex; align-items: center; gap: 8px; min-width: 0; line-height: 1.4; }
.ft-record-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-record-ico, .ft-record-link .ft-star { color: var(--text-secondary); display: inline-flex; align-items: center; flex: none; margin: 0; }
.ft-record-link .ft-star { color: var(--brand-accent); }
.ft-record-ico .icon, .ft-record-link .ft-star .icon { display: inline-flex; }
/* v1.85.3 (Ralf, Bedien-Muster 41): Pille mit hinterlegtem Symbol - Symbol vor dem Text, senkrecht mittig (ft_badge) */
.badge.badge-ico { display: inline-flex; align-items: center; gap: 4px; }
.badge.badge-ico > .icon { display: inline-flex; flex: none; }
/* v1.86.0 (Ralf, Bedien-Muster 42): Reiter "Nur Symbole" - Schieber rechts in jeder Reiterleiste, gemerkt je Benutzer. Der Name bleibt
   fuer Screenreader im Text und erscheint beim Ueberfahren als Tooltip (title). */
.tabs-bar .tabs-right .tabs-mode { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 0 0; font-size: 13px; white-space: nowrap; color: var(--text-secondary); cursor: pointer; }
.tabs-bar.tabs-icons .tab-link .tab-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tabs-bar.tabs-bar.tabs-icons > .tabs-scroll > .tab-link { padding-left: 12px; padding-right: 12px; }
/* v1.86.1 (Ralf): Gefahrenzone als roter Muelleimer rechts in der Reiterleiste; schneller Tooltip (data-tip, core.js) nur ohne sichtbaren Namen */
.ft-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tabs-bar .tabs-right .tab-danger-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0 4px 0 0;
    border: 1px solid transparent; border-radius: var(--radius-md); color: var(--danger); }
.tabs-bar .tabs-right .tab-danger-ico:hover { background: var(--danger-light); border-color: var(--danger-border); color: var(--danger); }
.tabs-bar .tabs-right .tab-danger-ico.active { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.ft-tip { position: fixed; z-index: 10001; pointer-events: none; background: var(--brand-primary); color: #fff; font-size: 13px; line-height: 1.3; padding: 5px 9px;
    border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-md); opacity: 0; transition: opacity .08s; }
.ft-tip.is-on { opacity: 1; }
/* v1.86.2 (Ralf): Aktivitaeten als Symbol (Verlauf/Logs) rechts vor dem Muelleimer */
.tabs-bar .tabs-right .tab-side-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0 4px 0 0;
    border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--brand-primary); background: var(--card-bg); }
.tabs-bar .tabs-right .tab-side-ico:hover { border-color: var(--brand-primary); }
.tabs-bar .tabs-right .tab-side-ico.active { border-color: var(--brand-accent); box-shadow: inset 0 -3px 0 var(--brand-accent); }
/* ---- Bilder & Dokumente (includes/render-documents.php) - seit v1.88.0 (D1): Hochladen mit Ziehen, Bildleiste, Hauptbild ---- */
.doc-drop { margin: var(--space-md); padding: var(--space-md); border: 2px dashed var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle);
    display: flex; flex-direction: column; gap: var(--space-sm); transition: border-color var(--transition-fast), background var(--transition-fast); }
.doc-drop.is-over { border-color: var(--brand-accent); background: var(--warning-light); }
.doc-drop-hint { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-weight: 500; }
.doc-drop-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.doc-drop-row input[type="file"] { flex: 1 1 260px; min-width: 0; }
.doc-drop-type { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.doc-drop-type select { min-width: 200px; }
.doc-images { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-md); }
.doc-thumb { position: relative; width: 120px; height: 120px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: var(--card-bg); color: var(--text-secondary); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb:hover { border-color: var(--brand-primary); }
.doc-thumb.is-main { border: 2px solid var(--brand-accent); }
.doc-main-star { position: absolute; top: 4px; right: 4px; display: inline-flex; color: var(--brand-accent); background: rgba(255, 255, 255, .9); border-radius: 50%; padding: 2px; }
.doc-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.doc-name > span:not(.icon):not(.ft-star) { overflow: hidden; text-overflow: ellipsis; }
.doc-pop-img img { max-width: 100%; max-height: 320px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.ft-record-img { display: block; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: var(--bg-subtle); }
.ft-record-img img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
/* ---- Akten-Layout rechts: Bloecke als Karten in zwei Spalten statt Akkordeon untereinander (v1.90.0, Konzept Akten-Layout) ----
   Gilt fuer jedes Formular mit Abschnitten im rechten Bereich einer Akte; breite Bloecke (.ft-wide) ueber beide Spalten. Unter 1400 px eine Spalte. */
.ft-record-main form:has(> .form-section) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); align-items: start; }
.ft-record-main form:has(> .form-section) > :not(.form-section):not([type="hidden"]) { grid-column: 1 / -1; }
.ft-record-main form:has(> .form-section) > .form-section { margin: 0; }
.ft-record-main form:has(> .form-section) > .form-section.ft-wide { grid-column: 1 / -1; }
.ft-record-main .form-section.ft-acc > .form-section-title { cursor: default; }
.ft-record-main .form-section.ft-acc > .form-section-title .accordion-chevron { display: none; }
@media (max-width: 1399px) { .ft-record-main form:has(> .form-section) { grid-template-columns: minmax(0, 1fr); } }
.form-grid.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1199px) { .form-grid.form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ta-right, input.ta-right { text-align: right; }
/* A3a (v1.90.0): Kalkulation im Reiter Preise */
.calc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-sm); }
.calc-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); }
.calc-val { font-size: var(--font-lg); font-weight: 700; color: var(--brand-primary); white-space: nowrap; }
.calc-lbl { font-size: 13px; color: var(--text-secondary); }
.calc-box.is-neg .calc-val { color: var(--danger); }
.ft-record-price { display: flex; justify-content: space-between; gap: var(--space-sm); }
.ft-record-price.is-muted { color: var(--text-secondary); font-size: 13px; }
@media (max-width: 1199px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A3b (v1.92.0): Staffelpreise Verkauf und Einkauf nebeneinander unter dem Formular des Reiters Preise */
.ft-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-md); align-items: start; }
.ft-tiers > .card { margin: 0; }
@media (max-width: 1399px) { .ft-tiers { grid-template-columns: minmax(0, 1fr); } }
/* v1.93.0 (Ralf: "schlanker"): Schieber neben "Speichern" - [data-savebar] in der Speichern-Leiste, eine Reihe mit dem Knopf */
.ft-acc-bar .ft-acc-left { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); }
.ft-acc-bar .ft-acc-left > .form-group[data-savebar] { margin: 0; }
.ft-acc-bar .ft-acc-left > .form-group[data-savebar] .check { margin: 0; white-space: nowrap; }
.ft-acc-bar .ft-acc-left > .form-group[data-savebar] .form-hint { display: none; }
/* v1.93.0: Reiter Klassifikation - Ebenen nebeneinander, Artikelbild gross, weitere Bilder mit Stern */
.form-grid.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1399px) { .form-grid.form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.art-image { display: flex; align-items: center; justify-content: center; max-width: 520px; min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); overflow: hidden; }
.art-image img { display: block; max-width: 100%; max-height: 380px; object-fit: contain; }
.art-image-empty { flex-direction: column; gap: var(--space-sm); color: var(--text-secondary); }
.doc-thumb-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
label.btn > input.ft-sr { position: absolute; }
/* v1.93.1 / v1.93.2 (Ralf: "warum Optik geaendert?"): die Zeile "uebergeordnet" sieht aus wie jede andere Zeile; "gesperrt" nur als
   kleiner Text an Stelle von "Vorgabe" - sonst keine eigene Optik */
.ft-anc-cell .ft-anc-blk { font-size: 12px; color: var(--warning-text); white-space: nowrap; }
.ft-tiers { margin-top: 0; }
/* v1.94.0: Sprach-Umschalter im Reiter Texte des Artikels (ueber die ganze Breite des Formulars) */
.ft-record-main form > .art-langs { margin-bottom: 0; }
/* G1b (v1.138.0, Bedien-Muster 71): Einstellungen -> Nummernkreise - Gruppenzeile, Kreis mit Symbol, Platzhalter-Knoepfe, Vorschau im Popup */
.data-table tr.ns-group > td { background: var(--bg-subtle); padding-top: 10px; padding-bottom: 6px; font-size: var(--font-sm); }
.ns-money-in { color: var(--money-in, var(--success-text)); }
.ns-money-out { color: var(--money-out, var(--danger-text)); }
.ns-name { display: inline-flex; align-items: center; gap: 8px; }
.ns-chips { display: inline-flex; gap: 6px; margin-top: 6px; }
.ns-preview { margin: var(--space-sm) 0 var(--space-md); padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-subtle); display: flex; gap: 10px; align-items: center; }
.ns-preview code { font-size: var(--font-md); font-weight: 600; color: var(--brand-primary-text); }
/* G2 (v1.139.0, Bedien-Muster 72): Knopfleiste des Belegs (Weiterfuehren), Sperr-Hinweis, Belegkette, Fortschritt je Position */
.ft-doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.ft-act { gap: 2px; padding: 0 10px; min-width: var(--ctl-h); justify-content: center; }   /* v1.149.0 Bedien-Muster 78: Aktionsknopf nur mit Symbolen */
.ft-doc-locked { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-md); background: var(--info-light); color: var(--info-text); border: 1px solid var(--info-border); font-size: var(--font-sm); }
.ft-chain { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr); gap: 12px; align-items: start; }
.ft-chain-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ft-chain-title { font-size: var(--font-xs); color: var(--text-secondary); }
.ft-chain-arrow { display: flex; justify-content: center; padding-top: 34px; color: var(--text-muted); }
.ft-chain-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-primary); text-decoration: none; background: var(--card-bg); }
.ft-chain-card:hover { border-color: var(--brand-primary); text-decoration: none; }
.ft-chain-card.is-me { border: 2px solid var(--brand-primary); background: var(--info-light); }
.ft-chain-card .ft-hp { align-self: flex-start; }
.ft-chain-kind { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-xs); color: var(--text-secondary); }
.ft-chain-meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--font-sm); color: var(--text-secondary); }
.ft-bar { display: inline-block; width: 120px; height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.ft-bar > span { display: block; height: 100%; background: var(--success); }
@media (max-width: 900px) { .ft-chain { grid-template-columns: minmax(0, 1fr); } .ft-chain-arrow { transform: rotate(90deg); padding-top: 0; } }
/* G3b (v1.141.0): Popup "Positionen uebernehmen" - Tabelle scrollt in sich, schmales Mengenfeld */
.table-scroll { overflow-x: auto; max-height: 60vh; overflow-y: auto; margin-bottom: var(--space-md); }
.ft-input-qty { width: 90px; }

/* ==================================================================
   L5 (v1.146.0): aus Style-Inseln in Seiten uebernommen - EIN Stylesheet. Was in der Seite eine allgemeine Klasse ueberschrieb
   (.search-box, .form-hint, .form-actions), gilt hier nur noch im Bereich der Seite, damit sich sonst nichts aendert.
   ================================================================== */

/* Einstellungen > Uebersetzungen */
.trans-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.trans-filter-form {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    flex-wrap: wrap;
}
.trans-stats { margin-left: auto; display: flex; gap: .5rem; }
.trans-table-wrap { overflow-x: auto; }
.trans-table { font-size: .875rem; }
.trans-table td { vertical-align: middle; }
.key-code { font-size: .78rem; background: var(--card-bg); padding: .15rem .4rem; border-radius: 4px; }
.row-custom { background: rgba(255, 193, 7, .04); }
.trans-default { max-width: 260px; word-break: break-word; }
.trans-edit-cell { position: relative; }
.trans-display { cursor: pointer; display: block; padding: .2rem .4rem; border-radius: 4px; min-height: 1.5rem; }
.trans-display:hover { background: var(--hover-bg); }
.trans-edit-hint { font-size: .7rem; color: var(--text-muted); display: none; }
.trans-display:hover + .trans-edit-hint { display: block; }
.badge-xs { font-size: .65rem; padding: .1rem .35rem; margin-left: .3rem; }
.trans-toolbar .search-box { flex: 1; min-width: 150px; max-width: 260px; }
.btn-group { display: flex; gap: 2px; }

/* Einstellungen > Listen */
.lists-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    min-height: 400px;
}
.lists-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.lists-sidebar-header {
    padding: .75rem 1rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.list-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s;
    border-bottom: 1px solid var(--border-light);
}
.list-nav-item:hover  { background: var(--hover-bg); }
.list-nav-item.active { background: var(--brand-primary-light); color: var(--brand-primary-text); font-weight: 600; }
.lists-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.lists-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.lists-content-header h4 { margin: 0; font-size: 1rem; }
.row-inactive { opacity: .5; }

/* Einstellungen > Allgemein */
.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.settings-section-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.settings-section .form-actions { padding-top: .5rem; }
.settings-section .form-hint { color: var(--text-muted); font-size: .8rem; margin-top: .25rem; display: block; }

/* MFR-Import: Drehsymbol waehrend des Laufs */
@keyframes mfrspin { to { transform: rotate(360deg); } }

/* L5 (v1.146.0): Klassen, die im Markup standen, aber keine Regel hatten (Analyse 01.10.2026). Bewusst schlicht und mit den
   vorhandenen Tokens - Aussehen wie gemeint, ohne neue Farben. */
.link-primary:hover { text-decoration: underline; }   /* Namen in Listen: sieht aus wie Text, beim Ueberfahren erkennbar als Link */
.card-footer { display: flex; gap: var(--space-sm); justify-content: flex-end; align-items: center; padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border); }
.card-danger { border-color: var(--danger); }
.card-danger > .card-header h2, .card-danger > .card-header .card-title { color: var(--danger); }
.text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.inline-form { display: inline-flex; align-items: center; gap: var(--space-xs); margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.ft-value-hint { font-variant-numeric: tabular-nums; }   /* Wertzeile unter einem Feld (ft_value_hint, Bedien-Muster 58) - zaehlt nicht als Hinweiszeile */

/* ============================================================
   v1.150.0 GLOBALE PILLEN-REGEL (Ralf 01.10.2026, Bedien-Muster 79) - steht bewusst am Ende und gilt fuer JEDE Pille:
   .ft-pill (Baustein StatusPill), .ft-hp (Kopf-Pillen), .badge (Altbestand, z. B. Zaehler in Reitern). Ein Aufbau: Symbol + Text,
   eine Hoehe, eine Schrift, ein Rand, fuenf Toene. Groessen-Varianten (badge-sm, badge-xs) gibt es nicht mehr - nicht neu anlegen.
   ============================================================ */
.ft-pill, .ft-hp, .badge {
    display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
    padding: 1px 9px 1px 7px; margin: 0; border-radius: var(--radius-full); border: 1px solid transparent;
    font-size: var(--font-xs); font-weight: 600; line-height: 1.6; letter-spacing: 0; white-space: nowrap;
}
.ft-pill > .icon, .ft-hp > .icon, .badge > .icon { display: inline-flex; flex: none; }
.ft-pill > .icon svg, .ft-hp > .icon svg, .badge > .icon svg { width: 15px; height: 15px; }
.badge.badge-sm, .badge.badge-xs { font-size: var(--font-xs); padding: 1px 9px 1px 7px; margin-left: 0; }
.ft-pill-count, .badge:not([class*="badge-"]) { padding: 1px 8px; }
.ft-pill-ok, .ft-hp-ok, .badge-success, .badge-active, .badge-confirmed, .badge-status-done
    { background: var(--success-light); color: var(--success-text); border-color: var(--success-border); }
.ft-pill-info, .ft-hp-info, .badge-info, .badge-open, .badge-planned, .badge-scheduled, .badge-status-closed
    { background: var(--info-light); color: var(--info-text); border-color: var(--info-border); }
.ft-pill-warn, .ft-hp-warn, .badge-warning, .badge-trial, .badge-in_progress, .badge-status-in_progress
    { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning-border); }
.ft-pill-danger, .ft-hp-danger, .badge-danger, .badge-suspended, .badge-cancelled, .badge-status-cancelled
    { background: var(--danger-light); color: var(--danger-text); border-color: var(--danger-border); }
.ft-pill-neutral, .ft-hp-neutral, .badge-neutral, .badge-completed, .badge-status-new
    { background: var(--bg-subtle); color: var(--text-secondary); border-color: var(--border); }
.badge-status-planned { background: var(--accent-light); color: var(--accent-text); border-color: var(--accent-light); }
.ft-gap-top { margin-top: var(--space-sm); }
.ft-gap-bottom { margin-bottom: var(--space-md); }

/* ============================================================
   v1.151.0 SEITENAUFBAU (Ralf 01.10.2026, Bedien-Muster 80) - global fuer jede Seite der Kunden-App:
   Kopf (Titel + Hell/Dunkel/Rechte/Vorschau) -> Kacheln (Filter) -> EINE Leiste: Zurueck, Bearbeiten-Knoepfe, Suchfeld (30 %) -> Inhalt.
   ============================================================ */
.ft-page-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.ft-page-bar-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.ft-page-bar > .ft-page-search { flex: 0 1 30%; min-width: 240px; }
.stat-grid.ft-tiles + .ft-page-bar, .ft-tiles-bar + .stat-grid.ft-tiles { margin-top: 0; }
@media (max-width: 760px) { .ft-page-bar > .ft-page-search { flex: 1 1 100%; } }

.stat-card.ft-tile > div:last-child { min-width: 0; }   /* v1.151.0: lange Kachel-Namen ("teilweise weitergefuehrt") brechen um statt ueberzulaufen */
.stat-card.ft-tile .stat-label { white-space: normal; overflow: visible; text-overflow: clip; hyphens: auto; line-height: 1.25; }   /* Trennung nach Silben (lang=de) */
.ft-page-bar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }   /* v1.152.0: rechter Block der Leiste */
.ft-subtiles { margin-top: calc(-1 * var(--space-sm)); margin-bottom: var(--space-md); }   /* v1.152.0: Unterebene (Untergruppen) */

/* v1.152.0: Kachelbreite - hoechstens 6 je Reihe (Alle + 5), nie schmaler als 215 px (darunter liefen lange Namen wie
   "teilweise weitergefuehrt" ueber); reicht die Breite nicht, rutschen Kacheln in die naechste Reihe */
.stat-grid.ft-tiles { --tile-gap: var(--space-md); gap: var(--tile-gap); grid-template-columns: repeat(auto-fill, minmax(max(215px, calc((100% - 5 * var(--tile-gap)) / 6)), 1fr)); }
.ft-page-bar-right .ft-head-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   v1.154.0 ARTIKELBILDER (Ralf 01.10.2026) - Bildleiste ca. 4 je Reihe, Ziehen am Griff, Bild 1 = Hauptbild; Grossansicht (global)
   ============================================================ */
.art-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-sm); }
@media (min-width: 1200px) { .art-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.art-gal-item { position: relative; margin: 0; aspect-ratio: 1 / 1; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.art-gal-item > a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: zoom-in; }
.art-gal-item img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.art-gal-item:first-child { border-color: var(--warning-border); box-shadow: inset 0 0 0 1px var(--warning-border); }
.art-gal-main { position: absolute; left: 6px; bottom: 6px; display: none; pointer-events: none; }
.art-gal-item:first-child .art-gal-main { display: inline-flex; }   /* Bild 1 - folgt dem Ziehen ohne Neuladen */
.art-gal-drag { position: absolute; top: 6px; left: 6px; display: inline-flex; padding: 2px; border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text-secondary); border: 1px solid var(--border); cursor: grab; }
.art-gal-item.is-dragging { opacity: .55; }
.art-gallery-empty { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-lg); border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--text-muted); }
/* Grossansicht (core.js, a[data-lightbox]) */
.ft-lb { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, .86); display: flex; align-items: center; justify-content: center; padding: 56px 72px; }
.ft-lb[hidden] { display: none; }
.ft-lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.ft-lb-img { max-width: calc(100vw - 144px); max-height: calc(100vh - 150px); object-fit: contain; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.ft-lb-cap { color: #e2e8f0; font-size: var(--font-sm); text-align: center; }
.ft-lb-btn { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.ft-lb-btn:hover, .ft-lb-btn:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.ft-lb-close { top: 14px; right: 14px; }
.ft-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.ft-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.ft-lb.is-single .ft-lb-prev, .ft-lb.is-single .ft-lb-next { display: none; }
body.ft-lb-open { overflow: hidden; }

/* v1.155.0 (Ralf 01.10.2026: "Menge/Preis/Rabatt sind immer gleich breit - FIX - der gesparte Platz ist fuer die Bezeichnung"): feste
   Tabellenaufteilung der Positionen - die Breiten stehen am Kopf, die Bezeichnung (ohne Breite) bekommt den ganzen Rest. Auf schmalen
   Bildschirmen scrollt die Tabelle waagerecht, statt die Bezeichnung zu quetschen. */
.data-table.ft-pos-table { table-layout: fixed; min-width: 960px; }
.data-table.ft-pos-table .sort-handle-cell { width: 36px; }
.data-table.ft-pos-table .ft-col-thumb { width: 64px; }
.data-table.ft-pos-table .ft-col-pos { width: 3.25rem; }
.data-table.ft-pos-table .ft-col-num { width: 7.5rem; }      /* Menge, Preis, Rabatt - alle drei GLEICH */
.data-table.ft-pos-table .ft-col-sum { width: 8.5rem; white-space: nowrap; }
.data-table.ft-pos-table .ft-col-flags { width: 8.5rem; padding-left: var(--space-md); }
.data-table.ft-pos-table td { overflow-wrap: anywhere; }
.card-body-flush:has(> .data-table.ft-pos-table) { overflow-x: auto; }


/* ============================================================
   v1.157.0 IMPORT (Ralf 01.10.2026, Bedien-Muster 83) - Kachelseite Einstellungen -> Import und Seite import.php
   ============================================================ */
/* v1.163.0: Bereiche als Akkordeon (globales .form-section.ft-acc) - Titel mit Status und Knoepfen, Felder als Tabelle */
.imp-sec .form-section-title { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.imp-sec-name { font-weight: 700; }
.imp-sec-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.imp-sec.is-coming .form-section-title { color: var(--text-muted); }
.imp-fields td { vertical-align: top; }
.imp-fields td:first-child, .imp-fields th:first-child { white-space: nowrap; width: 1%; padding-right: var(--space-lg); }
.imp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); }
.card-body.imp-actions { margin-top: 0; border-top: 1px solid var(--border); }
.imp-sum { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.imp-upload { max-width: 560px; }

/* v1.158.0 BILD STATT SYMBOL (Bedien-Muster 84, CatalogImages): Bild im Symbolfeld, weiss hinterlegt, ganz sichtbar; Grossansicht beim Ueberfahren */
.stat-icon.stat-img { background: #fff; border: 1px solid var(--border); padding: 2px; overflow: hidden; cursor: zoom-in; }
.stat-icon.stat-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cat-img-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); }

/* v1.159.0 Vorschau vor dem Hochladen ([data-img-preview], core.js) */
.ft-file-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin: var(--space-sm) 0; padding: var(--space-sm); border: 1px dashed var(--warning-border); border-radius: var(--radius-md); background: var(--warning-light); }
.ft-file-preview figure { margin: 0; width: 96px; display: grid; gap: 4px; }
.ft-file-preview img { width: 96px; height: 96px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ft-file-preview figcaption { font-size: var(--font-xs); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-file-note { font-size: var(--font-sm); color: var(--warning-text); flex: 1 1 160px; }


/* v1.161.0 STUFEN-PUNKTE (Bedien-Muster 86, ft_tile_level): Ebene im Baum oben rechts in der Kachel - gefuellt = Ebene, leer = tiefer moeglich */
.ft-tile { position: relative; }
.ft-lvl { position: absolute; top: 8px; right: 9px; display: inline-flex; gap: 3px; padding: 3px; cursor: help; }
.ft-lvl i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.ft-lvl i.on { background: var(--ft-navy); }
[data-theme="dark"] .ft-lvl i.on { background: var(--ft-yellow); }
.stat-mini.ft-tile .ft-lvl { top: 5px; right: 6px; }
.stat-mini.ft-tile .ft-lvl i { width: 6px; height: 6px; }

/* v1.164.0 BAUM-AKKORDEON (Bedien-Muster 87, core.js [data-tree]): Einrueckung je Ebene, Pfeil zum Auf-/Zuklappen, Ebene 1 hinterlegt */
.tv-name { display: flex; align-items: center; gap: 8px; padding-left: calc(var(--tv-d, 0) * 26px); }
.tv-chev { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; transition: transform var(--transition-fast); }
.tv-chev:hover, .tv-chev:focus-visible { background: var(--bg-subtle); outline: none; }
.tv-chev.open { transform: rotate(90deg); }
.tv-chev.is-empty { cursor: default; }
.tv-row.tv-d0 > td { background: var(--bg-subtle); }
.tv-row .ft-lvl { position: static; }


/* v1.165.0 (Bedien-Muster 88): Import - Schieber, Zuordnung in Bereichen, Hinweise je Zeile, Bilder laden */
.imp-switches { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin: var(--space-sm) 0 var(--space-md); }
.imp-map td:first-child { width: 40%; }
.imp-map select { width: 100%; max-width: 360px; }
.imp-help-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.imp-note { display: flex; align-items: flex-start; gap: 4px; color: var(--text-secondary); margin-top: 2px; }
.imp-bar { margin: var(--space-sm) 0; }
.imp-bar .progress-bar-fill { width: 0; }
.imp-batch-nums { margin: var(--space-sm) 0; }
.imp-actions[hidden], .table-scroll[hidden] { display: none; }   /* hidden gegen display:flex der Knopfzeile */
.imp-fields .imp-sec-row td { background: var(--bg-subtle); font-weight: 700; }

/* v1.166.0 (Bedien-Muster 89): Import wie die JTL-Ameise - Vorlagen-Leiste, Dateivorschau (zugeordnet = gruen), Standardwert/Praefix je Feld */
.imp-tplbar { border-bottom: 1px solid var(--border); }
.imp-tplform { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.imp-tpl-label { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.imp-tpl-sel { min-width: 260px; max-width: 100%; }
.imp-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.imp-preview th, .imp-preview td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.imp-preview th { color: var(--text-muted); }
.imp-col-letter { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-right: 2px; border-radius: var(--radius-sm, 4px); background: var(--bg-subtle); color: var(--text-secondary); font-weight: 700; text-align: center; }   /* v1.167.0: Spaltenbuchstabe wie Excel */
.imp-preview .is-mapped { background: var(--success-light); color: var(--success-text); }
.imp-map tr.is-mapped td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.imp-extra { min-width: 200px; }
.table-scroll.imp-map-wrap { max-height: none; overflow-y: visible; }   /* Zuordnung: keine zweite Scrollleiste im Akkordeon */
.imp-notes { min-width: 260px; }
.imp-def { width: 100%; }
/* v1.168.0-v1.171.0 (Bedien-Muster 89): Vorauswahl, Spaltenauswahl aus/an, Filter "Nur aktive Felder", ausgeblendete Bereiche, Ergebnis-Akkordeon */
.imp-pre { font-size: var(--font-sm); color: var(--text-secondary); }
.imp-pre-val { margin-top: 4px; }
.imp-pre-val[hidden], .imp-col-wrap[hidden], .imp-col-off[hidden], .imp-offbar[hidden] { display: none; }
.imp-col-off { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); font-style: italic; }
.imp-head-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-left: auto; }
.imp-sec[hidden], .imp-sec.is-off { display: none; }
.imp-offbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.imp-offbar [data-imp-offlist] { display: inline-flex; flex-wrap: wrap; gap: var(--space-xs); }
.imp-sec-hide { margin-left: auto; font-size: var(--font-sm); font-weight: 400; color: var(--text-secondary); }
.form-section.ft-acc > .form-section-title .imp-sec-hide + .accordion-chevron { margin-left: var(--space-sm); }   /* Schieber rechts neben dem Pfeil */
.imp-res-tiles { margin-bottom: var(--space-sm); }
.imp-linkbase { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }   /* v1.172.0: Basis-Link */
.imp-linkbase label { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.imp-linkbase input { flex: 1 1 320px; max-width: 560px; }
.imp-res .form-section.ft-acc { margin-bottom: 0; }   /* Ergebnis-Akkordeon fuellt die Karte */
.imp-res .form-section-title { flex-wrap: wrap; }
.imp-res .imp-sec-btns { flex-wrap: wrap; }
.imp-affix { margin-top: 4px; }
.imp-affix summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-sm); color: var(--text-secondary); }
.imp-affix input { width: 100%; margin-top: 4px; }

/* v1.173.0 (Bedien-Muster 80): Auswahl-Filter in der Seitenleiste vor der Suche (z. B. Hersteller in der Artikelliste) */
.ft-page-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.ft-page-filter select { min-width: 200px; max-width: 280px; }
.ft-page-filter.is-active select, .ft-page-filter.is-active .ft-combo-input { border-color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary); }
.ft-page-filter.is-active { color: var(--brand-primary); }

/* v1.177.0 (Bedien-Muster 90, Spalten global): gruener Haken in Ja/Nein-Spalten der Tabellenlisten (rabattfaehig, Lagerartikel ...) */
.ft-col-ok { display: inline-flex; color: var(--success); vertical-align: middle; }

/* KP2a (v1.181.0, Kundenportal - Erscheinungsbild): Vorschau der Anmeldeseite des Portals in der linken Karte. BEWUSST feste Farben fuer
   Flaechen und Schrift der Vorschau: sie zeigt die Seite, die die KUNDEN des Betriebs sehen (hell oder dunkel nach Wahl in der Vorschau),
   nicht die Kunden-App - das Thema der App darf sie nicht umfaerben. Haupt-/Akzentfarbe und Schrift auf der Hauptfarbe kommen als
   CSS-Variablen (--cp-main, --cp-accent, --cp-on-main) aus den Einstellungen bzw. live aus assets/js/cportal.js. */
.cp-prev { --cp-bg: #FFFFFF; --cp-page: #F4F6F5; --cp-ink: #17212B; --cp-muted: #5B6878; --cp-line: #C9D3DC;
    border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; font-size: var(--font-xs); line-height: 1.4; color: var(--cp-ink); background: var(--cp-page); }
.cp-prev.is-dark { --cp-bg: #1E2733; --cp-page: #121A24; --cp-ink: #E8EDF1; --cp-muted: #A3AFBD; --cp-line: #3A4757; }
.cp-prev-url { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 8px; background: #E6E9EC; color: #334155; }
.cp-prev-url .icon { color: #15803D; }
.cp-prev-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 230px; }
.cp-prev-brand { background: var(--cp-main); color: var(--cp-on-main); padding: var(--space-md) var(--space-sm) var(--space-md) var(--space-md); display: flex; flex-direction: column; gap: 6px; }
.cp-prev-logo { display: flex; align-items: center; min-height: 34px; }
.cp-prev-img { max-height: 34px; max-width: 100%; object-fit: contain; }
.cp-prev-img-pad { background: #FFFFFF; padding: 3px 6px; border-radius: var(--radius-sm); }
.cp-prev-fallback { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: #FFFFFF; color: var(--cp-main); }
.cp-prev-name { font-weight: 800; font-size: var(--font-sm); overflow-wrap: anywhere; }
.cp-prev-sub { opacity: .85; }
.cp-prev-bar { width: 32px; height: 3px; border-radius: 2px; background: var(--cp-accent); margin: 4px 0; }
.cp-prev-welcome { white-space: pre-line; overflow-wrap: anywhere; opacity: .95; }
.cp-prev-form { background: var(--cp-bg); padding: var(--space-md) var(--space-sm); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cp-prev-title { font-weight: 800; font-size: var(--font-sm); margin-bottom: 2px; }
.cp-prev-label { color: var(--cp-muted); font-weight: 600; }
.cp-prev-input { height: 20px; border: 1px solid var(--cp-line); border-radius: var(--radius-sm); }
.cp-prev-input.is-focus { border-color: var(--cp-accent); box-shadow: 0 0 0 1px var(--cp-accent); }
.cp-prev-btn { margin-top: 6px; height: 24px; border-radius: var(--radius-sm); background: var(--cp-main); color: var(--cp-on-main); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cp-prev-link { color: var(--cp-main); font-weight: 600; text-align: center; }
.cp-prev.is-dark .cp-prev-link { color: var(--cp-ink); }
.cp-prev-foot { display: flex; gap: var(--space-sm); padding: 4px 8px; border-top: 1px solid var(--cp-line); background: var(--cp-bg); color: var(--cp-muted); }
.cp-prev-ft { margin-left: auto; }
.cp-logo-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.cp-logo-box { display: inline-flex; align-items: center; justify-content: center; min-width: 140px; height: 56px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #FFFFFF; }
.cp-logo-box.is-dark { background: #1B2430; }
.cp-logo-img { max-height: 44px; max-width: 220px; object-fit: contain; }
.cp-color { display: flex; align-items: center; gap: var(--space-sm); }
.cp-color input[type="color"] { flex: none; width: var(--ctl-h); height: var(--ctl-h); padding: 2px; border: 1px solid var(--ctl-border); border-radius: var(--ctl-radius); background: var(--card-bg); cursor: pointer; }
.cp-color input[type="text"] { font-family: var(--font-mono); text-transform: uppercase; }
.ft-record-btns .btn.is-active { border-color: var(--brand-primary); color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); }

/* v1.182.0 (Ralf 03.10.2026): Datei-Felder in Optik und Sprache der App statt des System-Knopfs des Browsers - core.js setzt um jedes
   input[type=file] einen Knopf (.ft-file-btn) und den Dateinamen (.ft-file-name); das echte Feld bleibt verdeckt im Formular (.ft-sr) */
.ft-file { position: relative; display: inline-flex; align-items: center; gap: var(--space-sm); max-width: 100%; min-width: 0; }
.ft-file-btn { flex: none; }
.ft-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: var(--font-sm); }
.ft-file.has-file .ft-file-name { color: var(--text); }
.doc-drop-row .ft-file { flex: 1 1 260px; }

/* v1.188.0 (PM1 Preismatrix): zwei Eingaben nebeneinander in einer Formularzelle (Preis + Preiseinheit, EK von - bis, Faktor + Rundung) */
.ft-field-row { display: flex; gap: var(--space-sm); align-items: center; }
.ft-field-row > * { flex: 1; min-width: 0; }
/* Maskenbau L1 (v1.215.0): Huellen und Leerraum des Layout-Registers (assets/js/layout.js, Maskenbau-Konzept 2. Fassung) */
.ft-layout-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-md); box-shadow: var(--shadow-sm, 0 1px 2px rgba(16,24,40,.06)); background: var(--bg-elevated, var(--bg)); }
.ft-layout-acc { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ft-layout-acc-head { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: var(--bg-subtle); color: var(--text); padding: 10px 12px; cursor: pointer; font: inherit; font-weight: 600; text-align: left; }
.ft-layout-acc-head:hover { filter: brightness(0.98); }
.ft-layout-acc-chev { width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform .15s; }
.ft-layout-acc-head[aria-expanded="false"] .ft-layout-acc-chev { transform: rotate(-45deg); }
.ft-layout-acc-body { padding: var(--space-md); }
.ft-layout-acc-body .form-section-title:first-child { display: none; }   /* Titel steht schon im Akkordeon-Kopf */
.ft-layout-spacer { min-height: 1px; }
/* v1.216.0: Blockbreite 1/1, 1/2, 1/3 - Eltern-Container der Bloecke als 12er-Raster; Fremdes und Volles auf ganzer Breite */
.ft-layout-cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--space-lg); align-items: start; }
.ft-layout-cols > *:not([data-layout-bspan]) { grid-column: 1 / -1; }
.nav-item.logout .nav-version { margin-left: auto; font-size: 11px; opacity: .55; }   /* v1.225.0: Versionsnummer neben Abmelden (wie Schaltzentrale) */
.role-card-locked { opacity: .45; cursor: not-allowed; }   /* v1.226.0: letzter Admin - andere Rollen gesperrt */
.role-card-locked * { pointer-events: none; }
/* v1.228.0/v1.229.0: Pakete-Schaufenster (Einstellungen -> Pakete) - formatierte Beschreibung aus der Schaltzentrale */
.pakete-acc { border: none; border-radius: 0; overflow: visible; }   /* v1.230.0 (Ralf: "einen abstand zwischen den akkordion"): Items als eigene Karten */
.pakete-acc .accordion-item { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-sm); overflow: hidden; }
.pakete-acc .accordion-item:last-child { margin-bottom: 0; }
.pakete-acc .accordion-header { gap: var(--space-sm); }
.pakete-acc .paket-inhalt { padding: var(--space-md) var(--space-lg); }   /* v1.229.0 (Ralf: "zu dicht am rand!!!") */
.pakete-acc .accordion-header .btn { margin-left: auto; }
.pakete-acc .accordion-header .accordion-chevron { margin-left: var(--space-sm); }
.paket-beschreibung p { margin: 0 0 var(--space-sm); }
.paket-beschreibung h4 { margin: var(--space-sm) 0 var(--space-xs); font-size: 0.95rem; }
.paket-beschreibung ul, .paket-beschreibung ol { margin: 0 0 var(--space-sm) 1.2em; }
.paket-preise { margin-top: var(--space-md); display: grid; gap: var(--space-xs); }   /* v1.231.0/v1.232.0: Werbetext, LEERZEILE, Kosten-Block, LEERZEILE, Pillen */
.paket-preise-titel { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.paket-preise-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }   /* v1.232.0 (Ralf): Preis+Jahrespreis in einer Reihe, Extras in einer Reihe */
.paket-bausteine { margin-top: var(--space-md); display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* v1.237.0: Mengen-Limits als Gruppen-Zeilen (ein Symbol je Bereich) + Erklaer-Tooltip */
.paket-lim { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 20px; margin-top: var(--space-xs); }
.paket-lim-zeile { font-size: var(--font-sm); }
.paket-lim-zeile .icon { color: var(--text-muted); vertical-align: -3px; }   /* v1.238.0 (Ralf): schoen mittig wie bei Benutzer/Speicher */
.paket-lim-voll { grid-column: 1 / -1; }
.paket-lim-grp { font-weight: 500; }
.lim-tip { position: relative; cursor: help; }
.lim-tip:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    background: var(--sidebar-bg);
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    width: max-content;
    max-width: 260px;
    z-index: 300;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.ft-layout-cols > .ft-layout-voll { align-self: stretch; }   /* v1.221.0: Block fuellt die Zeilenhoehe */
.ft-layout-voll.ft-layout-card, .ft-layout-voll.ft-layout-acc { height: 100%; display: flex; flex-direction: column; }
.ft-layout-voll.ft-layout-acc .ft-layout-acc-body { flex: 1; }
@media (max-width: 900px) { .ft-layout-cols > [data-layout-bspan] { grid-column: 1 / -1 !important; } }   /* schmal: untereinander */
/* Werkstatt L2 (v1.219.0): Bearbeiten-Modus des Maskenbaus direkt auf der Seite (assets/js/layout-edit.js) */
button.ft-ws-open { border: 0; background: none; font: inherit; cursor: pointer; }   /* Knopf traegt den Reiterleisten-Look (.tab-side-ico) */
button.ft-ws-open.active { color: var(--navy, #12314D); }
.ws-ico { width: 15px; height: 15px; fill: currentColor; display: block; }
#ft-ws-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--bg-elevated, var(--bg)); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(18,49,77,.10); }
#ft-ws-bar .ws-name { display: flex; align-items: center; gap: 7px; font-weight: 700; }
#ft-ws-bar .ws-spring { flex: 1; }
#ft-ws-bar select { max-width: 260px; }
#ft-ws-bar .ws-std { color: var(--text-muted); font-size: 13px; }
body.ft-ws-on { padding-bottom: 64px; }
body.ft-ws-on .ft-layout-src { display: block; }   /* in der Werkstatt zaehlt der Bearbeiten-Blick, nicht die Huellen-Sperre */
.ws-blk { position: relative; outline: 1px dashed var(--border); outline-offset: 4px; border-radius: 4px; }
.ws-blk-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; padding: 4px 6px;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.ws-grip { cursor: grab; display: inline-flex; color: var(--text-muted); padding: 2px; }
.ws-grip:active { cursor: grabbing; }
.ws-t { border: 1px solid var(--border); background: none; color: var(--text); border-radius: 5px; padding: 2px 7px;
  font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ws-t:hover { background: var(--bg-elevated, var(--bg)); border-color: var(--navy, #12314D); }
.ws-t.on { border-color: var(--navy, #12314D); font-weight: 700; }
.ws-t svg { width: 13px; height: 13px; fill: currentColor; }
.ws-moved { color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.ws-dragging { opacity: .55; }
.ws-hiddenblk { opacity: .5; }
.ws-movedblk { opacity: .66; }
.ws-tab-tools { display: inline-flex; gap: 2px; margin-left: 4px; }
.ws-tmove { cursor: pointer; font-weight: 700; color: var(--text-muted); padding: 0 3px; border-radius: 4px; }
.ws-tmove:hover { color: var(--text); background: var(--bg-subtle); }
.ws-tdel { cursor: pointer; font-weight: 700; color: var(--text-muted); padding: 0 4px; border-radius: 4px; }
.ws-tdel:hover { color: var(--danger, #b4232a); background: var(--bg-subtle); }
.ws-tab-ico { cursor: pointer; }
.ws-dropok { outline: 2px solid var(--navy, #12314D); outline-offset: 2px; border-radius: 6px; }
.ws-addtab, .ws-newtab { opacity: .85; }
#ft-ws-iconpick { position: fixed; z-index: 60; width: 292px; background: var(--bg-elevated, var(--bg));
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(18,49,77,.18); padding: 10px; }
#ft-ws-iconpick input { width: 100%; margin: 0 0 8px; }
#ft-ws-names { position: fixed; z-index: 60; width: 300px; background: var(--bg-elevated, var(--bg));
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(18,49,77,.18); padding: 12px; }
#ft-ws-names .ws-np-head { font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 0 0 8px; }
#ft-ws-names .ws-np-row { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; }
#ft-ws-names .ws-np-row span { flex: 0 0 96px; color: var(--text-secondary); }
#ft-ws-names .ws-np-row input { flex: 1; }
#ft-ws-names .ws-np-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#ft-ws-iconpick .ws-ip-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 240px; overflow: auto; }
#ft-ws-iconpick .ws-ip-i { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); cursor: pointer; }
#ft-ws-iconpick .ws-ip-i:hover { background: var(--bg-subtle); border-color: var(--border); }
#ft-ws-iconpick .ws-ip-i svg { width: 16px; height: 16px; fill: currentColor; }
.ws-fgrid .form-group { position: relative; outline: 1px dotted var(--border); outline-offset: 2px; border-radius: 4px; }
.ws-f-tools { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; font-size: 11px; }
.ws-fgrid .ft-layout-spacer { min-height: 34px; background: repeating-linear-gradient(45deg, transparent, transparent 6px, var(--bg-subtle) 6px, var(--bg-subtle) 12px); }

/* L1b (v1.217.0): Sammel-Lauf eines Quell-Reiters - unsichtbar, bis layout.js aufgeraeumt hat (nur verlegte Bloecke sichtbar) */
.ft-layout-src { display: none; }
.ft-layout-src.ft-layout-src-ready { display: block; }

/* PMZ (v1.214.0): fester Feldwert anstelle eines Eingabefelds (z. B. Artikel einer Matrix-Zeile beim Bearbeiten) */
.ft-static { display: flex; align-items: center; gap: var(--space-xs); min-height: 38px; padding: 0 var(--space-sm); border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); }

/* ---- Flaggen der Portal-Sprachen (KP10, v1.242.0) - Kunden-App (Zugang-Akte) und Kundenportal (Umschalter). Als CSS statt Emoji, weil Windows
   Flaggen-Emojis nur als Buchstaben zeigt. Die Farben sind die der Flaggen selbst (keine Design-Tokens). Neue Portal-Sprache = eine Zeile hier. ---- */
.kp-flag { display: inline-block; width: 20px; height: 14px; border-radius: 2px; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.kp-flag-de { background: linear-gradient(#000000 0 33.34%, #DD0000 33.34% 66.67%, #FFCE00 66.67%); }
.kp-flag-nl { background: linear-gradient(#AE1C28 0 33.34%, #FFFFFF 33.34% 66.67%, #21468B 66.67%); }
.kp-flag-da { background: linear-gradient(90deg, transparent 0 30%, #FFFFFF 30% 42%, transparent 42%), linear-gradient(transparent 0 42%, #FFFFFF 42% 58%, transparent 58%), #C8102E; }
.kp-flag-en { background: linear-gradient(90deg, transparent 0 43%, #C8102E 43% 57%, transparent 57%), linear-gradient(transparent 0 40%, #C8102E 40% 60%, transparent 60%),
    linear-gradient(90deg, transparent 0 37%, #FFFFFF 37% 63%, transparent 63%), linear-gradient(transparent 0 32%, #FFFFFF 32% 68%, transparent 68%), #012169; }
/* KP10b (v1.243.0): weitere waehlbare Portal-Sprachen (lang/languages.php 'portal') - Farben der Flaggen, Wappen weggelassen */
.kp-flag-fr { background: linear-gradient(90deg, #0055A4 0 33.34%, #FFFFFF 33.34% 66.67%, #EF4135 66.67%); }
.kp-flag-it { background: linear-gradient(90deg, #009246 0 33.34%, #FFFFFF 33.34% 66.67%, #CE2B37 66.67%); }
.kp-flag-es { background: linear-gradient(#AA151B 0 25%, #F1BF00 25% 75%, #AA151B 75%); }
.kp-flag-pt { background: linear-gradient(90deg, #006600 0 40%, #FF0000 40%); }
.kp-flag-pl { background: linear-gradient(#FFFFFF 0 50%, #DC143C 50%); }
.kp-flag-sv { background: linear-gradient(90deg, transparent 0 30%, #FECC02 30% 42%, transparent 42%), linear-gradient(transparent 0 40%, #FECC02 40% 60%, transparent 60%), #006AA7; }
.kp-flag-nb { background: linear-gradient(90deg, transparent 0 30%, #00205B 30% 38%, transparent 38%), linear-gradient(transparent 0 44%, #00205B 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 0 26%, #FFFFFF 26% 42%, transparent 42%), linear-gradient(transparent 0 36%, #FFFFFF 36% 64%, transparent 64%), #BA0C2F; }
.kp-flag-fi { background: linear-gradient(90deg, transparent 0 30%, #002F6C 30% 42%, transparent 42%), linear-gradient(transparent 0 40%, #002F6C 40% 60%, transparent 60%), #FFFFFF; }
.kp-flag-cs { background: linear-gradient(to bottom right, #11457E 0 50%, transparent 50%) top left / 50% 50% no-repeat, linear-gradient(to top right, #11457E 0 50%, transparent 50%) bottom left / 50% 50% no-repeat,
    linear-gradient(#FFFFFF 0 50%, #D7141A 50%); }
/* v1.245.0 (Ralf, Bild Zugang-Akte "die Icons sind nicht mittig"): Symbol und Pille in einer Schalter-Zeile auf Textmitte statt auf der
   Grundlinie - gilt global fuer label.check (inline wie flex) und fuer Hinweiszeilen mit Symbol */
label.check { align-items: center; }
label.check > .icon, label.check > .ft-pill, .ft-value-hint > .icon { vertical-align: middle; align-self: center; }

/* tabs.css */
/* ============================================================
   TABS.CSS - Wiederverwendbare Tab-Komponente v1.0
   ============================================================

   Nutzt variables.css Tokens.
   Einbinden: <link rel="stylesheet" href="/assets/css/components/tabs.css">

   Struktur:
     .tab-container
       .tab-nav
         .tab-btn (.active)
           .tab-icon
           .tab-count
       .tab-content (.active)
         .tab-header
         .tab-readonly-notice

   ============================================================ */


/* === Tab Container === */
.tab-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}


/* === Tab Navigation === */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    background: var(--bg-subtle);
    overflow-x: auto;
    overflow-y: hidden;             /* K2.1 (v1.21.1): die Unterstreichung des aktiven Reiters ragte 2px unter die Leiste - overflow-x:auto machte daraus eine senkrechte Scrollleiste */
    padding: 0 var(--space-sm);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.tab-nav::-webkit-scrollbar {
    height: 3px;
}

.tab-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}


/* === Tab Button === */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(0,0,0,0.02);
}

.tab-btn.active {
    color: var(--brand-primary-text);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-accent);   /* K2 (v1.21.0): Takt Gelb */
    border-radius: 2px 2px 0 0;
}


/* === Tab Icon === */
.tab-icon {
    font-size: 15px;
    line-height: 1;
}


/* === Tab Count Badge === */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    background: var(--border);
    color: var(--text-secondary);
    line-height: 1;
}

.tab-btn.active .tab-count {
    background: var(--brand-primary-light);
    color: var(--brand-primary-text);
}




/* === Tab Content === */
.tab-content {
    padding: var(--space-lg);
}


/* === Tab Header (Stats + Action Button) === */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}


/* === Stat Mini Cards (im Tab-Header) === */
.stat-mini-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    background: var(--card-bg);   /* v1.43.0: Kartengrund statt --bg-subtle, sonst verschwindet das Navy-Icon-Feld */
    border: 1px solid var(--border);
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-mini-label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.2;
}


/* === Read-Only Hinweis === */
.tab-readonly-notice {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    margin-top: var(--space-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--font-xs);
}


/* === Timeline (f&uuml;r Aktivit&auml;ten-Tab) === */
.timeline {
    position: relative;
    padding-left: 36px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-lg);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-dot-primary { border-color: var(--brand-primary); color: var(--brand-primary-text); }
.timeline-dot-success { border-color: var(--success); color: var(--success); }
.timeline-dot-warning { border-color: var(--warning); color: var(--warning); }
.timeline-dot-info    { border-color: var(--info); color: var(--info); }
.timeline-dot-danger  { border-color: var(--danger); color: var(--danger); }

.timeline-body {
    padding-top: 2px;
}

.timeline-time {
    font-size: 13px;
    color: var(--text-muted);
}

.timeline-text {
    font-size: var(--font-xs);
    margin-top: 2px;
}

.timeline-label {
    color: var(--text-muted);
    margin-right: 4px;
}


/* === Function Tags (Kontakte) === */
.fn-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin: 1px;
    white-space: nowrap;
}


/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--text-muted);
}

.empty-state-icon {
    margin-bottom: var(--space-sm);
    opacity: 0.3;
}

.empty-state p {
    margin: var(--space-sm) 0 var(--space-md);
    font-size: var(--font-xs);
}


/* === Company Header Card === */
.company-header-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.company-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.company-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--brand-primary-light);
    color: var(--brand-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.company-header-meta h2 {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.company-header-details {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: 4px;
    flex-wrap: wrap;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 13px;
}

.company-header-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}


/* === Form Extensions (Tab-spezifisch) === */
.form-section {
    margin-bottom: var(--space-lg);
}

.form-section-last {
    margin-bottom: 0;
}

.form-section-title {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-col-span-2 {
    grid-column: span 2;
}

.form-col-span-3 {
    grid-column: span 3;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-textarea {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-family: var(--font-family);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.1);
}

.form-group input[readonly],
.form-group select[disabled],
.form-group textarea[readonly],
.form-textarea[readonly] {
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.form-actions-right {
    display: flex;
    gap: var(--space-sm);
}


/* === Toast Notifications === */
.toast {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-xs);
    font-weight: 500;
    transition: opacity 0.3s;
}

.toast-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.toast-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}


/* === Responsive === */
@media (max-width: 768px) {
    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-col-span-2,
    .form-col-span-3 {
        grid-column: span 1;
    }

    .tab-nav {
        gap: 0;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .company-header-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* K2 (v1.21.0): Tastatur-Fokus gelb, wie ueberall */
.tab-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* K3 (v1.22.0): Reiter-Baustein render_tabs() - dieselben Klassen wie in der Schaltzentrale (.tabs-bar > .tab-link). Die alten
   .tab-nav/.tab-btn bleiben, bis Einstellungen und Import umgestellt sind (K8/K9), dann fliegen sie in K10. */
.tabs-bar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid var(--border); background: var(--bg-subtle); padding: 0 var(--space-sm); }
.tab-link { display: inline-flex; align-items: center; gap: 7px; padding: 12px 16px; margin-bottom: -2px; color: var(--text-secondary); text-decoration: none; border-bottom: 2px solid transparent; font-size: var(--font-xs); font-weight: 500; white-space: nowrap; transition: color var(--transition-fast), border-color var(--transition-fast); }
.tab-link .icon, .tab-link svg { flex: none; }
.tab-link:hover { color: var(--brand-primary-text); }
.tab-link.active { color: var(--brand-primary-text); border-bottom-color: var(--brand-accent); font-weight: 600; }
.tab-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.tab-link .tab-count { margin-left: 2px; }
.tab-link .tab-count-warn { background: var(--danger-light); color: var(--danger-text); }
/* v1.44.0: .tab-link .tab-lock entfallen (kein Schloss mehr in der Reiterleiste) */
/* v1.44.0: Zahnrad der Kundenakte (Einstellungen Unternehmen) - fest oben rechts in der Leiste, die dafuer Platz freihaelt.
   Als normales Flex-Element rutschte es bei vollen Leisten in eine eigene zweite Zeile; so bleibt es in der ersten Zeile,
   auch wenn Reiter bei schmalem Fenster umbrechen. top = (Reiterhoehe 44px - Knopf 28px) / 2 */
/* v1.48.0 (R1): mehrere Werkzeug-Knoepfe rechts (Zahnrad .tabs-gear, Rechte .tabs-tool, spaeter Vorschau) - die Gruppe steht fest
   oben rechts in der ersten Zeile, die Leiste haelt je Knopf Platz frei; ein Knopf allein wie bisher. */
.tabs-bar:has(.tabs-gear, .tabs-tool) { position: relative; padding-right: 48px; }
.tabs-bar:has(.tabs-right > :nth-child(2)) { padding-right: 84px; }
.tabs-bar:has(.tabs-right > :nth-child(3)) { padding-right: 120px; }
.tabs-right:has(.tabs-gear, .tabs-tool) { position: absolute; right: var(--space-sm); top: 8px; display: flex; gap: 6px; margin-left: 0; }
.tabs-right .tabs-gear, .tabs-right .tabs-tool { color: var(--text-secondary); }
.tab-link-danger { color: var(--danger-text); } .tab-link-danger.active { color: var(--danger-text); border-bottom-color: var(--danger); }
.tabs-right { margin-left: auto; }
.tab-container > .tabs-bar { border-radius: var(--radius-md) var(--radius-md) 0 0; }

