/* =================================================================
   CRM für Empfehlungsmarketing — zentrales Stylesheet
   Ergänzt Bootstrap 5, keine Bootstrap-Klassen werden überschrieben,
   nur erweitert / thematisiert.
   ================================================================= */

:root {
    --crm-primary: #2f5d8a;
    --crm-primary-dark: #234567;
    --crm-primary-light: #eaf1f8;
    --crm-accent: #20c997;
    --crm-success: #198754;
    --crm-warning: #fd7e14;
    --crm-danger: #dc3545;
    --crm-info: #0dcaf0;

    --crm-text: #1f2933;
    --crm-text-muted: #6b7280;
    --crm-bg: #f4f6f9;
    --crm-surface: #ffffff;
    --crm-border: #e2e8f0;

    --crm-radius: 0.65rem;
    --crm-radius-sm: 0.45rem;
    --crm-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 4px rgba(15, 23, 42, 0.06);
    --crm-shadow-hover: 0 4px 10px rgba(15, 23, 42, 0.08);
}

/* -----------------------------------------------------------------
   Grundlayout
   ----------------------------------------------------------------- */

body.crm-body {
    background-color: var(--crm-bg);
    color: var(--crm-text);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.crm-main {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* -----------------------------------------------------------------
   Navigation
   ----------------------------------------------------------------- */

.crm-navbar {
    background: linear-gradient(135deg, var(--crm-primary) 0%, var(--crm-primary-dark) 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.crm-brand {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #ffffff !important;
}

.crm-brand-icon {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--crm-radius-sm);
    padding: 0.15rem 0.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.crm-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    border-radius: var(--crm-radius-sm);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.crm-navbar .nav-link:hover,
.crm-navbar .nav-link:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.crm-navbar .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.18);
    font-weight: 600;
}

.crm-navbar-user {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------
   Footer
   ----------------------------------------------------------------- */

.crm-footer {
    background-color: var(--crm-surface);
    border-color: var(--crm-border) !important;
}

/* -----------------------------------------------------------------
   Karten-Design
   ----------------------------------------------------------------- */

.card.crm-card {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow);
    transition: box-shadow 0.15s ease-in-out;
}

.card.crm-card:hover {
    box-shadow: var(--crm-shadow-hover);
}

.crm-card .card-header {
    background-color: var(--crm-surface);
    border-bottom: 1px solid var(--crm-border);
    font-weight: 600;
    border-top-left-radius: var(--crm-radius);
    border-top-right-radius: var(--crm-radius);
}

/* Dashboard-Kennzahlen-Kacheln (Vorbereitung für dashboard.php) */
.crm-stat-card {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background-color: var(--crm-surface);
    box-shadow: var(--crm-shadow);
    padding: 1.1rem 1.25rem;
    height: 100%;
}

.crm-stat-card .crm-stat-label {
    color: var(--crm-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.crm-stat-card .crm-stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--crm-primary-dark);
    line-height: 1.2;
}

/* -----------------------------------------------------------------
   Tabellen-Design
   ----------------------------------------------------------------- */

.crm-table-wrapper {
    background-color: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow);
    overflow: hidden;
}

table.crm-table {
    margin-bottom: 0;
}

table.crm-table thead th {
    background-color: var(--crm-primary-light);
    color: var(--crm-primary-dark);
    border-bottom: 1px solid var(--crm-border);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

table.crm-table thead th a {
    color: inherit;
    text-decoration: none;
}

table.crm-table thead th a:hover {
    text-decoration: underline;
}

table.crm-table tbody td {
    vertical-align: middle;
}

table.crm-table tbody tr:hover {
    background-color: var(--crm-primary-light);
}

.crm-table-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--crm-text-muted);
}

/* Status- und Kennzeichen-Badges */
.crm-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.crm-interesse {
    display: inline-flex;
    gap: 2px;
}

.crm-interesse .crm-interesse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--crm-border);
    display: inline-block;
}

.crm-interesse .crm-interesse-dot.is-active {
    background-color: var(--crm-warning);
}

.crm-flag-yes {
    color: var(--crm-success);
    font-weight: 700;
}

.crm-flag-no {
    color: var(--crm-text-muted);
}

/* Aktionsbuttons in Tabellenzeilen */
.crm-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.crm-row-actions form {
    display: inline;
}

/* -----------------------------------------------------------------
   Formular-Design
   ----------------------------------------------------------------- */

.crm-filter-card {
    background-color: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.crm-filter-card .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    margin-bottom: 0.3rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 0.2rem rgba(47, 93, 138, 0.18);
}

.btn-primary {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--crm-primary-dark);
    border-color: var(--crm-primary-dark);
}

.btn-outline-primary {
    color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-outline-primary:hover {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

/* -----------------------------------------------------------------
   Pagination
   ----------------------------------------------------------------- */

.crm-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-top: none;
    border-bottom-left-radius: var(--crm-radius);
    border-bottom-right-radius: var(--crm-radius);
}

.crm-pagination .pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--crm-primary);
}

.page-item.active .page-link {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

/* -----------------------------------------------------------------
   Responsive Anpassungen
   ----------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .crm-navbar-user {
        display: block;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .crm-stat-card .crm-stat-value {
        font-size: 1.5rem;
    }

    table.crm-table thead th,
    table.crm-table tbody td {
        font-size: 0.85rem;
    }

    .crm-row-actions {
        justify-content: flex-start;
    }

    .crm-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .crm-table-wrapper {
        overflow-x: auto;
    }
}
