:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --text: #202328;
    --muted: #737982;
    --border: #e0e3e7;

    --accent: #c72832;
    --accent-dark: #a51d26;
    --accent-soft: #fbeaec;

    --admin: #252930;

    --shadow: 0 10px 30px rgba(20, 25, 30, .08);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-header {
    min-height: 68px;
    padding:
        calc(12px + env(safe-area-inset-top))
        18px
        12px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header__brand {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-header__title {
    font-weight: 750;
    font-size: 16px;
    line-height: 1.2;
}

.app-header__sub {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.header-button {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 0 14px;

    color: var(--text);
    background: var(--surface-soft);

    font-weight: 650;
    cursor: pointer;
}

.app-main {
    width: min(100%, 900px);
    margin: 0 auto;

    padding:
        20px
        16px
        calc(105px + env(safe-area-inset-bottom));
}

.welcome-card,
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.welcome-card {
    padding: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.welcome-card h1 {
    margin: 3px 0 5px;
    font-size: clamp(24px, 6vw, 34px);
    line-height: 1.1;
}

.welcome-card p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    margin: 0;

    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.profile-circle {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    border-radius: 50%;
    background: var(--admin);
    color: #fff;

    font-size: 23px;
    font-weight: 800;
}

.module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;

    margin-top: 18px;
}

.module-card {
    min-height: 112px;
    padding: 18px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.module-card__icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    border-radius: 14px;
    background: var(--surface-soft);

    font-size: 22px;
    font-weight: 800;
}

.module-card__content {
    min-width: 0;
}

.module-card h2 {
    margin: 0;
    font-size: 18px;
}

.module-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.module-card__status {
    align-self: start;

    padding: 6px 9px;
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--muted);

    font-size: 11px;
    font-weight: 750;
}

.module-card--primary {
    border-color: rgba(199, 40, 50, .30);
    box-shadow: 0 8px 24px rgba(199, 40, 50, .08);
}

.module-card--primary .module-card__icon {
    color: #fff;
    background: var(--accent);
}

.module-card--primary .module-card__status {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.module-card--disabled {
    opacity: .64;
}

.module-card--admin {
    color: #fff;
    background: var(--admin);
    border-color: var(--admin);
}

.module-card--admin p {
    color: #c9ccd1;
}

.module-card--admin .module-card__icon,
.module-card--admin .module-card__status {
    color: #fff;
    background: rgba(255,255,255,.10);
}

.info-card {
    margin-top: 18px;
    padding: 18px;
}

.info-card p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;

    width: min(100%, 900px);
    transform: translateX(-50%);

    padding:
        8px
        16px
        calc(8px + env(safe-area-inset-bottom));

    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--border);

    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.bottom-nav__item {
    min-height: 52px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 2px;

    color: var(--muted);
    text-decoration: none;

    font-size: 11px;
    font-weight: 650;
}

.bottom-nav__item--active {
    color: var(--accent);
}

.bottom-nav__item--disabled {
    opacity: .45;
}

.bottom-nav__icon {
    font-size: 20px;
    line-height: 1;
}

/* LOGIN */

.login-body {
    min-height: 100vh;

    background:
        radial-gradient(circle at top left, rgba(199,40,50,.10), transparent 36%),
        var(--bg);
}

.login-page {
    min-height: 100vh;

    padding:
        calc(28px + env(safe-area-inset-top))
        18px
        calc(24px + env(safe-area-inset-bottom));

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(100%, 430px);

    padding: 28px 24px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.login-brand h1 {
    margin: 7px 0 8px;

    font-size: 28px;
    line-height: 1.12;
}

.login-intro {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.login-form {
    margin-top: 26px;
}

.field {
    margin-bottom: 17px;
}

.field label {
    display: block;
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 54px;

    padding: 0 15px;

    color: var(--text);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;

    outline: none;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(199,40,50,.12);
}

.remember {
    min-height: 44px;

    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--muted);
    font-size: 14px;
}

.remember input {
    width: 20px;
    height: 20px;
}

.primary-button {
    width: 100%;
    min-height: 56px;

    margin-top: 12px;

    border: 0;
    border-radius: 15px;

    color: #fff;
    background: var(--accent);

    font-weight: 800;
    cursor: pointer;
}

.primary-button:active {
    background: var(--accent-dark);
}

.alert {
    margin-top: 20px;
    padding: 13px 14px;

    border-radius: 13px;

    background: var(--surface-soft);
    font-size: 14px;
    line-height: 1.4;
}

.alert--error {
    color: #8a1820;
    background: var(--accent-soft);
}

.login-help {
    margin: 22px 0 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.login-footer {
    margin-top: 18px;

    color: var(--muted);
    font-size: 12px;
}

/* DESKTOP */

@media (min-width: 720px) {
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* DARK MODE */

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111316;
        --surface: #1a1d21;
        --surface-soft: #22262b;
        --text: #f3f4f6;
        --muted: #a1a6ae;
        --border: #2d3238;
        --admin: #070809;

        --shadow: 0 10px 30px rgba(0,0,0,.22);
    }

    .bottom-nav {
        background: rgba(26,29,33,.96);
    }

    .alert--error {
        color: #ffb8bd;
        background: #3a1d23;
    }
}


/* =========================================================
   BRANDING + KOMPAKTER HEADER
   ========================================================= */

.app-header__identity {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header__logo {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    padding: 3px;

    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;

    display: grid;
    place-items: center;

    overflow: hidden;
}

.app-header__logo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.header-icon-button {
    width: 44px;
    height: 44px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 13px;

    color: var(--text);
    background: var(--surface-soft);

    cursor: pointer;
}

.header-icon-button:active {
    transform: scale(.96);
}


/* =========================================================
   LOGIN BRANDING
   ========================================================= */

.login-logo {
    width: 100%;

    margin-bottom: 24px;
    padding: 14px 18px;

    background: #fff;
    border-radius: 16px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo img {
    display: block;

    width: min(100%, 245px);
    height: auto;
}


/* =========================================================
   SVG ICONS
   ========================================================= */

.module-card__icon svg,
.bottom-nav svg,
.header-icon-button svg {
    display: block;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .app-header {
        min-height: 58px;

        padding:
            calc(7px + env(safe-area-inset-top))
            12px
            7px;
    }

    .app-header__identity {
        gap: 8px;
    }

    .app-header__logo {
        flex-basis: 34px;

        width: 34px;
        height: 34px;

        border-radius: 9px;
    }

    .app-header__title {
        font-size: 14px;
    }

    .app-header__sub {
        font-size: 10px;
    }

    .header-icon-button {
        width: 40px;
        height: 40px;

        border-radius: 11px;
    }

    .app-main {
        padding-top: 14px;
    }

}


/* =========================================================
   SEHR KLEINE HANDYS
   ========================================================= */

@media (max-width: 380px) {

    .app-header__title {
        font-size: 13px;
    }

    .app-header__sub {
        display: none;
    }

}


/* =========================================================
   PROFIL
   ========================================================= */

.page-heading {
    margin-bottom: 16px;
}

.page-heading h1 {
    margin: 4px 0 5px;
    font-size: clamp(26px, 7vw, 36px);
}

.page-heading > div > p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.success-card {
    margin-bottom: 14px;
    padding: 14px 16px;

    border: 1px solid #94d4ad;
    border-radius: 15px;

    color: #176536;
    background: #eaf8ef;

    font-weight: 650;
}

.profile-error {
    margin: 0 0 14px;
}

.profile-form {
    display: grid;
    gap: 14px;
}

.profile-photo-card,
.form-card,
.account-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.profile-photo-card {
    padding: 18px;

    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-photo-preview {
    flex: 0 0 82px;

    width: 82px;
    height: 82px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 50%;

    color: #fff;
    background: var(--admin);

    font-size: 30px;
    font-weight: 800;
}

.profile-photo-preview img,
.profile-circle img {
    width: 100%;
    height: 100%;

    display: block;
    object-fit: cover;
}

.profile-photo-text {
    min-width: 0;
}

.profile-photo-text h2,
.form-card h2,
.account-card h2 {
    margin: 0;
    font-size: 18px;
}

.profile-photo-text p,
.account-card p {
    margin: 5px 0 12px;
    color: var(--muted);
    line-height: 1.4;
}

.profile-photo-button {
    position: relative;
    overflow: hidden;
}

.profile-photo-button input {
    position: absolute;
    inset: 0;

    opacity: 0;
    cursor: pointer;
}

.form-card {
    padding: 18px;
}

.form-card h2 {
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 16px;
}

.field select {
    width: 100%;
    min-height: 54px;

    padding: 0 15px;

    color: var(--text);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;

    outline: none;
}

.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(199,40,50,.12);
}

.field input:disabled {
    opacity: .65;
}

.field small {
    display: block;

    margin-top: 6px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.input-suffix {
    position: relative;
}

.input-suffix input {
    padding-right: 52px;
}

.input-suffix span {
    position: absolute;
    right: 15px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--muted);
    font-size: 14px;
}

.secondary-button {
    min-height: 44px;

    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 1px solid var(--border);
    border-radius: 13px;

    color: var(--text);
    background: var(--surface-soft);

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.profile-save {
    margin: 0;
}

.account-card {
    margin-top: 14px;
    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.account-card p {
    margin-bottom: 0;
}

.logout-profile {
    white-space: nowrap;
}

.profile-circle {
    overflow: hidden;
    text-decoration: none;
}

@media (min-width: 720px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .account-card {
        align-items: stretch;
        flex-direction: column;
    }

    .logout-profile {
        width: 100%;
    }
}

@media (prefers-color-scheme: dark) {
    .success-card {
        color: #9de5b5;
        background: #163322;
        border-color: #295c3b;
    }
}


/* =========================================================
   MOBILE SELECTS
   Einheitliche Darstellung statt iOS-Native-Spinner
   ========================================================= */

.field select {
    -webkit-appearance: none;
    appearance: none;

    min-height: 54px;

    padding:
        0
        48px
        0
        15px;

    background-color: var(--surface-soft);

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23737982' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position:
        right 15px
        center;

    background-size: 20px 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    color: var(--text);

    font-size: 16px;
    line-height: 1;

    cursor: pointer;
}

.field select::-ms-expand {
    display: none;
}

.field select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px
        rgba(199, 40, 50, .12);
}


/* iPhone: genügend Platz über der festen Bottom-Navigation */

@media (max-width: 600px) {

    .profile-form {
        padding-bottom: 18px;
    }

    .account-card {
        margin-bottom: 24px;
    }

}


/* =========================================================
   ADMIN
   ========================================================= */

.module-card--link {
    text-decoration: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.admin-card {
    min-height: 96px;
    padding: 18px;

    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid rgba(199, 40, 50, .30);
    border-radius: var(--radius);

    box-shadow: 0 8px 24px rgba(199, 40, 50, .08);

    text-decoration: none;
}

.admin-card h2 {
    margin: 0;
    font-size: 18px;
}

.admin-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.admin-card strong {
    font-size: 28px;
}

.admin-card--disabled {
    opacity: .5;
}

.route-admin-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.route-admin-card {
    padding: 18px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.route-admin-card--inactive {
    opacity: .55;
}

.route-edit-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 14px;
}

.route-admin-actions {
    margin-top: 12px;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.icon-action {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 13px;

    color: var(--text);
    background: var(--surface-soft);

    font-size: 20px;
    font-weight: 800;

    cursor: pointer;
}

@media (min-width: 720px) {

    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .route-edit-form {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }

    .route-edit-form .secondary-button {
        margin-bottom: 17px;
    }

}


/* =========================================================
   MODULBERECHTIGUNGEN
   ========================================================= */

.user-permissions {
    margin-top: 18px;
    padding-top: 18px;

    border-top: 1px solid var(--border);
}

.user-permissions__heading {
    display: grid;
    gap: 4px;
}

.user-permissions__heading strong {
    font-size: 16px;
}

.user-permissions__heading small {
    color: var(--muted);
    line-height: 1.45;
}

.user-permissions__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;

    margin-top: 12px;
}

@media (min-width: 720px) {
    .user-permissions__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   ADMIN BENUTZER / KOLONNEN
   ========================================================= */

.user-admin-list,
.crew-admin-list {
    display: grid;
    gap: 12px;

    margin-top: 16px;
}

.user-admin-card,
.crew-admin-card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.user-admin-card {
    overflow: hidden;
}

.user-admin-card > summary {
    min-height: 82px;

    padding: 14px 16px;

    display: grid;
    grid-template-columns:
        48px
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 12px;

    cursor: pointer;

    list-style: none;
}

.user-admin-card > summary::-webkit-details-marker {
    display: none;
}

.user-admin-avatar {
    width: 48px;
    height: 48px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    color: #fff;
    background: var(--admin);

    font-weight: 800;
}

.user-admin-summary {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.user-admin-summary strong {
    font-size: 16px;
}

.user-admin-summary span {
    margin-top: 3px;

    color: var(--muted);

    font-size: 13px;
}

.details-chevron {
    color: var(--muted);

    font-size: 28px;

    transition: transform .2s ease;
}

.user-admin-card[open] .details-chevron {
    transform: rotate(90deg);
}

.user-admin-form {
    padding: 18px;

    border-top: 1px solid var(--border);
}

.check-card {
    min-height: 72px;

    padding: 12px 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;

    cursor: pointer;
}

.check-card input {
    flex: 0 0 22px;

    width: 22px;
    height: 22px;
}

.check-card span {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.check-card strong {
    font-size: 14px;
}

.check-card small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.3;
}

.crew-admin-card {
    padding: 16px;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: end;
    gap: 12px;
}

.crew-admin-card .field {
    margin-bottom: 0;
}

@media (max-width: 560px) {

    .crew-admin-card {
        grid-template-columns: 1fr;
    }

    .crew-admin-card .secondary-button {
        width: 100%;
    }

}


/* =========================================================
   DYNAMISCHE KOLONNENVERWALTUNG
   ========================================================= */

.crew-manage-card {
    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.crew-manage-card--inactive {
    opacity: .55;
}

.crew-main-form {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: end;
    gap: 12px;
}

.crew-main-form .field {
    margin-bottom: 0;
}

.crew-actions {
    margin-top: 12px;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 560px) {

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

    .crew-main-form .secondary-button {
        width: 100%;
    }

}

.admin-create-details {
    margin-top: 18px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.admin-create-details > summary {
    min-height: 58px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    cursor: pointer;
    list-style: none;

    font-weight: 750;
}

.admin-create-details > summary::-webkit-details-marker {
    display: none;
}

.admin-create-details[open] .details-chevron {
    transform: rotate(90deg);
}

.admin-create-details__content {
    padding: 18px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   ZURÜCK-NAVIGATION
   Auf allen Unterseiten, nicht auf dem Dashboard
   ========================================================= */

.header-back-button {
    flex: 0 0 40px;

    width: 40px;
    height: 40px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 11px;

    color: var(--text);
    background: var(--surface-soft);

    cursor: pointer;
}

.header-back-button:active {
    transform: scale(.95);
}

@media (max-width: 600px) {

    .header-back-button {
        flex-basis: 36px;

        width: 36px;
        height: 36px;

        border-radius: 10px;
    }

}


/* =========================================================
   BENUTZER-EINLADUNGEN
   ========================================================= */

.invitation-link-card {
    margin-bottom: 16px;
    padding: 18px;

    background: var(--surface);

    border: 1px solid rgba(199, 40, 50, .32);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.invitation-link-card p {
    margin: 4px 0 14px;

    color: var(--muted);
    font-size: 13px;
}

.invitation-copy-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 8px;
}

.invitation-copy-row input {
    min-width: 0;
    min-height: 44px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);
    background: var(--surface-soft);
}

.user-invitation-actions {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 10px;
}

.status-pill {
    padding: 7px 10px;

    border-radius: 999px;

    color: var(--muted);
    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 750;
}

.status-pill--ok {
    color: #176536;
    background: #eaf8ef;
}

@media (max-width: 560px) {

    .invitation-copy-row {
        grid-template-columns: 1fr;
    }

    .invitation-copy-row .secondary-button {
        width: 100%;
    }

    .user-invitation-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .user-invitation-actions form,
    .user-invitation-actions .secondary-button {
        width: 100%;
    }

}

@media (prefers-color-scheme: dark) {

    .status-pill--ok {
        color: #9de5b5;
        background: #163322;
    }

}

.invitation-link-card {
    margin-bottom: 16px;
    padding: 18px;

    background: var(--surface);

    border: 1px solid rgba(199, 40, 50, .32);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.invitation-link-card p {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.invitation-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.invitation-copy-row input {
    min-width: 0;
    min-height: 44px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);
    background: var(--surface-soft);
}

.user-invitation-actions {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 10px;
}

.status-pill {
    padding: 7px 10px;

    border-radius: 999px;

    color: var(--muted);
    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 750;
}

.status-pill--ok {
    color: #176536;
    background: #eaf8ef;
}

@media (max-width: 560px) {

    .invitation-copy-row {
        grid-template-columns: 1fr;
    }

    .invitation-copy-row .secondary-button,
    .user-invitation-actions form,
    .user-invitation-actions .secondary-button {
        width: 100%;
    }

    .user-invitation-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-color-scheme: dark) {

    .status-pill--ok {
        color: #9de5b5;
        background: #163322;
    }
}


/* =========================================================
   DEVBASIS FEHLERSEITEN
   ========================================================= */

.error-page-body {
    min-height: 100dvh;
    margin: 0;

    background: var(--background);
    color: var(--text);
}

.error-page {
    min-height: 100dvh;

    padding:
        max(24px, env(safe-area-inset-top))
        18px
        max(24px, env(safe-area-inset-bottom));

    display: grid;
    place-items: center;
}

.error-card {
    width: min(100%, 440px);

    padding: 28px 22px;

    text-align: center;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 22px;

    box-shadow: var(--shadow);
}

.error-logo {
    margin-bottom: 22px;
}

.error-logo img {
    display: block;

    width: min(190px, 70%);
    height: auto;

    margin: 0 auto;
}

.error-code {
    margin-bottom: 4px;

    color: var(--accent);
    font-size: 46px;
    font-weight: 850;
    line-height: 1;
}

.error-card h1 {
    margin: 8px 0 10px;

    font-size: clamp(24px, 6vw, 30px);
}

.error-card p {
    margin: 0 auto;

    max-width: 340px;

    color: var(--muted);
    line-height: 1.55;
}

.error-actions {
    margin-top: 24px;
}

.error-button {
    width: 100%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;
}

/* Login-Titel zweizeilig und zentriert */
.login-brand {
    text-align: center;
}

.login-brand h1 {
    margin-bottom: 8px;
}

.login-intro {
    margin-top: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}


/* =========================================================
   ADMIN EINSTELLUNGEN
   ========================================================= */

.settings-section + .settings-section {
    margin-top: 22px;
}

.settings-section__heading {
    margin-bottom: 18px;
}

.settings-section__heading h2 {
    margin: 0 0 5px;
}

.settings-section__heading p {
    margin: 0;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.settings-divider {
    height: 1px;

    margin: 24px 0;

    background: var(--border);
}

.settings-number-field {
    display: grid;
    grid-template-columns: minmax(0, 130px) auto;

    align-items: center;
    gap: 10px;
}

.settings-number-field span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.settings-security-note {
    margin-top: 16px;
    padding: 16px 18px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.settings-security-note strong {
    display: block;

    margin-bottom: 5px;
}

.settings-security-note p {
    margin: 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}


@media (max-width: 560px) {

    .settings-number-field {
        grid-template-columns: minmax(0, 110px) auto;
    }

}




.header-back-button {
    text-decoration: none;
}


/* =========================================================
   PASSWORT RESET
   ========================================================= */

.login-secondary-action {
    margin-top: 14px;

    text-align: center;
}

.login-secondary-action a {
    color: var(--muted);

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
}

.login-secondary-action a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* =========================================================
   FLASH-MELDUNGEN
   ========================================================= */

.success-card {
    transition:
        opacity .35s ease,
        transform .35s ease;
}

.success-card.flash-message--hide {
    opacity: 0;
    transform: translateY(-6px);
}

/* Benutzer-Zugangsstatus sauber ausrichten */

.user-invitation-actions {
    min-height: 48px;
    margin-top: 14px;
    padding-top: 14px;

    align-items: center;
}

.status-pill {
    min-height: 36px;
    padding: 0 12px;

    display: inline-flex;
    align-items: center;

    line-height: 1;
}

.user-invitation-actions .secondary-button {
    min-height: 40px;
    padding: 0 16px;
}

@media (max-width: 560px) {

    .user-invitation-actions {
        gap: 10px;
    }

    .status-pill {
        width: fit-content;
    }
}

/* Zugangsbereich in Benutzerkarte sauber umschließen */

.user-invitation-actions {
    min-height: 64px;
    margin-top: 16px;
    padding: 16px 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    box-sizing: border-box;
}

.user-invitation-actions form {
    margin: 0;
    flex: 0 0 auto;
}

.user-invitation-actions .secondary-button {
    min-height: 44px;
    margin: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
}

@media (max-width: 560px) {

    .user-invitation-actions {
        padding-bottom: 16px;
    }

    .user-invitation-actions form,
    .user-invitation-actions .secondary-button {
        width: 100%;
    }
}

/* =========================================================
   PWA INSTALL-HINWEIS
   ========================================================= */

.pwa-install-hint {
    position: fixed;
    z-index: 5000;

    left: 0;
    right: 0;
    bottom: 0;

    padding:
        16px
        16px
        max(16px, env(safe-area-inset-bottom));

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, .32),
            rgba(0, 0, 0, 0)
        );

    pointer-events: none;
}

.pwa-install-hint__card {
    width: min(100%, 520px);
    margin: 0 auto;

    padding: 16px;

    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 36px;
    gap: 12px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, .28);

    pointer-events: auto;
}

.pwa-install-hint__icon {
    width: 52px;
    height: 52px;

    overflow: hidden;

    border-radius: 13px;
}

.pwa-install-hint__icon img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.pwa-install-hint__content {
    min-width: 0;
}

.pwa-install-hint__content strong {
    display: block;

    margin-top: 2px;

    font-size: 15px;
    line-height: 1.3;
}

.pwa-install-hint__content p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.45;
}

.pwa-install-hint__close {
    width: 36px;
    height: 36px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 10px;

    color: var(--muted);
    background: var(--surface-soft);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.pwa-install-hint__actions {
    grid-column: 2 / 4;

    display: flex;
    gap: 8px;
}

.pwa-install-hint__actions .primary-button,
.pwa-install-hint__actions .secondary-button {
    min-height: 42px;
    margin: 0;
}

@media (max-width: 480px) {

    .pwa-install-hint__actions {
        grid-column: 1 / 4;
    }

    .pwa-install-hint__actions button {
        flex: 1;
    }
}

/* Installationshinweis kompakter */
.pwa-install-hint__content p {
    max-width: 100%;
}

.pwa-install-hint__content p strong {
    display: block;
    margin-top: 5px;
    line-height: 1.5;
}

@media (max-width: 420px) {
    .pwa-install-hint__card {
        grid-template-columns: 48px minmax(0, 1fr) 36px;
    }

    .pwa-install-hint__icon {
        width: 48px;
        height: 48px;
    }
}

/* =========================================================
   PROFIL E-MAIL ÄNDERN
   ========================================================= */

.profile-email-change {
    margin-top: 16px;
}

.profile-email-change__info {
    margin: 0 0 18px;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.profile-email-change__info strong {
    color: var(--text);
}

.profile-email-change .status-pill {
    margin-bottom: 16px;

    width: fit-content;

    line-height: 1.35;
}

.field-error {
    color: #c72832 !important;
}


/* =========================================================
   WARTUNGSMODUS
   ========================================================= */

.maintenance-banner {
    margin: 0 0 16px;
    padding: 16px;

    display: flex;
    align-items: center;
    gap: 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.maintenance-banner__icon {
    flex: 0 0 46px;

    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: var(--surface-soft);

    font-size: 25px;
}

.maintenance-banner strong {
    display: block;

    font-size: 15px;
    line-height: 1.35;
}

.maintenance-banner p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.module-card--maintenance {
    opacity: .48;

    pointer-events: none;
    user-select: none;
}

.maintenance-setting {
    margin-top: 4px;
}


/* =========================================================
   STRECKENKENNTNIS
   ========================================================= */

.rk-period-selector {
    margin-bottom: 16px;
    padding: 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.rk-period-selector form {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 12px;
}

.rk-period-selector .field {
    margin: 0;
}


.rk-summary-grid {
    margin-bottom: 16px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.rk-summary-card {
    min-width: 0;
    padding: 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.rk-summary-card span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.rk-summary-card strong {
    display: block;

    font-size: 18px;
    line-height: 1.2;
}


.rk-section-heading {
    margin-bottom: 18px;
}

.rk-section-heading h2 {
    margin: 0 0 5px;
}

.rk-section-heading p {
    margin: 0;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.rk-step {
    display: inline-block;

    margin-bottom: 6px;

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .04em;
}


.rk-initial-card {
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.rk-initial-list {
    margin-bottom: 18px;

    display: grid;
    gap: 10px;
}

.rk-initial-row {
    padding: 14px;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(150px, 190px);

    align-items: end;
    gap: 14px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.rk-initial-row .field {
    margin: 0;
}


.rk-route-name {
    min-width: 0;

    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;

    line-height: 1.35;
}

.rk-route-name span {
    color: var(--muted);
}


.rk-hours-card,
.rk-routes-card {
    margin-bottom: 16px;
}

.rk-hours-grid {
    margin-bottom: 18px;

    display: grid;
    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 8px;
}

.rk-hours-grid .field {
    min-width: 0;
    margin: 0;
}

.rk-hour-input {
    position: relative;
}

.rk-hour-input input {
    padding-right: 28px;
}

.rk-hour-input span {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    color: var(--muted);
    font-size: 12px;

    pointer-events: none;
}


.rk-route-list {
    margin-bottom: 18px;

    display: grid;
    gap: 12px;
}

.rk-route-card {
    padding: 14px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 16px;
}

.rk-route-card__top {
    margin-bottom: 13px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}

.rk-known-until {
    flex: 0 0 auto;

    text-align: right;
}

.rk-known-until span {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);
    font-size: 11px;
}

.rk-known-until strong {
    white-space: nowrap;

    font-size: 14px;
}


.rk-month-options {
    display: grid;
    grid-template-columns:
        repeat(7, minmax(0, 1fr));

    gap: 6px;
}

.rk-month-option {
    min-width: 0;

    cursor: pointer;
}

.rk-month-option input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.rk-month-option span {
    min-height: 52px;
    padding: 6px 3px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.rk-month-option small {
    color: var(--muted);

    font-size: 10px;
    line-height: 1;
}

.rk-month-option strong {
    margin-top: 4px;

    color: transparent;

    font-size: 17px;
    line-height: 1;
}

.rk-month-option input:checked + span {
    border-color: var(--accent);

    background:
        color-mix(
            in srgb,
            var(--accent) 12%,
            var(--surface)
        );
}

.rk-month-option input:checked + span strong {
    color: var(--accent);
}

.rk-month-option:active span {
    transform: scale(.96);
}

.rk-month-option--empty strong {
    color: var(--muted);
}

.rk-month-option--empty
input:checked + span strong {
    color: var(--muted);
}


.rk-route-carry {
    margin-top: 10px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.4;
}

.rk-admin-link {
    margin-top: 14px;

    display: inline-flex;

    text-decoration: none;
}


@media (max-width: 700px) {

    .rk-summary-grid {
        grid-template-columns: 1fr;
    }

    .rk-summary-card {
        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;
    }

    .rk-summary-card span {
        margin: 0;
    }

    .rk-hours-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 560px) {

    .rk-initial-row {
        grid-template-columns: 1fr;
    }

    .rk-route-card__top {
        flex-direction: column;
    }

    .rk-known-until {
        text-align: left;
    }

    .rk-month-options {
        grid-template-columns:
            repeat(7, minmax(38px, 1fr));

        overflow-x: auto;

        padding-bottom: 3px;
    }

    .rk-month-option span {
        min-width: 38px;
    }

}


@media (max-width: 390px) {

    .rk-period-selector form {
        grid-template-columns: 1fr;
    }

    .rk-hours-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

/* =========================================================
   STRECKENKENNTNIS – MOBILE FEINSCHLIFF
   ========================================================= */

.rk-initial-row {
    min-width: 0;
}

.rk-initial-row .field {
    min-width: 0;
    width: 100%;
}

.rk-initial-row input[type="month"] {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;
}



@media (max-width: 560px) {

    .rk-initial-row {
        width: 100%;
        box-sizing: border-box;
    }

    .rk-initial-row input[type="month"] {
        font-size: 16px;
    }

}

/* Ausgangsstand: stabile Monatsauswahl auf iPhone/Android */
.rk-initial-row select {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;
}

/* =========================================================
   STRECKENKENNTNIS – PDF SNAPSHOTS
   ========================================================= */

.rk-pdf-card {
    margin-bottom: 16px;
}

.rk-snapshot-list {
    margin-top: 18px;

    display: grid;
    gap: 8px;
}

.rk-snapshot-row {
    padding: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.rk-snapshot-info {
    min-width: 0;

    display: grid;
    gap: 3px;
}

.rk-snapshot-info strong {
    font-size: 14px;
}

.rk-snapshot-info span,
.rk-snapshot-empty {
    color: var(--muted);

    font-size: 12px;
    line-height: 1.4;
}

.rk-snapshot-empty {
    margin: 14px 0 0;
}

.rk-snapshot-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 6px;
}

.rk-snapshot-actions .secondary-button {
    padding: 8px 10px;

    text-decoration: none;

    font-size: 12px;
}


@media (max-width: 520px) {

    .rk-snapshot-row {
        align-items: stretch;
        flex-direction: column;
    }

    .rk-snapshot-actions {
        width: 100%;
    }

    .rk-snapshot-actions .secondary-button {
        flex: 1;

        justify-content: center;
    }

}

/* =========================================================
   STRECKENKENNTNIS – KOMPAKTE BEREICHE
   ========================================================= */

.rk-collapsible {
    padding: 0;
    overflow: hidden;
}

.rk-collapsible-summary {
    padding: 17px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    cursor: pointer;
    list-style: none;
}

.rk-collapsible-summary::-webkit-details-marker {
    display: none;
}

.rk-collapsible-summary h2 {
    margin: 0 0 3px;
}

.rk-collapsible-summary span {
    color: var(--muted);

    font-size: 12px;
}

.rk-collapsible-chevron {
    flex: 0 0 auto;

    font-size: 28px !important;
    line-height: 1;

    transform: rotate(90deg);
    transition: transform .15s ease;
}

.rk-collapsible[open]
.rk-collapsible-chevron {
    transform: rotate(-90deg);
}

.rk-collapsible-content {
    padding: 0 18px 18px;
}

.rk-collapsible-help {
    margin: 0 0 15px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.45;
}


.rk-latest-snapshot {
    margin-top: 18px;
}

.rk-latest-label {
    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .04em;
}


.rk-older-snapshots {
    margin-top: 12px;

    border-top: 1px solid var(--border);
}

.rk-older-snapshots > summary {
    padding: 14px 2px 4px;

    color: var(--muted);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.rk-older-snapshots .rk-snapshot-list {
    margin-top: 10px;
}

/* =========================================================
   ARCHIV
   ========================================================= */

.archive-list {
    display: grid;
    gap: 14px;
}

.archive-period-card {
    margin-bottom: 0;
}

.archive-period-heading {
    margin-bottom: 16px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;
}

.archive-period-heading h2 {
    margin: 3px 0 0;
}

.archive-module {
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.archive-version-badge {
    flex: 0 0 auto;

    padding: 6px 9px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}

.rk-snapshot-actions form {
    margin: 0;
    display: flex;
}

@media (max-width: 520px) {

    .archive-period-heading {
        align-items: flex-start;
    }

    .archive-version-badge {
        margin-top: 2px;
    }

}

/* =========================================================
   IOS-PWA – EINHEITLICHER SCROLLBEREICH
   Gilt für alle Seiten innerhalb des App-Layouts.
   Die Bottom-Navigation selbst bleibt unverändert.
   ========================================================= */

@media (display-mode: standalone) and (max-width: 650px) {

    .app-main {
        min-height: calc(100dvh - 70px);
    }

}

/* Streckenkenntnis-Link: keine Browser-Linkfarben */
.module-card--primary.module-card--link,
.module-card--primary.module-card--link:visited {
    color: var(--text);
}


/* =========================================================
   Zulagenkatalog Administration
   ========================================================= */

.allowance-catalog-versions {
    display: grid;
    gap: 14px;
}

.allowance-catalog-version {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
}

.allowance-catalog-version__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    cursor: pointer;
    list-style: none;
}

.allowance-catalog-version__summary::-webkit-details-marker {
    display: none;
}

.allowance-catalog-version__summary > div:first-child {
    display: grid;
    gap: 4px;
}

.allowance-catalog-version__summary strong {
    font-size: 17px;
}

.allowance-catalog-version__summary span {
    color: var(--muted);
    font-size: 13px;
}

.allowance-catalog-version__status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.allowance-catalog-version[open] .details-chevron {
    transform: rotate(90deg);
}

.allowance-catalog-version__content {
    padding: 0 18px 18px;
}

.allowance-catalog-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.allowance-catalog-meta > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.allowance-catalog-meta small {
    color: var(--muted);
}

.allowance-catalog-list {
    display: grid;
    gap: 8px;
}

.allowance-catalog-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.allowance-catalog-item__code,
.allowance-catalog-item__text,
.allowance-catalog-item__amount {
    display: grid;
    gap: 3px;
}

.allowance-catalog-item__code strong {
    font-size: 17px;
}

.allowance-catalog-item__code span,
.allowance-catalog-item__text span,
.allowance-catalog-item__amount span {
    color: var(--muted);
    font-size: 12px;
}

.allowance-catalog-item__amount {
    text-align: right;
}

@media (max-width: 650px) {
    .allowance-catalog-meta {
        grid-template-columns: 1fr;
    }

    .allowance-catalog-item {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .allowance-catalog-item__amount {
        grid-column: 2;
        text-align: left;
    }
}

/* Besuchte Modul-Links behalten die normale App-Farbe */
.module-card--link,
.module-card--link:visited {
    color: var(--text);
}


/* Zulagen: Datum im Auswahlfeld optisch zentrieren */
#work_day {
    padding-left: 48px;
    text-align: center;
    text-align-last: center;
}

/* Zulagen: Löschbutton etwas tiefer */
.allowance-entry-list form {
    margin-top: 8px;
}

/* Zulagen: Bearbeiten-Bereich */
.allowance-entry-edit {
    margin-top: 10px;
}

.allowance-entry-edit form {
    margin-top: 12px;
}

.allowance-entry-edit select[name="work_day"] {
    padding-left: 48px;
    text-align: center;
    text-align-last: center;
}

/* Zulagen: aufklappbare Monats-Einträge */
.allowance-entry-card__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}

.allowance-entry-card__summary::-webkit-details-marker {
    display: none;
}

.allowance-entry-card__summary > div {
    min-width: 0;
    flex: 1;
}

.allowance-entry-card__chevron {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 28px;
    line-height: 1;
    color: var(--muted);
    transform: rotate(90deg);
    transition: transform .15s ease;
}

.allowance-entry-card[open] .allowance-entry-card__chevron {
    transform: rotate(-90deg);
}

.allowance-entry-card__summary + form {
    margin-top: 18px;
}

/* Mehr Luft zwischen Erfassung und Monats-Einträgen */
.allowance-entry-list {
    margin-top: 18px;
}

.allowance-entry-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.allowance-entry-actions form,
.allowance-entry-actions button {
    width: 100%;
    margin: 0;
}

.allowance-entry-actions button {
    min-height: 52px;
}

.allowance-month-entries {
    margin-top: 16px;
}

/* Zulagen: Arbeitsbeginn / Arbeitsende mobil stabil nebeneinander */
.allowance-time-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.allowance-time-row .field {
    min-width: 0;
}

.allowance-time-row input[type="time"] {
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    -webkit-min-logical-width: 0;
    box-sizing: border-box;
}

/* iPhone: Zeitfelder in schmalen Grid-Spalten sauber begrenzen */
.allowance-time-row .field {
    overflow: hidden;
}

.allowance-time-row input[type="time"] {
    display: block;
    -webkit-appearance: none;
    appearance: none;
}

/* iPhone: Uhrzeit in den Zulagenfeldern sauber zentrieren */
.allowance-time-row input[type="time"] {
    text-align: center;
    padding-top: 0;
    padding-bottom: 0;
}

.allowance-time-row input[type="time"]::-webkit-date-and-time-value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin: 0;
    text-align: center;
}

/* Zulagen: einzelne gespeicherte Position dezent entfernen */
.allowance-entry-item form {
    margin-top: 5px;
}

.allowance-item-remove {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* Zulagen: Plus und Minus identisch darstellen */
.allowance-create-add,
.allowance-create-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
    color: var(--text);

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
}

/* Zulagen: Plus wirklich nur an der letzten Zeile anzeigen */
.allowance-create-add[hidden] {
    display: none;
}

/* Bei der letzten Zeile Abstand zwischen Minus und Plus */
.allowance-create-remove + .allowance-create-add {
    margin-left: 10px;
}

/* Zulagen: etwas mehr Abstand zwischen Bezeichnung und +/- */
.allowance-create-add,
.allowance-create-remove {
    margin-top: 4px;
}

/* Zulagen: ab der dritten Zeile gleicher Abstand wie oben */
.allowance-create-item:nth-child(n+3) {
    margin-top: 4px;
}

/* Zulagen: Pfeil oben rechts, Eintrag entfernen unten rechts */
.allowance-entry-card__controls {
    align-self: stretch;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;

    flex: 0 0 auto;
}

.allowance-entry-remove-form {
    margin-top: auto;
    padding-top: 14px;
}

/* Zulagen: volle Breite für die schöne Auflistung behalten */
.allowance-entry-card__summary {
    position: relative;
    display: block;
    padding-bottom: 30px;
}

.allowance-entry-card__summary > div:first-child {
    width: 100%;
    padding-right: 34px;
}

.allowance-entry-card__controls {
    position: absolute;
    inset: 0;

    display: block;

    pointer-events: none;
}

.allowance-entry-card__chevron {
    position: absolute;
    top: 2px;
    right: 0;
}

.allowance-entry-remove-form {
    position: absolute;
    right: 0;
    bottom: 0;

    margin: 0;
    padding: 0;

    pointer-events: auto;
}

/* Kompletten Eintrag nur zugeklappt entfernen */
.allowance-entry-card[open] .allowance-entry-remove-form {
    display: none;
}

/* Zulagen bearbeiten: gleiche +/- Optik wie bei Neuanlage */
.allowance-edit-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;

    margin-top: 4px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
    color: var(--text);

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
}

/* Auch bei mehreren vorhandenen Zulagen gleicher Zeilenabstand */
.allowance-edit-item:nth-child(n+3) {
    margin-top: 4px;
}

/* Zulagen bearbeiten: Plus identisch zum Minus */
.allowance-edit-add {
    width: 44px;
    height: 44px;
    min-width: 44px;

    margin-top: 4px;
    margin-left: 10px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
    color: var(--text);

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
}

/* Zulagen bearbeiten: unten nur noch Speichern */
.allowance-entry-actions {
    grid-template-columns: 1fr;
}

/* Zulagen: einheitlicher Abstand vor dem abschließenden PDF-Block */
.allowance-page .rk-pdf-card {
    margin-top: 16px;
}

/* =========================================================
   KOLONNEN MITARBEITER V2
   ========================================================= */

.crew-header {
    margin-bottom: 18px;
}

.crew-name-field {
    margin-bottom: 0;
}

.crew-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crew-name-row input {
    flex: 0 1 230px;

    width: min(100%, 230px);
    min-width: 0;

    background: var(--surface-soft);
}

.crew-name-row input[readonly] {
    cursor: default;
}

.crew-name-row form {
    flex: 0 0 auto;
}

.crew-delete-button {
    min-height: 44px;

    padding: 0 14px;

    border: 1px solid rgba(199, 40, 50, .38);
    border-radius: 12px;

    color: #b7202b;
    background: rgba(199, 40, 50, .08);

    font-size: 14px;
    font-weight: 750;

    cursor: pointer;
}

.crew-name-field > small {
    display: block;

    margin-top: 6px;

    color: var(--muted);
    font-size: 13px;
}


.crew-members {
    padding-top: 16px;

    border-top: 1px solid var(--border);
}

.crew-members__heading {
    margin-bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.crew-members__heading > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.crew-members__heading strong {
    font-size: 15px;
}

.crew-members__heading small {
    margin-top: 2px;

    color: var(--muted);
    font-size: 12px;
}

.crew-count-badge {
    flex: 0 0 auto;

    min-width: 34px;
    height: 34px;

    padding: 0 9px;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: var(--surface-soft);
    border: 1px solid var(--border);

    font-size: 12px;
    font-weight: 750;
}


.crew-member {
    position: relative;
    margin-top: 10px;
    padding: 12px;

    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.crew-member__identity {
    min-width: 0;
}

.crew-member__identity > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.crew-member__identity strong {
    font-size: 14px;
}

.crew-member__identity small {
    margin-top: 2px;

    color: var(--muted);
    font-size: 12px;
}


.crew-member__actions {
    margin-top: 10px;
    padding-right: 48px;
}

.crew-function-form {
    width: 100%;
    min-width: 0;
}

.crew-function-form select {
    width: 100%;
    min-width: 0;
}

.crew-function-form .secondary-button {
    white-space: nowrap;
}



.crew-member__actions > form:last-child {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    margin: 0;
}

.crew-member-remove {
    width: 44px;
    min-width: 44px;
    height: 44px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);
    background: var(--surface);

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}


.crew-empty {
    margin: 10px 0 0;

    color: var(--muted);
    font-size: 13px;
}


.crew-add {
    margin-top: 12px;

    border: 1px dashed var(--border);
    border-radius: 14px;

    overflow: hidden;
}

.crew-add > summary {
    min-height: 52px;

    padding: 0 12px;

    display: grid;
    grid-template-columns:
        34px
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 8px;

    cursor: pointer;
    list-style: none;

    font-weight: 750;
}

.crew-add > summary::-webkit-details-marker {
    display: none;
}

.crew-add[open] .details-chevron {
    transform: rotate(90deg);
}

.crew-add__plus {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--surface-soft);

    font-size: 24px;
    line-height: 1;
}

.crew-add__content {
    padding: 12px;

    border-top: 1px solid var(--border);
}

.crew-add-form {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: end;
    gap: 10px;
}

.crew-add-form .field {
    margin-bottom: 0;
}

.crew-add__hint {
    display: block;

    margin-top: 8px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}


.admin-readonly-value {
    min-height: 44px;

    padding: 0 12px;

    display: flex;
    align-items: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);
    background: var(--surface-soft);

    font-size: 14px;
}


@media (max-width: 560px) {

    .crew-name-row input {
        flex-basis: min(58vw, 230px);
    }

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

    .crew-add-form .primary-button {
        width: 100%;
    }

}


@media (prefers-color-scheme: dark) {

    .crew-delete-button {
        color: #ff9ca5;
        background: rgba(199, 40, 50, .14);
        border-color: rgba(255, 120, 130, .30);
    }

}

.crew-name-form {
    flex: 0 1 230px;
    min-width: 0;
}

.crew-name-form input {
    width: 100%;
}

/* Kompakter Status-Schalter in der Benutzerverwaltung */
.check-card--compact {
    min-height: 44px;
    height: 44px;

    padding: 0 12px;

    border-radius: 12px;
}

.check-card--compact input {
    flex: 0 0 22px;
}

.check-card--compact strong {
    line-height: 1.2;
}


/* Benutzerstatus bündig zu normalen Formularfeldern */
.field .check-card--compact {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 44px;
    height: 44px;

    margin: 0;
    padding: 0 12px;

    border-radius: 12px;
}

.field .check-card--compact span {
    min-width: 0;

    display: flex;
    align-items: center;
}

.field .check-card--compact strong {
    font-size: 14px;
    line-height: 1.2;
}

/* BACKUP STATUS EINSTELLUNGEN */

.backup-status-card {
    margin-top: 12px;
    padding: 12px 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
}

.backup-status-card--ok {
    border-color: rgba(31, 157, 98, .30);
    background: rgba(31, 157, 98, .07);
}

.backup-status-dot {
    flex: 0 0 10px;

    width: 10px;
    height: 10px;

    border-radius: 999px;

    background: var(--muted);
}

.backup-status-card--ok .backup-status-dot {
    background: #1f9d62;

    box-shadow:
        0 0 0 4px
        rgba(31, 157, 98, .12);
}

.backup-status-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.backup-status-content strong {
    font-size: 14px;
}

.backup-status-content span {
    margin-top: 2px;

    font-size: 13px;
    font-weight: 700;
}

.backup-status-content small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.35;
}


/* =========================================================
   KOLONNEN: NAME + FARBE + LÖSCHEN KOMPAKT
   ========================================================= */

.crew-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crew-name-form {
    flex: 0 1 auto;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 8px;
}

.crew-name-form .crew-name-input {
    width: 150px;
    min-width: 90px;
    max-width: 42vw;

    flex: 0 1 150px;
}

.crew-color-input {
    width: 44px !important;
    min-width: 44px;
    height: 44px;

    padding: 3px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);

    cursor: pointer;
}

.crew-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.crew-color-input::-webkit-color-swatch {
    border: 0;
    border-radius: 8px;
}

.crew-color-input::-moz-color-swatch {
    border: 0;
    border-radius: 8px;
}

.crew-delete-form {
    flex: 0 0 auto;
    margin: 0;
}

.crew-delete-button {
    white-space: nowrap;
}

.crew-create-inline {
    display: grid;

    grid-template-columns:
        minmax(120px, 180px)
        60px
        auto;

    align-items: end;
    gap: 10px;
}

.crew-create-inline .field {
    margin-bottom: 0;
}

.crew-create-color {
    min-width: 0;
}

.crew-create-color label {
    white-space: nowrap;
}


@media (max-width: 560px) {

    .crew-name-form .crew-name-input {
        width: 118px;
        flex-basis: 118px;
        max-width: 36vw;
    }

    .crew-delete-button {
        min-height: 44px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .crew-create-inline {
        grid-template-columns:
            minmax(0, 1fr)
            52px
            auto;
    }

    .crew-create-inline .primary-button {
        width: auto;
        padding-left: 12px;
        padding-right: 12px;
    }

}


/* =========================================================
   BEREITSCHAFTSKALENDER
   ========================================================= */

.oncall-page {
    width: min(100%, 760px);
    margin: 0 auto;
}

.oncall-heading {
    margin-bottom: 14px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.oncall-heading h1 {
    margin-bottom: 4px;
}

.oncall-heading p:last-child {
    margin: 0;

    color: var(--muted);
}

.oncall-manage-indicator {
    flex: 0 0 auto;

    margin-top: 4px;
    padding: 6px 9px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--muted);

    font-size: 10px;
    font-weight: 800;
}


/* =========================================================
   LEGENDE
   ========================================================= */

.oncall-legend {
    margin:
        0
        -16px
        14px;

    padding:
        2px
        16px
        5px;

    display: flex;
    gap: 8px;

    overflow-x: auto;

    overscroll-behavior-inline:
        contain;

    scrollbar-width: none;
}

.oncall-legend::-webkit-scrollbar {
    display: none;
}

.oncall-legend-chip {
    flex: 0 0 auto;

    min-height: 48px;

    padding: 7px 11px;

    display: flex;
    align-items: center;
    gap: 9px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);
    color: var(--text);

    box-shadow: var(--shadow);

    text-align: left;

    cursor: pointer;
}

.oncall-legend-dot {
    flex: 0 0 12px;

    width: 12px;
    height: 12px;

    border-radius: 999px;

    background:
        var(--crew-color);

    box-shadow:
        0 0 0 4px
        color-mix(
            in srgb,
            var(--crew-color) 16%,
            transparent
        );
}

.oncall-legend-label {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.oncall-legend-label strong {
    font-size: 13px;
    line-height: 1.15;
}

.oncall-legend-label small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.15;
}


/* =========================================================
   KALENDERKARTE
   ========================================================= */

.oncall-calendar-card {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 24px;

    background: var(--surface);

    box-shadow: var(--shadow);

    touch-action: pan-y;
}

.oncall-month-header {
    margin-bottom: 13px;

    display: grid;
    grid-template-columns:
        44px
        minmax(0, 1fr)
        44px;

    align-items: center;
    gap: 8px;
}

.oncall-month-title {
    min-width: 0;

    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
}

.oncall-month-title strong {
    font-size:
        clamp(
            23px,
            6vw,
            30px
        );

    font-weight: 820;

    letter-spacing:
        -.035em;
}

.oncall-month-title span {
    color: var(--muted);

    font-size: 16px;
    font-weight: 720;
}

.oncall-month-button {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--text);

    text-decoration: none;

    font-size: 29px;
    line-height: 1;
}


/* =========================================================
   WOCHENTAGE
   ========================================================= */

.oncall-weekdays {
    margin-bottom: 4px;

    display: grid;

    grid-template-columns:
        repeat(
            7,
            minmax(0, 1fr)
        );
}

.oncall-weekdays span {
    padding: 4px 0;

    color: var(--muted);

    text-align: center;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
}


/* =========================================================
   TAGE
   ========================================================= */

.oncall-grid {
    display: grid;

    grid-template-columns:
        repeat(
            7,
            minmax(0, 1fr)
        );

    gap: 4px;
}

.oncall-day {
    position: relative;

    min-width: 0;
    aspect-ratio: 1 / 1;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 15px;

    background:
        color-mix(
            in srgb,
            var(--crew-color) 9%,
            transparent
        );

    color: var(--text);

    cursor: pointer;
}

.oncall-day::before {
    content: "";

    position: absolute;

    inset: 3px;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--crew-color) 21%,
            transparent
        );

    border-radius: 12px;
}

.oncall-day--empty {
    background: transparent;
}

.oncall-day--empty::before {
    display: none;
}

.oncall-day-number {
    position: relative;
    z-index: 2;

    transform:
        translateY(-2px);

    font-size:
        clamp(
            13px,
            4vw,
            17px
        );

    font-weight: 720;
}

.oncall-day-color {
    position: absolute;
    z-index: 2;

    left: 50%;
    bottom: 6px;

    width: 5px;
    height: 5px;

    border-radius: 999px;

    background:
        var(--crew-color);

    transform:
        translateX(-50%);
}

.oncall-day--today {
    background: var(--text);
    color: var(--surface);
}

.oncall-day--today::before {
    display: none;
}

.oncall-day--today
.oncall-day-color {
    background: var(--surface);
}

.oncall-swipe-hint {
    margin: 11px 0 0;

    color: var(--muted);

    text-align: center;

    font-size: 11px;
}


/* =========================================================
   BOTTOM SHEET
   ========================================================= */

body.oncall-sheet-is-open {
    overflow: hidden;
}

.oncall-sheet-backdrop {
    position: fixed;
    z-index: 800;

    inset: 0;

    background:
        rgba(0, 0, 0, .30);

    opacity: 0;

    transition:
        opacity
        .22s ease;
}

.oncall-sheet-backdrop--open {
    opacity: 1;
}

.oncall-sheet {
    position: fixed;
    z-index: 810;

    left: 50%;
    bottom: 0;

    width: min(100%, 620px);

    max-height:
        min(
            78dvh,
            680px
        );

    padding:
        8px
        18px
        calc(
            20px
            + env(
                safe-area-inset-bottom
            )
        );

    overflow-y: auto;

    border:
        1px solid
        var(--border);

    border-bottom: 0;

    border-radius:
        26px
        26px
        0
        0;

    background:
        var(--surface);

    box-shadow:
        0 -18px 50px
        rgba(0, 0, 0, .16);

    transform:
        translate(
            -50%,
            105%
        );

    transition:
        transform
        .24s
        cubic-bezier(
            .22,
            .8,
            .28,
            1
        );
}

.oncall-sheet--open {
    transform:
        translate(
            -50%,
            0
        );
}

.oncall-sheet-handle {
    width: 38px;
    height: 5px;

    margin:
        0
        auto
        11px;

    border-radius: 999px;

    background: var(--border);
}

.oncall-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.oncall-sheet-header small {
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.oncall-sheet-header h2 {
    margin: 3px 0 0;

    font-size: 25px;
    font-weight: 800;
}

.oncall-sheet-close {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 999px;

    background:
        var(--surface-soft);

    color: var(--muted);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.oncall-sheet-turnus {
    margin-top: 18px;
    padding: 13px;

    display: flex;
    align-items: center;
    gap: 12px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface-soft);
}

.oncall-sheet-color {
    flex: 0 0 14px;

    width: 14px;
    height: 44px;

    border-radius: 999px;

    background:
        var(--crew-color);
}

.oncall-sheet-turnus > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.oncall-sheet-turnus strong {
    font-size: 15px;
}

.oncall-sheet-turnus small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
}

.oncall-sheet-members {
    margin-top: 18px;
}

.oncall-sheet-members-header {
    margin-bottom: 7px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.oncall-sheet-members-header strong {
    font-size: 14px;
}

.oncall-sheet-members-header span {
    min-width: 28px;
    height: 28px;

    padding: 0 8px;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: var(--surface-soft);

    color: var(--muted);

    font-size: 11px;
    font-weight: 800;
}

.oncall-sheet-member {
    padding: 11px 0;

    border-bottom:
        1px solid
        var(--border);
}

.oncall-sheet-member:last-child {
    border-bottom: 0;
}

.oncall-sheet-member > div {
    display: flex;
    flex-direction: column;
}

.oncall-sheet-member strong {
    font-size: 14px;
}

.oncall-sheet-member small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
}

.oncall-sheet-empty {
    padding: 13px;

    border-radius: 14px;

    background:
        var(--surface-soft);

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 720px) {

    .oncall-legend {
        margin-left: 0;
        margin-right: 0;

        padding-left: 0;
        padding-right: 0;

        flex-wrap: wrap;

        overflow: visible;
    }

    .oncall-calendar-card {
        padding: 22px;

        border-radius: 28px;
    }

    .oncall-grid {
        gap: 7px;
    }

    .oncall-day {
        border-radius: 18px;
    }

    .oncall-day::before {
        border-radius: 15px;
    }

    .oncall-day-color {
        bottom: 9px;

        width: 6px;
        height: 6px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    .oncall-sheet,
    .oncall-sheet-backdrop {
        transition: none;
    }

}


/* =========================================================
   BEREITSCHAFT: HEUTE-BUTTON
   ========================================================= */

.oncall-month-center {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.oncall-today-button {
    flex: 0 0 auto;

    min-height: 30px;

    padding: 6px 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--text);

    text-decoration: none;

    font-size: 11px;
    font-weight: 800;
}

.oncall-today-button:active {
    transform: scale(.97);
}

@media (max-width: 520px) {

    .oncall-month-center {
        gap: 6px;
    }

    .oncall-today-button {
        padding-left: 8px;
        padding-right: 8px;

        font-size: 10px;
    }

}

.oncall-today-button {
    transform: translateX(2mm);
}

.oncall-today-button:active {
    transform:
        translateX(2mm)
        scale(.97);
}


/* =========================================================
   ADMINISTRATION – BEREITSCHAFT / TURNUS
   ========================================================= */

.oncall-admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.oncall-admin-sequence {
    margin-top: 18px;

    display: grid;
    gap: 8px;
}

.oncall-admin-sequence-row {
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 8px 10px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.oncall-admin-position {
    width: 24px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.oncall-admin-color {
    flex: 0 0 12px;

    width: 12px;
    height: 12px;

    border-radius: 999px;

    box-shadow:
        0 0 0 3px
        rgba(255, 255, 255, .08);
}

.oncall-admin-form {
    margin-top: 18px;

    display: grid;
    gap: 18px;
}

.oncall-admin-picker,
.oncall-admin-preview {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
}

.oncall-admin-picker-head {
    margin-bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.oncall-admin-picker-head div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.oncall-admin-picker-head small {
    color: var(--muted);
}

.oncall-admin-pool {
    display: grid;
    gap: 8px;
}

.oncall-admin-crew {
    min-height: 50px;

    display: grid;
    grid-template-columns:
        34px
        34px
        minmax(0, 1fr);
    align-items: center;
    gap: 6px;

    padding: 6px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.oncall-admin-move {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-soft);
    color: var(--text);

    font-size: 16px;
    font-weight: 800;
}

.oncall-admin-crew-main {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;
}

.oncall-admin-crew-main input {
    width: 20px;
    height: 20px;
}

.oncall-admin-preview-list {
    display: grid;
    gap: 8px;
}

.oncall-admin-preview-item {
    min-height: 48px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 10px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.oncall-admin-preview-item div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.oncall-admin-preview-item small {
    color: var(--muted);
}

.oncall-admin-history {
    margin-top: 14px;

    display: grid;
    gap: 10px;
}

.oncall-admin-history-item {
    display: grid;
    gap: 10px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
}

.oncall-admin-history-item > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.oncall-admin-history-item small {
    color: var(--muted);
}

.oncall-admin-history-crews {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.oncall-admin-history-chip {
    min-height: 30px;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);

    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 520px) {

    .oncall-admin-section-head {
        flex-direction: column;
    }

    .oncall-admin-crew {
        grid-template-columns:
            32px
            32px
            minmax(0, 1fr);
    }

    .oncall-admin-move {
        width: 32px;
        height: 32px;
    }

}


/* =========================================================
   Bereitschaft – einklappbare Verwaltungsbereiche
   ========================================================= */

.oncall-admin-collapse {
    margin-top: 18px;
}

.oncall-admin-collapse__summary {
    min-height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    color: var(--text);

    font-size: 16px;
    font-weight: 800;

    cursor: pointer;

    list-style: none;
}

.oncall-admin-collapse__summary::-webkit-details-marker {
    display: none;
}

.oncall-admin-collapse__chevron {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 26px;
    line-height: 1;

    transition:
        transform .18s ease;
}

.oncall-admin-collapse[open]
.oncall-admin-collapse__chevron {
    transform: rotate(90deg);
}

.oncall-admin-collapse__content {
    margin-top: 10px;
}

@media (max-width: 520px) {

    .oncall-admin-collapse {
        margin-top: 14px;
    }

    .oncall-admin-collapse__summary {
        min-height: 54px;

        padding:
            12px
            14px;

        border-radius: 14px;

        font-size: 15px;
    }

}


/* =========================================================
   TELEFONBUCH
   ========================================================= */

.phonebook-search-wrap {
    position: sticky;
    z-index: 20;
    top: 0;

    margin-bottom: 10px;
    padding: 8px 0 10px;

    background: var(--background);
}

.phonebook-search {
    min-height: 46px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    gap: 9px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);
}

.phonebook-search > span {
    color: var(--muted);

    font-size: 22px;
    line-height: 1;
}

.phonebook-search input {
    min-width: 0;
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--text);

    font: inherit;
    font-size: 16px;
}

.phonebook-search input::placeholder {
    color: var(--muted);
}

.phonebook-result-count {
    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.phonebook-list {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: var(--surface);
}

.phonebook-row {
    width: 100%;
    min-height: 68px;

    padding: 9px 13px;

    display: flex;
    align-items: center;
    gap: 11px;

    border: 0;
    border-bottom:
        1px solid
        var(--border);

    background: transparent;
    color: inherit;

    text-align: left;

    cursor: pointer;
}

.phonebook-row:last-child {
    border-bottom: 0;
}

.phonebook-row:active {
    background: var(--surface-soft);
}

.phonebook-row[hidden] {
    display: none;
}

.phonebook-avatar {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: var(--surface-soft);

    color: var(--text);

    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.phonebook-row-main,
.phonebook-admin-entry-main {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.phonebook-row-main strong,
.phonebook-admin-entry-main strong {
    overflow: hidden;

    font-size: 15px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.phonebook-row-main small,
.phonebook-admin-entry-main small {
    margin-top: 3px;

    overflow: hidden;

    color: var(--muted);

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.phonebook-row-chevron {
    color: var(--muted);

    font-size: 26px;
    font-weight: 300;
}

.phonebook-empty {
    margin-top: 12px;
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    color: var(--muted);

    font-size: 13px;
    text-align: center;
}


/* =========================================================
   TELEFONBUCH BOTTOM SHEET
   ========================================================= */

body.phonebook-sheet-is-open {
    overflow: hidden;
}

.phonebook-sheet-backdrop {
    position: fixed;
    z-index: 800;

    inset: 0;

    background: rgba(0, 0, 0, .30);

    opacity: 0;

    transition: opacity .22s ease;
}

.phonebook-sheet-backdrop--open {
    opacity: 1;
}

.phonebook-sheet {
    position: fixed;
    z-index: 810;

    left: 50%;
    bottom: 0;

    width: min(100%, 620px);

    max-height:
        min(
            82dvh,
            720px
        );

    padding:
        8px
        18px
        calc(
            20px
            + env(
                safe-area-inset-bottom
            )
        );

    overflow-y: auto;

    border:
        1px solid
        var(--border);

    border-bottom: 0;

    border-radius:
        26px
        26px
        0
        0;

    background: var(--surface);

    box-shadow:
        0 -18px 50px
        rgba(0, 0, 0, .16);

    transform:
        translate(
            -50%,
            105%
        );

    transition:
        transform
        .24s
        cubic-bezier(
            .22,
            .8,
            .28,
            1
        );
}

.phonebook-sheet--open {
    transform:
        translate(
            -50%,
            0
        );
}

.phonebook-sheet-handle {
    width: 38px;
    height: 5px;

    margin:
        0
        auto
        11px;

    border-radius: 999px;

    background: var(--border);
}

.phonebook-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;

    padding-bottom: 14px;

    border-bottom:
        1px solid
        var(--border);
}

.phonebook-sheet-header small {
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.phonebook-sheet-header h2 {
    margin: 3px 0 0;

    font-size: 25px;
    font-weight: 800;
}

.phonebook-sheet-header p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.phonebook-sheet-close {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--muted);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.phonebook-sheet-details {
    margin-top: 6px;
}

.phonebook-detail-row {
    padding: 13px 2px;

    display: flex;
    flex-direction: column;
    gap: 3px;

    border-bottom:
        1px solid
        var(--border);
}

.phonebook-detail-row:last-child {
    border-bottom: 0;
}

.phonebook-detail-row small {
    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}

.phonebook-detail-row strong,
.phonebook-detail-row a {
    color: var(--text);

    font-size: 15px;
    font-weight: 650;

    text-decoration: none;

    white-space: pre-line;
}

.phonebook-detail-row a {
    color: var(--accent);
}

.phonebook-detail-note strong {
    line-height: 1.45;
}


/* =========================================================
   TELEFONBUCH ADMINISTRATION
   ========================================================= */

.phonebook-admin-actions,
.phonebook-admin-list {
    display: grid;
    gap: 12px;
}

.phonebook-admin-actions {
    margin-bottom: 16px;
}

.phonebook-admin-create,
.phonebook-admin-entry,
.phonebook-import-placeholder {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: var(--surface);
}

.phonebook-admin-create > summary,
.phonebook-admin-entry > summary {
    min-height: 66px;

    padding: 11px 14px;

    display: flex;
    align-items: center;
    gap: 11px;

    cursor: pointer;

    list-style: none;
}

.phonebook-admin-create > summary::-webkit-details-marker,
.phonebook-admin-entry > summary::-webkit-details-marker {
    display: none;
}

.phonebook-admin-create > summary > span:first-child {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
}

.phonebook-admin-create > summary strong {
    font-size: 14px;
}

.phonebook-admin-create > summary small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
}

.phonebook-admin-create > summary > span:last-child,
.phonebook-admin-entry > summary > span:last-child {
    color: var(--muted);

    font-size: 25px;
}

.phonebook-admin-form {
    padding: 14px;

    border-top:
        1px solid
        var(--border);
}

.phonebook-admin-form .form-grid {
    display: grid;
    gap: 12px;
}

.phonebook-active-toggle {
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 14px;
}

.phonebook-active-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.phonebook-import-placeholder {
    min-height: 66px;

    padding: 12px 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.phonebook-import-placeholder > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.phonebook-import-placeholder strong {
    font-size: 14px;
}

.phonebook-import-placeholder small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;
}

.phonebook-admin-entry > summary .phonebook-avatar {
    flex-basis: 40px;

    width: 40px;
    height: 40px;
}

.phonebook-admin-entry[open] > summary {
    background: var(--surface-soft);
}

.phonebook-admin-delete {
    padding:
        0
        14px
        14px;
}


@media (min-width: 760px) {

    .phonebook-admin-form .form-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .phonebook-admin-form .form-field--wide,
    .phonebook-admin-form .phonebook-active-toggle {
        grid-column: 1 / -1;
    }

}


.phonebook-import-form {
    margin-top: 14px;

    display: grid;
    gap: 12px;
}

.phonebook-import-form input[type="file"] {
    width: 100%;

    padding: 10px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
    color: var(--text);
}


.phonebook-avatar--image {
    display: block;

    padding: 0;

    object-fit: cover;
    object-position: center;

    border: 0;
}


/* =========================================================
   PROFILVOLLSTÄNDIGKEIT / BÜRO
   ========================================================= */

.profile-required-card {
    margin-bottom: 16px;
    padding: 16px;

    border: 1px solid rgba(220, 80, 70, .35);
    border-radius: 16px;

    background: rgba(220, 80, 70, .08);
}

.profile-required-card strong {
    display: block;
    margin-bottom: 6px;
}

.profile-required-card p {
    margin: 0;
}

.profile-required-card__missing {
    margin-top: 8px !important;

    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.profile-field-hint {
    margin: -0.25rem 0 1rem;
    font-size: 0.85rem;
    opacity: 0.72;
    line-height: 1.4;
}


/* =========================================================
   ZULAGEN · VORLAGENVERWALTUNG
   ========================================================= */

.allowance-template-admin-card {
    margin-bottom: 16px;
    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.allowance-template-admin-card__heading {
    margin-bottom: 20px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}


.allowance-template-admin-card__heading h2,
.allowance-template-section__heading h2 {
    margin: 2px 0 5px;

    font-size: 19px;
    line-height: 1.25;
}


.allowance-template-admin-card__heading p,
.allowance-template-section__heading p {
    margin: 0;

    max-width: 620px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.5;
}


.allowance-template-upload-form {
    display: grid;
    grid-template-columns:
        minmax(0, 1.25fr)
        minmax(0, .75fr);

    gap: 14px;
}


.allowance-template-upload-form .field {
    min-width: 0;
    margin: 0;
}


.allowance-template-upload-form .field small {
    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.4;
}


.allowance-template-file-field input[type="file"] {
    width: 100%;
    min-height: 48px;

    padding: 5px;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 13px;

    font: inherit;
}


.allowance-template-file-field
input[type="file"]::file-selector-button {
    min-height: 36px;

    margin-right: 10px;
    padding: 0 13px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 9px;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}


.on-call-template-upload-note {
    grid-column: 1 / -1;

    padding: 10px 12px;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 13px;

    font-size: 12px;
    line-height: 1.45;
}

.on-call-template-upload-note strong {
    color: var(--text);
}


.allowance-template-upload-actions {
    grid-column: 1 / -1;

    display: flex;
    justify-content: flex-end;

    padding-top: 2px;
}


.allowance-template-upload-actions .primary-button {
    min-width: 210px;
}


.allowance-template-section {
    margin-bottom: 16px;
}


.allowance-template-section__heading {
    margin-bottom: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}


.allowance-template-count {
    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 50%;

    font-size: 12px;
    font-weight: 800;
}


.allowance-template-list {
    display: grid;
    gap: 9px;
}


.allowance-template-row,
.allowance-template-row:visited {
    min-height: 72px;
    padding: 12px 14px;

    display: grid;
    grid-template-columns:
        46px
        minmax(0, 1fr)
        auto
        22px;

    align-items: center;
    gap: 12px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: var(--shadow);

    text-decoration: none;
}


.allowance-template-row__version {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    color: var(--accent);
    background: var(--accent-soft);

    border-radius: 13px;

    font-size: 13px;
    font-weight: 850;
}


.allowance-template-row__content {
    min-width: 0;

    display: grid;
    gap: 3px;
}


.allowance-template-row__content strong {
    overflow: hidden;

    font-size: 15px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.allowance-template-row__content span {
    overflow: hidden;

    color: var(--muted);

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.allowance-template-row .details-chevron {
    font-size: 24px;
}


/*
 * Katalogversionen sind immer zunächst eingeklappt.
 * Der Pfeil dreht sich nur nach manueller Öffnung.
 */
.allowance-catalog-version[open]
.allowance-catalog-version__summary
.details-chevron {
    transform: rotate(90deg);
}


@media (max-width: 650px) {

    .allowance-template-admin-card {
        padding: 16px;
    }


    .allowance-template-admin-card__heading {
        margin-bottom: 16px;
    }


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


    .allowance-template-upload-actions {
        grid-column: auto;
    }


    .allowance-template-upload-actions .primary-button {
        width: 100%;
        min-width: 0;
    }


    .allowance-template-section__heading {
        align-items: flex-end;
    }


    .allowance-template-row {
        grid-template-columns:
            42px
            minmax(0, 1fr)
            22px;

        gap: 10px;
    }


    .allowance-template-row__version {
        width: 42px;
        height: 42px;
    }


    .allowance-template-row .status-pill {
        grid-column: 2;

        width: fit-content;

        margin-top: 2px;
    }


    .allowance-template-row .details-chevron {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

}


/* Zulagenvorlagen: Datei- und Versionsfeld exakt gleich hoch */
.allowance-template-upload-form input[type="text"],
.allowance-template-upload-form input[type="file"] {
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
}


/* Zulagenvorlage · Kompatibilitätsprüfung */
.allowance-template-check-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.allowance-template-check-heading h2 {
    margin: 0 0 5px;
}

.allowance-template-check-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.allowance-template-compatibility-errors {
    margin-top: 14px;
    padding: 14px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.allowance-template-compatibility-errors strong {
    color: var(--accent);
}

.allowance-template-compatibility-errors ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.allowance-template-compatibility-errors li + li {
    margin-top: 5px;
}

@media (max-width: 560px) {
    .allowance-template-check-heading {
        align-items: flex-start;
    }
}

/* =========================================================
   ZULAGEN · VORLAGENGRUPPEN UND KATALOGSUCHE
   ========================================================= */


.allowance-template-group + .allowance-template-group {
    margin-top: 18px;
}


.allowance-template-group__heading {
    margin-bottom: 8px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.allowance-template-group__heading strong {
    font-size: 13px;
    line-height: 1.3;
}


.allowance-template-group__heading span {
    min-width: 28px;
    height: 28px;

    padding: 0 8px;

    display: grid;
    place-items: center;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
}


.status-pill--warning {
    color: #8a4b00;
    background: #fff3dc;
}


.allowance-catalog-search {
    margin-bottom: 16px;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: end;
    gap: 12px;
}


.allowance-catalog-search .field {
    margin: 0;
}


.allowance-catalog-search input[type="search"] {
    width: 100%;
}


.allowance-catalog-search__count {
    min-height: 44px;

    padding: 0 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 12px;

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;
}


.allowance-catalog-item[hidden] {
    display: none !important;
}


@media (prefers-color-scheme: dark) {

    .status-pill--warning {
        color: #ffd28d;
        background: #3b2a12;
    }

}


@media (max-width: 650px) {

    .allowance-catalog-search {
        grid-template-columns: 1fr;
    }


    .allowance-catalog-search__count {
        width: fit-content;
        min-height: 32px;

        padding: 0 10px;
    }

}


/* =========================================================
   TELEFONBUCH · ADMINISTRATION V2
   ========================================================= */

.phonebook-admin-actions {
    display: grid;
    gap: 14px;

    margin-top: 18px;
    margin-bottom: 18px;
}


/* ---------------------------------------------------------
   Kontakt anlegen / Excel-Import
   --------------------------------------------------------- */

.phonebook-admin-create {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.phonebook-admin-create > summary {
    min-height: 72px;

    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    list-style: none;
    cursor: pointer;
}


.phonebook-admin-create > summary::-webkit-details-marker {
    display: none;
}


.phonebook-admin-create > summary strong {
    display: block;

    color: var(--text);

    font-size: 15px;
    line-height: 1.25;
}


.phonebook-admin-create > summary small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.35;
}


.phonebook-admin-create
> summary
> span:last-child {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    color: var(--muted);

    font-size: 25px;
    line-height: 1;

    transition:
        transform .18s ease;
}


.phonebook-admin-create[open]
> summary
> span:last-child {
    transform: rotate(45deg);
}


.phonebook-admin-create[open] > summary {
    border-bottom: 1px solid var(--border);
}


/* ---------------------------------------------------------
   Formulare
   --------------------------------------------------------- */

.phonebook-admin-form {
    padding: 16px;
}


.phonebook-admin-form .form-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;
}


.phonebook-admin-form .form-field {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 6px;
}


.phonebook-admin-form
.form-field--wide {
    grid-column: 1 / -1;
}


.phonebook-admin-form
.form-field > span,
.phonebook-import-form
.form-field > span {
    color: var(--text);

    font-size: 12px;
    font-weight: 750;
}


.phonebook-admin-form
:is(
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    select,
    textarea
) {
    width: 100%;
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
    color: var(--text);

    font: inherit;

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}


.phonebook-admin-form
:is(
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    select
) {
    min-height: 46px;

    padding: 0 13px;
}


.phonebook-admin-form textarea {
    min-height: 108px;

    padding: 12px 13px;

    resize: vertical;
}


.phonebook-admin-form
:is(
    input,
    select,
    textarea
):focus {
    border-color: var(--accent);

    background: var(--surface);

    box-shadow:
        0 0 0 3px
        var(--accent-soft);
}


/* ---------------------------------------------------------
   Aktiv-Schalter
   --------------------------------------------------------- */

.phonebook-active-toggle {
    grid-column: 1 / -1;

    min-height: 50px;

    padding: 11px 13px;

    display: flex;
    align-items: center;
    gap: 11px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}


.phonebook-active-toggle
input[type="checkbox"] {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    accent-color: var(--accent);
}


/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.phonebook-admin-form
.button--primary,
.phonebook-import-form
.button--primary {
    width: 100%;
    min-height: 48px;

    margin-top: 14px;
    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 13px;

    background: var(--accent);
    color: #fff;

    font: inherit;
    font-size: 13px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;
}


.phonebook-admin-form
.button--secondary {
    min-height: 44px;

    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
    color: var(--text);

    font-size: 13px;
    font-weight: 750;

    text-decoration: none;
}


.phonebook-admin-delete {
    padding:
        0
        16px
        16px;
}


.phonebook-admin-delete
.button--danger {
    width: 100%;
    min-height: 46px;

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent) 35%,
            var(--border)
        );

    border-radius: 13px;

    background:
        color-mix(
            in srgb,
            var(--accent) 8%,
            var(--surface)
        );

    color: var(--accent);

    font: inherit;
    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}


/* ---------------------------------------------------------
   Excel-Import
   --------------------------------------------------------- */

.phonebook-import-form {
    display: grid;
    gap: 8px;

    margin-top: 4px;
}


.phonebook-import-form
input[type="file"] {
    width: 100%;
    min-height: 48px;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
    color: var(--muted);

    font: inherit;
}


.phonebook-import-form
input[type="file"]::file-selector-button {
    min-height: 36px;

    margin-right: 10px;
    padding: 0 13px;

    border: 0;
    border-radius: 9px;

    background: var(--surface);
    color: var(--text);

    box-shadow:
        inset 0 0 0 1px
        var(--border);

    font: inherit;
    font-weight: 750;

    cursor: pointer;
}


/* ---------------------------------------------------------
   Bearbeitungsbereich der Kontaktkarten
   --------------------------------------------------------- */

.phonebook-admin-entry[open] {
    overflow: hidden;
}


.phonebook-admin-entry[open]
.phonebook-admin-form {
    border-top: 1px solid var(--border);
}


/* ---------------------------------------------------------
   Suche vorhandener Kontakte
   --------------------------------------------------------- */

.phonebook-admin-search-wrap {
    margin: 18px 0 12px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 10px;

    align-items: center;
}


.phonebook-admin-search {
    min-height: 48px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    gap: 10px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow: var(--shadow);
}


.phonebook-admin-search > span {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 22px;
}


.phonebook-admin-search input {
    width: 100%;
    min-width: 0;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--text);

    font: inherit;
    font-size: 14px;
}


.phonebook-admin-search
input::placeholder {
    color: var(--muted);
}


.phonebook-admin-search-count {
    min-height: 48px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 750;

    white-space: nowrap;
}


.phonebook-admin-entry[hidden] {
    display: none !important;
}


/* ---------------------------------------------------------
   Mobil
   --------------------------------------------------------- */

@media (max-width: 650px) {

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


    .phonebook-admin-form
    .form-field--wide,
    .phonebook-active-toggle {
        grid-column: auto;
    }


    .phonebook-admin-form {
        padding: 14px;
    }


    .phonebook-admin-create
    > summary {
        min-height: 66px;

        padding: 13px 14px;
    }


    .phonebook-admin-search-wrap {
        grid-template-columns: 1fr;
    }


    .phonebook-admin-search-count {
        width: fit-content;

        min-height: 32px;

        padding: 0 10px;
    }

}


/* =========================================================
   ZULAGEN · KOMPAKTE HISTORIE
   ========================================================= */

.allowance-history-group {
    margin-top: 12px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: var(--shadow);
}


.allowance-history-group__summary {
    min-height: 68px;

    padding: 13px 15px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    list-style: none;
    cursor: pointer;
}


.allowance-history-group__summary::-webkit-details-marker {
    display: none;
}


.allowance-history-group__summary > div:first-child {
    min-width: 0;

    display: grid;
    gap: 3px;
}


.allowance-history-group__summary strong {
    color: var(--text);

    font-size: 14px;
    line-height: 1.3;
}


.allowance-history-group__summary
> div:first-child
> span {
    overflow: hidden;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.allowance-history-group__status {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 9px;
}


.allowance-history-group__count {
    min-width: 30px;
    height: 30px;

    padding: 0 9px;

    display: grid;
    place-items: center;

    color: var(--muted);
    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
}


.allowance-history-group__summary
.details-chevron {
    font-size: 24px;

    transition:
        transform .18s ease;
}


.allowance-history-group[open]
> .allowance-history-group__summary
.details-chevron {
    transform: rotate(90deg);
}


.allowance-history-group[open]
> .allowance-history-group__summary {
    border-bottom: 1px solid var(--border);
}


.allowance-history-group__content {
    padding: 10px;
}


.allowance-history-group__content
> .allowance-catalog-version
+ .allowance-catalog-version {
    margin-top: 9px;
}


.allowance-template-group
+ .allowance-history-group,
.allowance-history-group
+ .allowance-history-group {
    margin-top: 12px;
}


@media (max-width: 650px) {

    .allowance-history-group__summary {
        min-height: 64px;

        padding: 12px 13px;
    }


    .allowance-history-group__summary
    > div:first-child
    > span {
        max-width: 220px;
    }

}

/* Bereitschaft/Zulagen Vorlagenversions-Badge sauber zentrieren */
.allowance-template-row__version {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.05;
}




/* ==========================================================
   Persönliche Bereitschaftszettel
   ========================================================== */

.on-call-sheet-page input[type="date"],
.on-call-sheet-page input[type="time"],
.on-call-sheet-page select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.on-call-create-form {
    display: block;
}

.on-call-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    align-items: start;
}

.on-call-field {
    min-width: 0;
}

.on-call-field small {
    display: block;
    margin-top: 8px;
}

.on-call-field--tariff {
    order: 1;
}

.on-call-field--kind {
    order: 2;
}

.on-call-field--start {
    order: 3;
}

.on-call-field--end {
    order: 4;
}

.on-call-field--begin {
    order: 5;
}

.on-call-field--finish {
    order: 6;
}


.on-call-month-calculation {
    margin-top: 16px;
    margin-bottom: 28px;
}

.on-call-calculation-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.on-call-calculation-grid > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.on-call-calculation-grid span {
    font-size: 0.78rem;
    opacity: 0.7;
}

.on-call-calculation-grid strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.on-call-sheet-list {
    margin-top: 16px;
}

.on-call-sheet-entry__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.on-call-sheet-edit-form {
    padding-top: 18px;
}

.on-call-period-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.on-call-period-row {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(260px, 1.15fr);
    gap: 18px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.on-call-period-row__date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

.on-call-period-row__date > span:not(.status-pill) {
    font-size: 0.85rem;
    opacity: 0.72;
}

.on-call-period-row__times {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.on-call-sheet-page
.rk-pdf-card
button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

@media (max-width: 780px) {

    .on-call-form-layout {
        grid-template-columns: 1fr;
    }

    .on-call-create-form .on-call-field--tariff {
        order: 1;
    }

    .on-call-create-form .on-call-field--kind {
        order: 2;
    }

    .on-call-create-form .on-call-field--start {
        order: 3;
    }

    .on-call-create-form .on-call-field--end {
        order: 4;
    }

    .on-call-create-form .on-call-field--begin {
        order: 5;
    }

    .on-call-create-form .on-call-field--finish {
        order: 6;
    }

    .on-call-calculation-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .on-call-period-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

}

@media (max-width: 480px) {

    .on-call-calculation-grid {
        grid-template-columns: 1fr;
    }

    .on-call-period-row__times {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ==========================================================
   iOS PWA · native Date-/Time-Felder
   Native WebKit-Ausrichtung beibehalten.
   Flex-Wrapper verhindert das bekannte Breitenproblem.
   ========================================================== */

.on-call-sheet-page .field,
.on-call-sheet-page .on-call-field,
.on-call-sheet-page .on-call-form-layout {
    min-width: 0;
    max-width: 100%;
}

.on-call-native-input-wrap {
    display: -webkit-flex;
    display: flex;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    box-sizing: border-box;
}

.on-call-native-input-wrap > input[type="date"],
.on-call-native-input-wrap > input[type="time"] {
    -webkit-flex: 1 0 0;
    flex: 1 0 0;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;

    box-sizing: border-box;

    /*
     * Absichtlich KEIN:
     * display:block
     * appearance:none
     *
     * iOS/WebKit darf Date/Time hier nativ rendern.
     */
}

.on-call-native-input-wrap
> input[type="date"]::-webkit-date-and-time-value,
.on-call-native-input-wrap
> input[type="time"]::-webkit-date-and-time-value {
    margin: 0;
    width: 100%;
    inline-size: 100%;
    text-align: center;
}

@media (max-width: 780px) {

    .on-call-sheet-page .on-call-form-layout,
    .on-call-sheet-page .on-call-field,
    .on-call-sheet-page .field {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

}


/* ==========================================================
   Bereitschaft · Einsätze / LRE
   ========================================================== */

.on-call-assignment-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.on-call-assignment-heading {
    margin-bottom: 16px;
}

.on-call-assignment-heading h3 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.on-call-assignment-heading p {
    margin: 0;
    font-size: 0.84rem;
    opacity: 0.72;
    line-height: 1.45;
}

.on-call-assignment-card {
    margin-top: 14px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.on-call-assignment-card--new {
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

.on-call-assignment-card h4 {
    margin: 0 0 14px;
    font-size: 0.92rem;
}

.on-call-assignment-grid {
    display: grid;
    grid-template-columns:
        minmax(135px, 0.8fr)
        minmax(240px, 1.6fr)
        minmax(120px, 0.7fr)
        minmax(120px, 0.7fr)
        minmax(160px, 0.9fr)
        minmax(130px, 0.75fr);
    gap: 12px;
    align-items: end;
}

.on-call-assignment-description {
    min-width: 0;
}

.on-call-assignment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.on-call-inline-delete {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
}

.on-call-x-choice {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
}

.on-call-x-choice input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
}

.on-call-lre3-field {
    align-self: end;
}

[data-km-field][hidden] {
    display: none !important;
}

@media (max-width: 1100px) {

    .on-call-assignment-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .on-call-assignment-description {
        grid-column: 1 / -1;
    }

}

@media (max-width: 780px) {

    .on-call-assignment-section {
        margin-top: 24px;
        padding-top: 20px;
    }

    .on-call-assignment-card {
        padding: 14px;
    }

    .on-call-assignment-grid {
        grid-template-columns: 1fr;
    }

    .on-call-assignment-description {
        grid-column: auto;
    }

    .on-call-assignment-actions,
    .on-call-inline-delete {
        justify-content: stretch;
    }

    .on-call-assignment-actions button,
    .on-call-inline-delete button {
        width: 100%;
    }

}


/* ==========================================================
   Bereitschaft · neue Einsätze direkt beim Anlegen
   ========================================================== */

.on-call-create-assignment-area {
    margin-top: 28px;
}

.on-call-create-assignment-section {
    padding-top: 22px;
    margin-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.on-call-create-assignment-section:first-child {
    margin-top: 0;
}

.on-call-create-assignment-section
.on-call-assignment-grid {
    margin-top: 16px;
}

@media (max-width: 780px) {

    .on-call-create-assignment-area {
        margin-top: 24px;
    }

    .on-call-create-assignment-section {
        margin-top: 20px;
        padding-top: 20px;
    }

}


/* ==========================================================
   Bereitschaft · Einsatzgrid Desktop korrigieren
   ========================================================== */

@media (min-width: 1101px) {

    .on-call-create-assignment-section
    .on-call-assignment-grid {
        grid-template-columns:
            minmax(105px, 0.8fr)
            minmax(190px, 1.45fr)
            minmax(95px, 0.7fr)
            minmax(95px, 0.7fr)
            minmax(125px, 0.9fr)
            minmax(105px, 0.75fr);

        gap: 10px;
    }

    .on-call-create-assignment-section
    .on-call-assignment-grid
    .field {
        min-width: 0;
    }

    .on-call-create-assignment-section
    .on-call-assignment-grid
    input,
    .on-call-create-assignment-section
    .on-call-assignment-grid
    select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

}




/* ==========================================================
   Bereitschaft · wiederholbare Einsatzzeilen
   ========================================================== */

.on-call-create-repeat-list {
    display: grid;
    gap: 0;
}

.on-call-create-repeat-row {
    min-width: 0;
}

.on-call-create-repeat-row
+ .on-call-create-repeat-row {
    margin-top: 18px;
    padding-top: 18px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);
}

.on-call-create-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    gap: 8px;

    margin-top: 10px;
}

.on-call-create-row-actions
.allowance-create-add,
.on-call-create-row-actions
.allowance-create-remove {
    flex: 0 0 auto;
}

@media (max-width: 780px) {

    .on-call-create-repeat-row
    + .on-call-create-repeat-row {
        margin-top: 20px;
        padding-top: 20px;
    }

    .on-call-create-row-actions {
        margin-top: 12px;
    }

}


/* ==========================================================
   Bereitschaft · wiederholbare Zeilen Feinschliff
   ========================================================== */


/* Datumsfelder in den neuen Einsatzzeilen breiter */
.on-call-create-repeat-row
.on-call-assignment-grid {
    grid-template-columns:
        minmax(125px, 0.95fr)
        minmax(190px, 1.45fr)
        minmax(95px, 0.72fr)
        minmax(95px, 0.72fr)
        minmax(105px, 0.82fr)
        minmax(105px, 0.78fr);
}


/* erstes Datumsfeld sichtbar breiter */
.on-call-create-repeat-row
input[type="date"] {
    min-width: 125px;
}


/* erste Zeile eines Bereichs darf niemals Minus zeigen */
[data-on-call-travel-list]
[data-on-call-travel-row]:first-child
[data-on-call-row-remove],
[data-on-call-local-list]
[data-on-call-local-row]:first-child
[data-on-call-row-remove] {
    display: none !important;
}


/* ab zweiter Zeile Minus normal anzeigen */
[data-on-call-travel-list]
[data-on-call-travel-row]:not(:first-child)
[data-on-call-row-remove],
[data-on-call-local-list]
[data-on-call-local-row]:not(:first-child)
[data-on-call-row-remove] {
    display: inline-flex;
}


/* Buttons sauber ausrichten */
.on-call-create-row-actions {
    min-height: 38px;
}


/* Mobile bleibt responsiv */
@media (max-width: 780px) {

    .on-call-create-repeat-row
    .on-call-assignment-grid {
        grid-template-columns: 1fr;
    }

    .on-call-create-repeat-row
    input[type="date"] {
        width: 100%;
        min-width: 0;
    }

}


/* ==========================================================
   Bereitschaft · wiederholte Einsatzzeilen kompakter
   ========================================================== */

.on-call-create-repeat-row
+ .on-call-create-repeat-row {
    margin-top: 10px;
    padding-top: 10px;
}

.on-call-create-row-actions {
    margin-top: 6px;
}

@media (max-width: 780px) {

    .on-call-create-repeat-row
    + .on-call-create-repeat-row {
        margin-top: 12px;
        padding-top: 12px;
    }

    .on-call-create-row-actions {
        margin-top: 8px;
    }

}


/* ==========================================================
   Bereitschaft · Einsatzzeilen noch kompakter
   ========================================================== */

.on-call-create-repeat-row
+ .on-call-create-repeat-row {
    margin-top: 4px;
    padding-top: 4px;
}

.on-call-create-row-actions {
    margin-top: 2px;
    min-height: 34px;
}

.on-call-create-repeat-row
.on-call-assignment-grid {
    row-gap: 4px;
}


/* Abstand zwischen letztem Einsatz und nächstem Abschnitt */
.on-call-create-assignment-section
+ .on-call-create-assignment-section {
    margin-top: 14px;
    padding-top: 14px;
}


@media (max-width: 780px) {

    .on-call-create-repeat-row
    + .on-call-create-repeat-row {
        margin-top: 6px;
        padding-top: 6px;
    }

    .on-call-create-row-actions {
        margin-top: 4px;
    }

}


/* ==========================================================
   Bereitschaft · Einsatzzeilen sehr kompakt
   ========================================================== */

.on-call-create-repeat-row
+ .on-call-create-repeat-row {
    margin-top: 0;
    padding-top: 0;
}

.on-call-create-row-actions {
    margin-top: 0;
    min-height: 28px;
}

.on-call-create-repeat-row
.on-call-assignment-grid {
    row-gap: 0;
}


/* Abschnittsabstand ebenfalls etwas reduzieren */
.on-call-create-assignment-section
+ .on-call-create-assignment-section {
    margin-top: 10px;
    padding-top: 10px;
}


@media (max-width: 780px) {

    .on-call-create-repeat-row
    + .on-call-create-repeat-row {
        margin-top: 2px;
        padding-top: 2px;
    }

    .on-call-create-row-actions {
        margin-top: 0;
        min-height: 30px;
    }

}


/* ==========================================================
   Bereitschaft · optische Trennung der Einsatzbereiche
   ========================================================== */

.on-call-create-assignment-section
+ .on-call-create-assignment-section {
    margin-top: 22px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(80, 90, 105, 0.18);
}


/* Mobile etwas kompakter */
@media (max-width: 780px) {

    .on-call-create-assignment-section
    + .on-call-create-assignment-section {
        margin-top: 18px;
        padding-top: 18px;
    }

}


/* ==========================================================
   Bereitschaft · mehr Abstand vor "Eintrag speichern"
   ========================================================== */

.on-call-create-assignment-area
+ .primary-button {
    margin-top: 24px;
}


/* PWA / Mobile etwas großzügiger */
@media (max-width: 780px) {

    .on-call-create-assignment-area
    + .primary-button {
        margin-top: 28px;
    }

}


/* ==========================================================
   Bereitschaft · leere Einsatzbereiche mit Plus
   ========================================================== */

[data-on-call-prototype] {
    display: none !important;
}


/* Wenn noch keine Zeile existiert */
.on-call-empty-add {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    margin-top: 8px;
}


/* hidden muss auch bei flex sicher greifen */
.on-call-empty-add[hidden] {
    display: none !important;
}


/*
 * Neue Logik:
 * Auch die erste per + erzeugte Zeile kann mit −
 * wieder vollständig entfernt werden.
 */
[data-on-call-travel-list]
[data-on-call-travel-row]:not([data-on-call-prototype])
[data-on-call-row-remove],
[data-on-call-local-list]
[data-on-call-local-row]:not([data-on-call-prototype])
[data-on-call-row-remove] {
    display: inline-flex !important;
}


/* Aktionsbereich weiterhin kompakt */
.on-call-create-row-actions {
    margin-top: 0;
    min-height: 28px;
}


/* Abstand vor dem nächsten Hauptbereich bleibt erhalten */
.on-call-create-assignment-section
+ .on-call-create-assignment-section {
    margin-top: 22px;
    padding-top: 22px;
}


@media (max-width: 780px) {

    .on-call-empty-add {
        margin-top: 10px;
    }

}





/* ==========================================================
   Bereitschaft · LRE3 Checkbox wieder kompakt
   Position unverändert lassen
   ========================================================== */

.on-call-x-choice {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    min-height: 46px;

    padding: 0;
    margin: 0;

    background: transparent;
    border-radius: 0;

    cursor: pointer;
}


/* Text wieder ausblenden */
.on-call-x-choice > span {
    display: none !important;
}


/* kompakte Design-Checkbox */
.on-call-x-choice input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;

    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    min-height: 30px;

    margin: 0;

    border: 2px solid #b9bec7;
    border-radius: 7px;

    background: #ffffff;

    cursor: pointer;
}


/* ausgewählt */
.on-call-x-choice input[type="checkbox"]:checked {
    border-color: #cf2935;
    background-color: #cf2935;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12.5l4 4L19 7'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}


/* keine zusätzliche Verschiebung mehr */
.on-call-lre3-field {
    justify-content: initial;
}

.on-call-lre3-field .on-call-x-choice {
    margin-top: 0 !important;
}



/* ==========================================================
   Bereitschaft · Einträge im Monat · Autosave
   ========================================================== */


/*
 * Der Zettel selbst wird automatisch gespeichert.
 */
.on-call-sheet-list
.on-call-sheet-edit-form
.allowance-entry-actions {
    display: none !important;
}


/*
 * Bestehende Einsätze werden automatisch gespeichert.
 * "Einsatz speichern" / "Eintrag speichern" entfällt.
 */
.on-call-sheet-list
.on-call-assignment-card:not(.on-call-assignment-card--new)
.on-call-assignment-actions {
    display: none !important;
}


/*
 * Unten ist reine Bearbeitung.
 * Neue Einsätze werden oben über "Eintrag hinzufügen"
 * erfasst.
 */
.on-call-sheet-list
.on-call-assignment-card--new {
    display: none !important;
}


/* Überschrift "Einsatz hinzufügen" etc. damit ebenfalls weg */
.on-call-sheet-list
.on-call-assignment-card--new
+ * {
    /* absichtlich leer – keine Nachbarelemente verstecken */
}


/*
 * Bestehender Fahrt-Einsatz:
 * gleiche kompakte Feldaufteilung wie oben.
 */
@media (min-width: 1101px) {

    .on-call-sheet-list
    .on-call-assignment-card
    .on-call-assignment-grid {
        grid-template-columns:
            minmax(105px, 0.90fr)
            minmax(180px, 1.55fr)
            minmax(88px, 0.72fr)
            minmax(88px, 0.72fr)
            minmax(105px, 0.82fr)
            minmax(100px, 0.82fr);

        gap: 10px;
    }

}


/*
 * km wird nur bei LRE1 / LRE2 gezeigt.
 * Dadurch hängt die Darstellung nicht mehr allein
 * am HTML-hidden-Attribut.
 */
.on-call-sheet-list
[data-travel-assignment-form]:not(.has-lre)
[data-km-field] {
    display: none !important;
}

.on-call-sheet-list
[data-travel-assignment-form].has-lre
[data-km-field] {
    display: block !important;
}


/*
 * Bestehende Einsätze untereinander kompakt.
 */
.on-call-sheet-list
.on-call-assignment-card:not(.on-call-assignment-card--new) {
    margin-top: 0;
    padding-top: 8px;
    padding-bottom: 4px;
}


/*
 * Löschen bleibt separat und gut erreichbar.
 */
.on-call-sheet-list
.on-call-inline-delete {
    margin-top: 4px;
    margin-bottom: 6px;
}


/*
 * KEINE Trennlinie zwischen einzelnen Einsätzen.
 */
.on-call-sheet-list
.on-call-assignment-card
+ .on-call-assignment-card {
    border-top: 0;
}


/*
 * Eine klare Trennung ausschließlich zwischen:
 *
 * Einsätze mit Hin- und Rückfahrt
 * --------------------------------
 * Selbstgewählter Ort / Telefonate
 */
.on-call-sheet-list
.on-call-assignment-section
+ .on-call-assignment-section {
    margin-top: 24px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(80, 90, 105, 0.20);
}


/*
 * Autosave-Status dezent unten rechts.
 */
.on-call-autosave-status {
    display: block;

    min-height: 17px;

    margin-top: 5px;

    font-size: 11px;
    line-height: 1.3;
    text-align: right;

    opacity: 0.72;
}

.on-call-autosave-status.is-saving {
    opacity: 0.58;
}

.on-call-autosave-status.is-saved {
    opacity: 0.70;
}

.on-call-autosave-status.is-error {
    color: #cf2935;
    opacity: 1;
}


@media (max-width: 1100px) {

    /*
     * Auf schmaleren Geräten wieder responsiv.
     * Die bestehende PWA-Darstellung bleibt erhalten.
     */
    .on-call-sheet-list
    .on-call-assignment-card
    .on-call-assignment-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .on-call-sheet-list
    .on-call-assignment-description {
        grid-column: 1 / -1;
    }

}


@media (max-width: 780px) {

    .on-call-sheet-list
    .on-call-assignment-section
    + .on-call-assignment-section {
        margin-top: 20px;
        padding-top: 18px;
    }

}


/* ==========================================================
   Bereitschaft · Einträge im Monat · Plus / Minus
   ========================================================== */


/*
 * Verstecktes Neuanlageformular wird ausschließlich
 * nach Klick auf + geöffnet.
 */
.on-call-sheet-list
.on-call-assignment-card--new {
    display: none !important;
}

.on-call-sheet-list
.on-call-assignment-card--new.is-active {
    display: block !important;

    margin-top: 8px;
    padding-top: 8px;
}


/* alter Titel / klassischer Submit bleibt weg */
.on-call-sheet-list
.on-call-assignment-card--new
> h4,

.on-call-sheet-list
.on-call-assignment-card--new
> button[type="submit"] {
    display: none !important;
}


/*
 * − und + wie oben.
 */
.on-call-bottom-row-actions {
    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap: 8px;

    margin-top: 5px;
    margin-bottom: 7px;
}


/*
 * Die bisherigen Delete-Formulare haben eigene
 * margin-Regeln; hier bewusst überschreiben.
 */
.on-call-sheet-list
form.on-call-inline-delete.on-call-bottom-row-actions {
    margin-top: 5px;
    margin-bottom: 7px;
}


/*
 * Zwischen einzelnen Einträgen keine Linie.
 */
.on-call-sheet-list
.on-call-assignment-card:not(.on-call-assignment-card--new) {
    border-top: 0 !important;
}


/*
 * Die gewünschte Linie bleibt ausschließlich zwischen
 * Fahrt und Selbstgewähltem Ort / Telefonaten.
 */
.on-call-sheet-list
.on-call-assignment-section
+ .on-call-assignment-section {
    margin-top: 24px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(80, 90, 105, 0.20);
}


/*
 * Touchfreundliche Aktionsbuttons.
 */
.on-call-sheet-list
.on-call-bottom-row-actions
.allowance-create-add,

.on-call-sheet-list
.on-call-bottom-row-actions
.allowance-create-remove {
    min-width: 38px;
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}


@media (max-width: 780px) {

    .on-call-sheet-list
    .on-call-bottom-row-actions
    .allowance-create-add,

    .on-call-sheet-list
    .on-call-bottom-row-actions
    .allowance-create-remove {
        min-width: 44px;
        min-height: 44px;
    }

}


/* ==========================================================
   Bereitschaft · Einträge im Monat · Datum kompakt
   ========================================================== */

/*
 * Nur das äußere Feld begrenzen.
 * Das native iOS-Date-Feld selbst bleibt weiterhin mit der
 * bestehenden WebKit/Flex-Lösung bei 100 % seines Wrappers.
 */
.on-call-sheet-list
.on-call-assignment-card
.field:has(input[type="date"]) {
    width: 170px;
    max-width: 170px;
    min-width: 0;
    justify-self: start;
}


/*
 * Auch die neu aufgeklappte + Zeile soll dieselbe Breite haben.
 */
.on-call-sheet-list
.on-call-assignment-card--new
.field:has(input[type="date"]) {
    width: 170px;
    max-width: 170px;
}


@media (max-width: 480px) {

    .on-call-sheet-list
    .on-call-assignment-card
    .field:has(input[type="date"]) {
        width: 160px;
        max-width: 160px;
    }

}


/* ==========================================================
   Bereitschaft · zentral speichern
   ========================================================== */

.on-call-autosave-status {
    display: none !important;
}


.on-call-sheet-save-all {
    margin-top: 30px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(80, 90, 105, 0.20);
}


.on-call-sheet-save-all .primary-button {
    width: 100%;
    min-height: 48px;
}


.on-call-save-all-status {
    display: block;

    min-height: 20px;

    margin-top: 8px;

    text-align: center;
    font-size: 12px;
    opacity: 0.72;
}


.on-call-save-all-status.is-error {
    color: #cf2935;
    opacity: 1;
}


/* ==========================================================
   Bereitschaft · Datum unten kompakt
   ========================================================== */

/*
 * Eigene Markup-Klasse statt :has().
 * So greifen keine allgemeinen mobilen .field-Regeln
 * mehr ungewollt auf die gewünschte Breite durch.
 */
.on-call-sheet-list
.on-call-assignment-date-field {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;

    justify-self: start !important;
}


.on-call-sheet-list
.on-call-assignment-date-field
.on-call-native-input-wrap {
    width: 170px !important;
    min-width: 0 !important;
    max-width: 170px !important;
}


/*
 * Das native Date-Control selbst bleibt weiterhin
 * mit der bereits funktionierenden iOS-WebKit-Regel
 * unverändert.
 */
.on-call-sheet-list
.on-call-assignment-date-field
input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}


@media (max-width: 480px) {

    .on-call-sheet-list
    .on-call-assignment-date-field {
        width: 155px !important;
        min-width: 155px !important;
        max-width: 155px !important;
    }


    .on-call-sheet-list
    .on-call-assignment-date-field
    .on-call-native-input-wrap {
        width: 155px !important;
        max-width: 155px !important;
    }

}


/* ==========================================================
   Bereitschaft · Einträge im Monat · finaler Speicherstand
   ========================================================== */


/*
 * Die alten Einzel-Speicherbuttons bleiben unsichtbar.
 */
.on-call-sheet-list
.on-call-sheet-edit-form
.allowance-entry-actions,

.on-call-sheet-list
.on-call-assignment-actions,

.on-call-sheet-list
.on-call-assignment-card--new
> button[type="submit"] {
    display: none !important;
}


/*
 * Zentraler Speicherbutton ganz unten im geöffneten Zettel.
 */
.on-call-sheet-list
.on-call-sheet-save-all {
    margin-top: 28px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(80, 90, 105, 0.20);
}


.on-call-sheet-list
.on-call-sheet-save-all
.primary-button {
    width: 100%;
    margin: 0;

    min-height: 50px;
}


.on-call-save-all-status {
    display: block;

    min-height: 18px;
    margin-top: 8px;

    text-align: center;

    font-size: 12px;
    opacity: .72;
}


.on-call-save-all-status.is-error {
    color: #c72832;
    opacity: 1;
}


/*
 * Untere Datumsfelder:
 * bewusst kompakter als Beschreibung / übrige Felder.
 *
 * Die bestehende funktionierende native iOS-Regel für
 * input[type=date] wird NICHT verändert.
 */
.on-call-sheet-list
.on-call-assignment-date-field {
    width: 155px !important;
    min-width: 155px !important;
    max-width: 155px !important;

    justify-self: start !important;
}


.on-call-sheet-list
.on-call-assignment-date-field
.on-call-native-input-wrap {
    width: 155px !important;
    min-width: 0 !important;
    max-width: 155px !important;
}


.on-call-sheet-list
.on-call-assignment-date-field
input[type="date"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}


@media (max-width: 480px) {

    .on-call-sheet-list
    .on-call-assignment-date-field {
        width: 145px !important;
        min-width: 145px !important;
        max-width: 145px !important;
    }


    .on-call-sheet-list
    .on-call-assignment-date-field
    .on-call-native-input-wrap {
        width: 145px !important;
        max-width: 145px !important;
    }

}


/* ==========================================================
   Bereitschaft · Feldbreiten final
   ========================================================== */


/*
 * Bereitschaftszeiten Von/Bis:
 * jede Hälfte darf exakt innerhalb ihres Gridbereiches bleiben.
 */
.on-call-sheet-list
.on-call-period-row__times {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}


.on-call-sheet-list
.on-call-period-row__times > .field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin-bottom: 0;
}


.on-call-sheet-list
.on-call-period-row__times
.on-call-native-input-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}


.on-call-sheet-list
.on-call-period-row__times
input[type="time"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}


/*
 * Alle unteren Grid-Felder dürfen niemals breiter
 * als ihre eigene CSS-Grid-Spalte werden.
 */
.on-call-sheet-list
.on-call-assignment-grid > .field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}


.on-call-sheet-list
.on-call-assignment-grid
input,

.on-call-sheet-list
.on-call-assignment-grid
select,

.on-call-sheet-list
.on-call-assignment-grid
.on-call-native-input-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
}


/*
 * DESKTOP:
 * keine feste 145/155/170-px-Breite beim Datum.
 * Es benutzt exakt seine Grid-Spalte.
 */
@media (min-width: 781px) {

    .on-call-sheet-list
    .on-call-assignment-date-field,

    .on-call-sheet-list
    .on-call-assignment-card
    .field:has(input[type="date"]) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }


    .on-call-sheet-list
    .on-call-assignment-date-field
    .on-call-native-input-wrap,

    .on-call-sheet-list
    .on-call-assignment-card
    .field:has(input[type="date"])
    .on-call-native-input-wrap {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

}


/*
 * MOBIL:
 * Zwei saubere gleich große Spalten für Beginn/Ende.
 * Das Datum darf kompakt bleiben.
 */
@media (max-width: 780px) {

    .on-call-sheet-list
    .on-call-period-row__times {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 12px !important;
    }


    .on-call-sheet-list
    .on-call-assignment-date-field {
        width: 145px !important;
        min-width: 145px !important;
        max-width: 145px !important;

        justify-self: start !important;
    }


    .on-call-sheet-list
    .on-call-assignment-date-field
    .on-call-native-input-wrap {
        width: 145px !important;
        max-width: 145px !important;
    }

}


/* ==========================================================
   Bereitschaft · Plus/Minus final bereinigen
   ========================================================== */

/*
 * Sobald eine neue Zeile geöffnet ist,
 * darf das einzelne Abschnitts-Plus oben nicht mehr erscheinen.
 */
.on-call-sheet-list
.on-call-assignment-section:has(
    .on-call-assignment-card--new.is-active
)
[data-on-call-empty-bottom-controls] {
    display: none !important;
}


/*
 * Falls durch die bisherige JS-Logik zwei Plusbuttons
 * nebeneinander erzeugt wurden:
 * immer nur den ersten anzeigen.
 */
.on-call-sheet-list
.on-call-bottom-row-actions
.allowance-create-add
+ .allowance-create-add {
    display: none !important;
}



/* ==========================================================
   Bereitschaft · Plus/Minus unten final
   ========================================================== */

.on-call-sheet-list
[data-on-call-bottom-template]:not(.is-active) {
    display: none !important;
}


/*
 * Pro Aktionszeile:
 * sauber rechtsbündig − / +
 */
.on-call-sheet-list
.on-call-bottom-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    gap: 8px;

    margin-top: 7px;
    margin-bottom: 8px;
}


/*
 * Keine alten CSS-Hacks mehr nötig:
 * sichtbare Buttons bleiben sichtbar.
 */
.on-call-sheet-list
.on-call-bottom-row-actions
.allowance-create-add[hidden] {
    display: none !important;
}



/* ==========================================================
   Bereitschaft · alle +/- Buttons klein und viereckig
   ========================================================== */

.on-call-sheet-page
.allowance-create-add,

.on-call-sheet-page
.allowance-create-remove {
    flex: 0 0 38px !important;

    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;

    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;

    margin: 0 !important;
    padding: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 1px solid var(--border) !important;
    border-radius: 10px !important;

    background: var(--surface-soft) !important;
    color: var(--text) !important;

    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    cursor: pointer;
}


/*
 * Aktionsleisten immer rechtsbündig.
 */
.on-call-sheet-page
.on-call-create-row-actions,

.on-call-sheet-page
.on-call-bottom-row-actions,

.on-call-sheet-page
.on-call-empty-add {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;

    gap: 8px !important;
}


/*
 * Alte Abstandsregel zwischen − und + neutralisieren.
 */
.on-call-sheet-page
.allowance-create-remove
+ .allowance-create-add {
    margin-left: 0 !important;
}


/*
 * Mobil ebenfalls klein und viereckig.
 */
@media (max-width: 780px) {

    .on-call-sheet-page
    .allowance-create-add,

    .on-call-sheet-page
    .allowance-create-remove {
        flex-basis: 38px !important;

        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;

        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;

        border-radius: 10px !important;
    }

}


/* ==========================================================
   Bereitschaft · Eintrag hinzufügen
   leeres + wirklich nur anzeigen, wenn keine Zeile vorhanden ist
   ========================================================== */

.on-call-sheet-page
.on-call-empty-add[hidden] {
    display: none !important;
}


/* =========================================================
   BÜRO – SYSTEMSTATUS-AMPEL
   ========================================================= */

.office-health-card {
    display: flex;
    align-items: center;
    gap: 13px;

    min-height: 74px;
    margin-top: 14px;
    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface-soft);

    transition:
        background-color .2s ease,
        border-color .2s ease;
}

.office-health-card__dot {
    flex: 0 0 13px;

    width: 13px;
    height: 13px;

    border-radius: 50%;
    background: var(--muted);

    box-shadow: 0 0 0 5px rgba(128, 128, 128, .10);
}

.office-health-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.office-health-card__content strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--text);
}

.office-health-card__content small {
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted);
}

.office-health-card--green {
    border-color: rgba(31, 157, 98, .32);
    background: rgba(31, 157, 98, .08);
}

.office-health-card--green .office-health-card__dot {
    background: #1f9d62;
    box-shadow: 0 0 0 5px rgba(31, 157, 98, .13);
}

.office-health-card--yellow {
    border-color: rgba(213, 151, 22, .35);
    background: rgba(213, 151, 22, .09);
}

.office-health-card--yellow .office-health-card__dot {
    background: #d59716;
    box-shadow: 0 0 0 5px rgba(213, 151, 22, .14);
}

.office-health-card--red {
    border-color: rgba(199, 40, 50, .35);
    background: rgba(199, 40, 50, .08);
}

.office-health-card--red .office-health-card__dot {
    background: #c72832;
    box-shadow: 0 0 0 5px rgba(199, 40, 50, .13);
}

.office-health-card--unknown .office-health-card__dot {
    background: #89919d;
    box-shadow: 0 0 0 5px rgba(137, 145, 157, .13);
}

@media (max-width: 560px) {
    .office-health-card {
        min-height: 68px;
        padding: 12px 14px;
    }

    .office-health-card__content strong {
        font-size: 14px;
    }
}

/* =========================================================
   ADMIN – SYSTEMSTATUS-KACHEL
   ========================================================= */

.system-health-card {
    margin-top: 12px;
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);
    min-width: 0;
}

.system-health-card__heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 16px;
}

.system-health-card__heading > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.system-health-card__heading strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--text);
}

.system-health-card__heading small {
    font-size: 13px;
    color: var(--muted);
}

.system-health-card__dot {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #89919d;
    box-shadow: 0 0 0 5px rgba(137,145,157,.12);
}

.system-health-card--green {
    border-color: rgba(31,157,98,.30);
    background: rgba(31,157,98,.055);
}

.system-health-card--green .system-health-card__dot {
    background: #1f9d62;
    box-shadow: 0 0 0 5px rgba(31,157,98,.14);
}

.system-health-card--yellow {
    border-color: rgba(213,151,22,.35);
    background: rgba(213,151,22,.06);
}

.system-health-card--yellow .system-health-card__dot {
    background: #d59716;
    box-shadow: 0 0 0 5px rgba(213,151,22,.14);
}

.system-health-card--red {
    border-color: rgba(199,40,50,.35);
    background: rgba(199,40,50,.06);
}

.system-health-card--red .system-health-card__dot {
    background: #c72832;
    box-shadow: 0 0 0 5px rgba(199,40,50,.14);
}

.system-health-card__details {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.system-health-card__details > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    min-width: 0;
    padding: 12px 13px;
}

.system-health-card__details > div + div {
    border-top: 1px solid var(--border);
}

.system-health-card__details span {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.system-health-card__details strong {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 750;
    color: var(--text);
    text-align: right;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.system-health-card__details strong[data-health-state="ok"] {
    color: #36b77a;
}

.system-health-card__details strong[data-health-state="error"] {
    color: #f26d76;
}

.system-health-card__details strong[data-health-state="unknown"] {
    color: var(--muted);
}

.system-health-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: 15px;
}

.system-health-card__footer small {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.system-health-card__footer .secondary-button {
    min-height: 42px;
    margin: 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    white-space: normal;
    text-align: center;
}

.system-health-card__footer .secondary-button:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 560px) {
    .system-health-card {
        padding: 14px;
    }

    .system-health-card__details > div {
        padding: 12px 11px;
        gap: 8px;
    }

    .system-health-card__details span,
    .system-health-card__details strong {
        font-size: 12px;
    }

    .system-health-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .system-health-card__footer .secondary-button {
        width: 100%;
    }
}


/* Manuelle Datensicherung */
.backup-status-content {
    flex: 1 1 auto;
}

.manual-backup-actions {
    margin-left: auto;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.manual-backup-actions .secondary-button {
    min-height: 42px;
    white-space: nowrap;
}

.manual-backup-actions .secondary-button:disabled {
    opacity: .65;
    cursor: wait;
}

.manual-backup-message {
    max-width: 260px;
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
}

.manual-backup-message:empty {
    display: none;
}

.manual-backup-message--success {
    color: #1f9d62;
}

.manual-backup-message--error {
    color: #d45e5e;
}

@media (max-width: 700px) {
    .backup-status-card {
        flex-wrap: wrap;
    }

    .manual-backup-actions {
        flex: 1 0 100%;
        margin-left: 0;
        align-items: stretch;
        padding-left: 22px;
    }

    .manual-backup-actions .secondary-button {
        width: 100%;
    }

    .manual-backup-message {
        max-width: none;
        text-align: left;
    }
}
