/* ============================================================
   Bestform Cockpit — Design System
   Farbpalette: Navy/Gold (CI Bestform)
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

body {
    background: #0c1220;
    color: #e0e0e0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* --- Sidebar ----------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #0a0f1a;
    border-right: 1px solid #1a2540;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #1a2540;
    flex-shrink: 0;
}

.logo-mark {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #c9a961;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-sub {
    display: block;
    font-size: 9px;
    color: #556;
    letter-spacing: 3px;
    margin-top: 3px;
}

/* --- Navigation -------------------------------------------- */
.nav-list {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    margin: 1px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #778;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.nav-link:hover {
    background: #111827;
    color: #c0c8d8;
}

.nav-item.active .nav-link {
    background: #111827;
    color: #c9a961;
    border-left-color: #c9a961;
}

.nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
}

/* --- Sidebar User ------------------------------------------ */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid #1a2540;
    flex-shrink: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: #1a2540;
    border: 1px solid #c9a961;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #c9a961;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: #c0c8d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: #556;
    margin-top: 1px;
}

.logout-btn {
    font-size: 16px;
    color: #556;
    flex-shrink: 0;
    transition: color 0.15s;
    padding: 4px;
}

.logout-btn:hover {
    color: #e74c3c;
}

/* --- Sidebar v2 (Lucide-Icons + kollabierbare Sektionen) --- */
/* Ueberschreibt teilweise .nav-icon-Regeln oben.
   Stand 2026-04-29 — Sidebar-Umbau Wiederherstellung. */

