/*
 * Kundenspezifisches Theme. Farben angelehnt an www.dsv.de.
 * Für einen anderen Kunden genügt es, die Variablen im :root-Block anzupassen.
 */
:root {
    --portal-primary: #2a89cf;
    --portal-primary-dark: #216da5;
    --portal-primary-light: #92c5eb;
    --portal-primary-subtle: #deedf9;
    --portal-text: #303030;
    --portal-text-muted: #606060;
    --portal-border: #dedede;
    --portal-surface: #ffffff;
    --portal-background: #f5f5f5;
    --portal-radius: 0.5rem;
    --portal-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

    /* Kendo-Theme auf die Kundenfarben abbilden */
    --kendo-color-primary: var(--portal-primary);
    --kendo-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Bootstrap ebenfalls */
    --bs-primary: var(--portal-primary);
    --bs-primary-rgb: 42, 137, 207;
    --bs-link-color: var(--portal-primary-dark);
    --bs-link-color-rgb: 33, 109, 165;
    --bs-link-hover-color: var(--portal-primary);
    --bs-body-font-family: var(--kendo-font-family);
    --bs-body-color: var(--portal-text);
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--portal-background);
    color: var(--portal-text);
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--portal-surface);
}

/* Kopfbereich */
.portal-header {
    background: linear-gradient(90deg, var(--portal-primary-dark), var(--portal-primary));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.portal-header .navbar {
    padding: 0.75rem 1rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Weißes Logo auf dem blauen Kopf; Datei in doppelter Auflösung für scharfe Darstellung. */
.portal-logo {
    height: 48px;
    width: auto;
}

@media (max-width: 575.98px) {
    .portal-logo {
        height: 38px;
    }
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.portal-brand-title {
    font-weight: 600;
    font-size: 1.15rem;
}

.portal-brand-org {
    font-size: 0.8rem;
    opacity: 0.85;
}

.portal-header .nav-link {
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
    border-radius: var(--portal-radius);
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.portal-header .nav-link:hover,
.portal-header .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.portal-header .nav-link.disabled {
    color: rgba(255, 255, 255, 0.5);
}

.portal-user {
    color: #fff;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Inhalt */
.portal-main {
    flex: 1 0 auto;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.portal-page-head {
    margin-bottom: 2rem;
}

.portal-page-head h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--portal-primary-dark);
}

.portal-tile {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    border-top: 4px solid var(--portal-primary);
    box-shadow: var(--portal-shadow);
}

.portal-tile h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}

.portal-tile p {
    color: var(--portal-text-muted);
    flex-grow: 1;
}

/* Anmeldung */
.portal-auth {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.portal-auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    border-top: 4px solid var(--portal-primary);
    box-shadow: var(--portal-shadow);
}

.portal-auth-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--portal-primary-dark);
}

.portal-auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

/* Meldungs- und Fehlerseiten */
.portal-message {
    max-width: 560px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.portal-message-code {
    font-size: 3rem;
    font-weight: 700;
    color: var(--portal-primary-light);
    margin: 0;
}

.portal-message h1 {
    font-size: 1.5rem;
    color: var(--portal-primary-dark);
}

/* Fußbereich */
.portal-footer {
    flex-shrink: 0;
    padding: 1rem 0;
    font-size: 0.85rem;
    color: var(--portal-text-muted);
    background: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
}

.portal-footer a {
    color: var(--portal-text-muted);
    text-decoration: none;
}

.portal-footer a:hover {
    color: var(--portal-primary);
}

/* Validierungsmeldungen von Bootstrap/jQuery Validate */
.input-validation-error,
.k-input.k-invalid {
    border-color: var(--bs-danger) !important;
}

.validation-summary-valid {
    display: none;
}

/* Inhaltskarten für Listen und Formulare */
.portal-card {
    padding: 1.5rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.portal-form {
    max-width: 760px;
}

.portal-auth-card-wide {
    max-width: 720px;
}

.portal-message-erfolg {
    border-top: 4px solid var(--bs-success);
}

.portal-message-fehler {
    border-top: 4px solid var(--bs-danger);
}

/* Benutzermenü in der Kopfzeile */
.portal-header .portal-user {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.portal-header .portal-user:hover,
.portal-header .portal-user:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.k-grid .k-button + .k-button {
    margin-left: 0.25rem;
}

.portal-form-wide {
    max-width: 960px;
}

.portal-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--portal-primary-dark);
    margin-bottom: 1rem;
}

/* Abrechnung */
.portal-summe {
    text-align: right;
    padding: 0.75rem 1.25rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    border-left: 4px solid var(--portal-primary);
    box-shadow: var(--portal-shadow);
}

.portal-summe-betrag {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--portal-primary-dark);
}

.portal-neue-position {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--portal-primary-subtle);
    border-radius: var(--portal-radius);
}

.portal-checkliste li::marker {
    content: "○  ";
    color: var(--bs-warning);
}

.portal-belege li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--portal-border);
}

/* Hinweise der Honorarabrechnung (Versteuerung, Betreuerunterlagen, Zugangsvoraussetzungen) */
.portal-hinweise {
    padding: 0.75rem 1rem;
    background: var(--portal-primary-subtle);
    border-left: 4px solid var(--portal-primary);
    border-radius: var(--portal-radius);
}

/* ---------- Smartphone ---------- */

/* Karte je Abrechnung in „Meine Abrechnungen“ (Handy-Spalte des Grids) */
.portal-listenkarte {
    display: grid;
    gap: 0.15rem;
    padding: 0.25rem 0;
}

/*
 * Tabellen mit der Klasse portal-stapel werden auf schmalen Bildschirmen zu Karten:
 * jede Zeile ein Block, jede Zelle mit ihrer Spaltenbezeichnung aus data-label.
 */
@media (max-width: 575.98px) {
    .portal-card {
        padding: 1rem;
    }

    .portal-page-head h1 {
        font-size: 1.6rem;
    }

    .portal-aktionen {
        width: 100%;
    }

    .portal-aktionen > .k-button {
        flex: 1 1 100%;
    }

    .portal-summe {
        width: 100%;
        text-align: left;
    }

    .k-button-lg {
        width: 100%;
        white-space: normal;
    }

    table.portal-stapel thead {
        display: none;
    }

    table.portal-stapel,
    table.portal-stapel tbody,
    table.portal-stapel tfoot,
    table.portal-stapel tr,
    table.portal-stapel td {
        display: block;
        width: 100%;
    }

    table.portal-stapel tr {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--portal-border);
    }

    table.portal-stapel td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.2rem 0;
        border: 0;
        text-align: right !important;
    }

    table.portal-stapel td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--bs-secondary-color);
    }

    table.portal-stapel td:empty,
    table.portal-stapel td[data-label=""]::before {
        display: none;
    }

    table.portal-stapel tfoot td {
        font-weight: 600;
    }
}

/* Größere Ziele für Finger: Häkchen und kleine Schaltflächen auf Touch-Geräten */
@media (pointer: coarse) {
    .k-checkbox-md {
        width: 1.35rem;
        height: 1.35rem;
    }

    .k-button-sm {
        min-height: 2.5rem;
        padding-inline: 0.85rem;
    }
}