.lucide {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

/* Sektion-Container */
.nav-section {
    display: block;
    margin: 1px 0;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: #778;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-section-header:hover {
    background: #111827;
    color: #c0c8d8;
}

.nav-section-header.active {
    color: #c9a961;
    border-left-color: #c9a961;
}

.nav-section-header .nav-label {
    flex: 1;
}

.nav-section-header .chevron {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    transition: transform 0.18s ease;
}

.nav-section.is-open .nav-section-header .chevron {
    transform: rotate(90deg);
}

/* Sektion-Inhalt: kollabierbar */
.nav-section-content {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: max-height 0.22s ease;
}

.nav-section.is-open .nav-section-content {
    max-height: 500px; /* groesser als jeder realistische Sub-Liste-Inhalt */
}

/* Hover-Aufklappen: Sektion expandiert, solange die Maus darueber ist.
   Nur auf Geraeten mit echter Maus — Touch bleibt beim Klick-Toggle
   (sonst klebt der Hover-Zustand nach dem Tippen). */
@media (hover: hover) and (pointer: fine) {
    .nav-section:hover .nav-section-content {
        max-height: 500px;
    }
    .nav-section:hover .nav-section-header .chevron {
        transform: rotate(90deg);
    }
}

/* Beim Seitenwechsel: bereits offene Sektion nicht aufklapp-animieren.
   body.sidebar-preload wird per requestAnimationFrame entfernt — danach
   laufen Klick-Toggles wieder normal animiert. */
body.sidebar-preload .nav-section-content,
body.sidebar-preload .nav-section-header .chevron {
    transition: none !important;
}



/* Sub-Items */
.nav-item.nav-sub .nav-link {
    padding: 7px 16px 7px 38px;
    font-size: 12px;
    color: #6b7280;
}

.nav-item.nav-sub .nav-link:hover {
    background: #111827;
    color: #c0c8d8;
}

.nav-item.nav-sub.active .nav-link {
    background: #111827;
    color: #c9a961;
    border-left-color: #c9a961;
}

.nav-item.nav-sub .lucide {
    width: 13px;
    height: 13px;
    opacity: 0.85;
}

/* Disabled (Modul nicht implementiert / "kommt") */
.nav-item.nav-sub.disabled .nav-link {
    color: #44525c;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ueberschreibe .nav-icon fuer alte Top-Level-Items (Cockpit, Einstellungen),
   damit das Lucide-SVG sauber zentriert sitzt */
.nav-link .lucide {
    margin-right: 0;
}

/* --- Main Content ------------------------------------------ */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 24px 28px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Flash Messages ---------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.flash {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.flash-error {
    background: rgba(231, 76, 60, 0.12);
    border-color: #e74c3c;
    color: #f08070;
}

.flash-success {
    background: rgba(46, 204, 113, 0.12);
    border-color: #2ecc71;
    color: #70e0a0;
}

.flash-warning {
    background: rgba(243, 156, 18, 0.12);
    border-color: #f39c12;
    color: #f0b050;
}

.flash-info {
    background: rgba(52, 152, 219, 0.12);
    border-color: #3498db;
    color: #70b8e8;
}

/* --- Cards ------------------------------------------------- */
.card {
    background: #111827;
    border: 1px solid #1a2540;
    border-radius: 10px;
    padding: 18px;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    color: #556;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

/* --- KPI / Ampel Cards ------------------------------------- */
.ampel-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ampel-card {
    background: #111827;
    border: 1px solid #1a2540;
    border-radius: 10px;
    padding: 16px 18px;
}

.ampel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ampel-label {
    font-size: 11px;
    color: #556;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ampel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green  { background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,0.5); }
.dot-yellow { background: #f39c12; box-shadow: 0 0 6px rgba(243,156,18,0.5); }
.dot-red    { background: #e74c3c; box-shadow: 0 0 6px rgba(231,76,60,0.5); }
.dot-gray   { background: #778899; box-shadow: 0 0 6px rgba(119,136,153,0.4); }

.ampel-value {
    font-size: 22px;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1.2;
}

.ampel-meta {
    font-size: 11px;
    color: #556;
    margin-top: 4px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    color: #dce3ef;
    background: rgba(119, 136, 153, 0.18);
    border: 1px solid rgba(119, 136, 153, 0.28);
}

.sync-badge-ok {
    color: #87d69f;
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.28);
}

.sync-badge-warning {
    color: #f7c86b;
    background: rgba(243, 156, 18, 0.12);
    border-color: rgba(243, 156, 18, 0.28);
}

.sync-badge-error {
    color: #f1948a;
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.3);
}

.sync-badge-missing {
    color: #aeb8c6;
}

.sync-badge-running {
    color: #8fc7ff;
    background: rgba(52, 152, 219, 0.12);
    border-color: rgba(52, 152, 219, 0.28);
}

/* --- Two-column grid --------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* --- Charts ----------------------------------------------- */
.bar-chart {
    position: relative;
    height: 200px;
    margin-top: 8px;
}

/* --- Alert List -------------------------------------------- */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #0c1220;
    border-radius: 6px;
    border-left: 3px solid transparent;
    font-size: 12px;
}

.alert-item.critical { border-color: #e74c3c; }
.alert-item.warning  { border-color: #f39c12; }
.alert-item.info     { border-color: #3498db; }

.alert-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-text { flex: 1; }
.alert-title { font-weight: 600; color: #c0c8d8; margin-bottom: 2px; }
.alert-desc  { color: #778; font-size: 11px; }

/* --- Kunde rows -------------------------------------------- */
.kunde-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #1a2540;
}

.kunde-row:last-child { border-bottom: none; }

.kunde-name {
    width: 140px;
    font-size: 12px;
    color: #c0c8d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.kunde-bar-wrap {
    flex: 1;
    height: 6px;
    background: #1a2540;
    border-radius: 3px;
    overflow: hidden;
}

.kunde-bar {
    height: 100%;
    background: #c9a961;
    border-radius: 3px;
    transition: width 0.3s;
}

.kunde-value {
    font-size: 12px;
    color: #e0e0e0;
    font-weight: 600;
    width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.kunde-pct {
    font-size: 11px;
    color: #556;
    width: 38px;
    text-align: right;
    flex-shrink: 0;
}

/* --- Posten rows ------------------------------------------- */
.posten-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #1a2540;
    font-size: 12px;
}

.posten-row:last-child { border-bottom: none; }

.posten-label { color: #c0c8d8; }
.posten-value { color: #e0e0e0; font-weight: 600; }
.posten-value.negative { color: #e74c3c; }
.posten-value.positive { color: #2ecc71; }

/* --- Bericht cards ----------------------------------------- */
.bericht-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.bericht-card {
    background: #111827;
    border: 1px solid #1a2540;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.bericht-card:hover {
    border-color: #c9a961;
    transform: translateY(-2px);
}

.bericht-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.bericht-title {
    font-size: 13px;
    font-weight: 600;
    color: #c0c8d8;
    margin-bottom: 4px;
}

.bericht-desc {
    font-size: 11px;
    color: #556;
}

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:hover   { opacity: 0.88; }
.btn:active  { transform: scale(0.97); }

.btn-primary {
    background: #c9a961;
    color: #0c1220;
}

.btn-secondary {
    background: #1a2540;
    color: #c0c8d8;
    border: 1px solid #2a3560;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* --- Forms ------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #778;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: #0c1220;
    border: 1px solid #1a2540;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: #c9a961;
}

.form-input::placeholder {
    color: #445;
}

/* --- Page Header ------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #e0e0e0;
}

.page-subtitle {
    font-size: 12px;
    color: #556;
    margin-top: 2px;
}

/* --- Tables ----------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th {
    padding: 8px 12px;
    text-align: left;
    color: #556;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1a2540;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #111827;
    color: #c0c8d8;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(26,37,64,0.4);
}

/* --- Badges ----------------------------------------------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green  { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-yellow { background: rgba(243,156,18,0.15);  color: #f39c12; }
.badge-red    { background: rgba(231,76,60,0.15);   color: #e74c3c; }
.badge-blue   { background: rgba(52,152,219,0.15);  color: #3498db; }
.badge-gray   { background: rgba(100,100,120,0.2);  color: #778; }

/* --- Scrollbar -------------------------------------------- */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0f1a; }
::-webkit-scrollbar-thumb { background: #1a2540; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a3560; }

/* --- Login Page -------------------------------------------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0c1220;
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 24px;
}

.login-card {
    background: #111827;
    border: 1px solid #1a2540;
    border-radius: 12px;
    padding: 36px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    font-size: 22px;
    font-weight: 700;
    color: #c9a961;
    letter-spacing: 1px;
}

.login-subtitle {
    font-size: 10px;
    color: #556;
    letter-spacing: 4px;
    margin-top: 4px;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 900px) {
    .ampel-row   { grid-template-columns: repeat(2, 1fr); }
    .bericht-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .sidebar {
        width: 60px;
    }
    .logo-mark, .logo-sub, .nav-label, .user-info, .logout-btn {
        display: none;
    }
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    .ampel-row   { grid-template-columns: 1fr 1fr; }
    .grid-2      { grid-template-columns: 1fr; }
    .bericht-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Reports — Berichts-Seiten
   ============================================================ */

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.report-card {
    background: #111827;
    border: 1px solid #1a2540;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .2s;
}

.report-card:hover { border-color: #c9a84c; }
.report-card-icon { font-size: 2rem; }
.report-card-title { font-weight: 700; font-size: 1rem; color: #f0f0f0; }
.report-card-desc { font-size: 0.8rem; color: #888; flex: 1; }

/* Report-Aktionsleiste */
.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.email-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap;
}

.email-form.hidden { display: none; }

.status-text { font-size: 0.85rem; }
.status-ok    { color: #16a34a; }
.status-error { color: #dc2626; }

/* Tabellen für Reports */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 8px;
}

.data-table thead th {
    background: #0a0f1a;
    color: #c9a84c;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #1a2540;
}

.data-table thead th.text-right { text-align: right; }

.data-table tbody tr { border-bottom: 1px solid #1a2540; }
.data-table tbody tr:hover { background: rgba(201, 168, 76, 0.05); }
.data-table tbody td { padding: 7px 12px; }
.data-table tbody td.text-right { text-align: right; }

.data-table tfoot td {
    padding: 8px 12px;
    border-top: 2px solid #1a2540;
}
.data-table tfoot td.text-right { text-align: right; }
.total-row td { font-weight: 700; }

.top5-row { background: rgba(201, 168, 76, 0.07) !important; }

/* Mini-Balken */
.mini-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
}
.mini-bar-fill {
    height: 8px;
    background: #c9a84c;
    border-radius: 3px;
    min-width: 3px;
    transition: width .3s;
}
.mini-bar span { font-size: 0.75rem; color: #888; white-space: nowrap; }

/* SWOT */
.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.swot-cell {
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #1a2540;
}

.swot-cell h3 { font-size: 0.85rem; margin-bottom: 6px; }
.swot-cell ul { padding-left: 16px; font-size: 0.8rem; color: #ccc; }
.swot-cell li { margin-bottom: 4px; }

.swot-strengths     { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.3); }
.swot-strengths h3  { color: #4ade80; }
.swot-weaknesses    { background: rgba(234, 88, 12, 0.08); border-color: rgba(234, 88, 12, 0.3); }
.swot-weaknesses h3 { color: #fb923c; }
.swot-opportunities { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.3); }
.swot-opportunities h3 { color: #60a5fa; }
.swot-threats       { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); }
.swot-threats h3    { color: #f87171; }

/* Empfehlungen */
.recommendations-list { display: flex; flex-direction: column; gap: 8px; }
.recommendation {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 4px solid #555;
    background: #111827;
}
.priority-hoch   { border-left-color: #dc2626; }
.priority-mittel { border-left-color: #d97706; }
.priority-info   { border-left-color: #2563eb; }
.rec-priority {
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 44px;
    padding-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.priority-hoch   .rec-priority { color: #f87171; }
.priority-mittel .rec-priority { color: #fbbf24; }
.priority-info   .rec-priority { color: #60a5fa; }
.rec-content strong { font-size: 0.9rem; color: #f0f0f0; }
.rec-content p      { font-size: 0.8rem; color: #888; margin-top: 3px; }

/* KPI-Karten groß */
.kpi-card-large { padding: 16px 18px; }
.kpi-value-xl   { font-size: 1.6rem; }

/* Abschnitte */
.section-note { font-size: 0.75rem; color: #666; margin-top: 6px; }
.empty-state  { color: #555; font-style: italic; padding: 12px 0; }

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-paid       { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
.badge-open       { background: rgba(201, 168, 76, 0.2); color: #c9a84c; }
.badge-overdue    { background: rgba(220, 38, 38, 0.2); color: #f87171; }
.badge-cancelled  { background: rgba(100, 100, 100, 0.2); color: #888; }

/* ============================================================
   Kunden-Modul — Erweiterungen
   ============================================================ */

/* Klickbare Tabellenzeile */
.clickable-row {
    cursor: pointer;
    transition: background 0.12s;
}
.clickable-row:hover td {
    background: rgba(201, 162, 39, 0.07) !important;
}

/* Checkbox-Label in Filterleiste */
.filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #778;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.filter-check input[type="checkbox"] {
    accent-color: #c9a961;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    margin-top: 8px;
    border-top: 1px solid #1a2540;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination-info {
    font-size: 11px;
    color: #556;
}
.pagination-btn {
    background: #1a2540;
    border: 1px solid #2a3560;
    color: #c0c8d8;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.pagination-btn:hover {
    background: #2a3560;
    border-color: #c9a961;
}
.pagination-btn.active {
    background: #c9a961;
    border-color: #c9a961;
    color: #0c1220;
    font-weight: 700;
}

/* Sortierbare Spalten-Header */
.sortable {
    cursor: pointer;
}

.sortable:hover {
    color: #c9a961;
}

.sort-hint {
    font-size: 10px;
    color: #556;
    margin-left: 2px;
}

.sortable:hover .sort-hint {
    color: #c9a961;
}

.sort-active {
    font-size: 10px;
    color: #c9a961;
    margin-left: 2px;
}

/* Trend-Karten (Dossier rechte Spalte) */
.trend-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.trend-card {
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 4px solid #2a3560;
    background: #111827;
    border: 1px solid #1a2540;
    border-left-width: 4px;
}
.trend-green  { border-left-color: #2ecc71 !important; }
.trend-yellow { border-left-color: #f39c12 !important; }
.trend-red    { border-left-color: #e74c3c !important; }

.trend-label {
    font-size: 10px;
    font-weight: 600;
    color: #556;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}
.trend-value {
    font-size: 15px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 2px;
}
.trend-detail {
    font-size: 11px;
    color: #778;
}

/* Formular: Zweispaltige Zeile */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Generisches Input / Select / Textarea (Kunden-Edit) */
.input {
    width: 100%;
    padding: 10px 12px;
    background: #0c1220;
    border: 1px solid #1a2540;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}
.input:focus {
    border-color: #c9a961;
}
.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
textarea.input {
    resize: vertical;
    min-height: 80px;
}
select.input {
    appearance: auto;
}

/* Karte mit Alarm-Rahmen (offene Posten) */
.card-alert {
    border-color: rgba(231, 76, 60, 0.5) !important;
}

/* Badge Gold (Priorität A) */
.badge-gold {
    background: rgba(201, 162, 39, 0.2);
    color: #c9a961;
}

/* ============================================================
   Refactoring-Klassen (Audit 2026-05-19)
   Ersetzen wiederholte Inline-Styles
   ============================================================ */

/* Kunden-Kachel (kunden/liste.html — ersetzt JS onmouseover/onmouseout) */
.kunde-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s, border-color 0.2s;
    min-height: 64px;
}
.kunde-tile:hover {
    background: rgba(201,169,97,0.08);
    border-color: rgba(201,169,97,0.3);
}

/* Gold Section-Heading (personal, kunden detail) */
.section-gold {
    color: #c9a961;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Initialen-Avatar (Kunden-Kacheln, Personal) */
.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-circle-sm {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(201,169,97,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c9a961;
    flex-shrink: 0;
    position: relative;
}

/* Segment-Dot (auf Avatar) */
.segment-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    border: 1.5px solid var(--card-bg, #1a1d2e);
}

/* Onboarding Form-Input (transparenter Dark-Mode-Input) */
.form-dark {
    padding: 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    width: 100%;
}

/* Form-Label muted */
.label-muted {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85em;
    opacity: 0.7;
}

/* Modal-Input (Wage-Edit, dunklerer Hintergrund) */
.form-modal {
    width: 100%;
    padding: 0.6rem;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
}

/* KPI Stat Card (Mitarbeiter-Detail) */
.stat-card {
    padding: 1.2rem;
    text-align: center;
}
.stat-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}
.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
}
.stat-card-detail {
    font-size: 0.75rem;
    opacity: 0.4;
}

/* Muted text helper */
.text-muted-sm {
    color: #556;
    font-size: 12px;
    padding: 12px 0;
}

/* Content header (back-button Zeile) */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Color utilities */
.text-success { color: #27ae60; }
.text-danger  { color: #e74c3c; }
.text-warning { color: #f39c12; }
.text-gold    { color: #c9a961; }

/* ── Dashboard-Redesign 2026-06: Prognose-Kacheln + Heute wichtig ── */
.prognose-card {
    border: 1px dashed #4a527a;
    background: rgba(26, 32, 54, 0.55);
}
.prognose-value {
    font-style: italic;
    color: #bdc7dd;
}
.kpi-warning {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(244, 177, 70, 0.12);
    border: 1px solid rgba(244, 177, 70, 0.4);
    color: #f4b146;
    font-size: 11px;
    font-weight: 600;
}
.wichtig-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(26, 37, 64, 0.6);
    font-size: 12.5px;
    color: inherit;
    text-decoration: none;
}
.wichtig-row:last-of-type { border-bottom: none; }
.wichtig-row:hover .wichtig-text { color: #c9a961; }
.wichtig-text { line-height: 1.45; }
