:root {
    --yellow: #ffd400;
    --dark: #222428;
    --grey: #3b3e46;
    --light-grey: #edeff4;
    --card-bg: #ffffff;
    --border: #d9dbe1;
    --text-muted: #6b6f7a;
    --accent-gradient: linear-gradient(135deg, #2c2e33 0%, #3b3e46 100%);
    --hero-height: 120px;
    --page-gutter: clamp(0.25rem, 0.5vw, 0.75rem);
    --panel-padding: clamp(1.25rem, 1.6vw, 2rem);
    --kpi-diff-positive: #166534;
    --kpi-diff-negative: #b91c1c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--light-grey);
    color: var(--dark);
    line-height: 1.5;
    padding-top: var(--hero-height);
}

/* Smooth theme transitions for common surfaces */
body, .card, .employee-sidebar, .panel, .metric, .stat-item, .team-list li, .modal-dialog {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Shared shadow for widgets */
.card,
.panel,
.metric,
.stat-item,
.team-list li,
.download-item,
.comment-list-card #comment-list .note-entry,
#central-comment-list .note-entry {
    box-shadow: 0 10px 26px rgba(34, 36, 40, 0.12);
}

body.modal-open {
    overflow: hidden;
    padding-right: var(--modal-scrollbar-comp, 0px);
}

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

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem var(--page-gutter);
    min-height: var(--hero-height);
    background: var(--accent-gradient);
    color: #fefefe;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    z-index: 1000;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 30%, rgba(255, 212, 0, 0.2), transparent 60%);
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 1;
}

.brand .logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--dark);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-text p {
    margin: 0.25rem 0 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-nav {
    display: flex;
    gap: 1rem;
    font-weight: 600;
    z-index: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font: inherit;
}

.nav-btn:hover {
    color: var(--yellow);
}

.nav-btn.active {
    background: rgba(255, 212, 0, 0.2);
    color: var(--yellow);
}

main {
    width: 100%;
    margin: 0 0 4rem;
    padding: 2rem var(--page-gutter) 0;
}

.panel {
    background: var(--card-bg);
    border-radius: 18px;
    padding: var(--panel-padding);
    box-shadow: 0 20px 40px rgba(34, 36, 40, 0.08);
    margin-bottom: 2.5rem;
}

.placeholder-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(18rem, 55vh, 28rem);
}

.placeholder-content {
    width: 100%;
    text-align: center;
}

.placeholder-title {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 600;
    color: inherit;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.panel-header p {
    margin: 0.5rem 0 1rem;
    color: var(--text-muted);
}

.panel-header--compact {
    margin-bottom: 0.5rem;
}

.panel-header__intro--tight h2 {
    margin-bottom: 0;
}

.panel-header--employees {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0 0 1.5rem;
}

.panel-header--employees::after {
    content: "";
    flex: 1 1 320px;
    min-width: 240px;
}

.panel-header--employees .panel-header__intro {
    flex: 1 1 320px;
    min-width: 240px;
    margin-right: auto;
}

.panel-header--dispo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 1.5rem;
}
.panel-header--dispo .panel-header__intro {
    flex: 1 1 280px;
    min-width: 220px;
}
.dispo-month-controls {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.dispo-month-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    min-width: 2.25rem;
}
.dispo-month-button span {
    pointer-events: none;
}
.dispo-month-button:hover {
    background-color: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.4);
    color: #2f58d6;
}
.dispo-month-button:focus-visible {
    outline: 3px solid rgba(76, 139, 255, 0.35);
    outline-offset: 2px;
}
.dispo-month-button:disabled {
    opacity: 0.55;
    cursor: default;
}
.dispo-month-button--today {
    padding-inline: 1rem;
    background-color: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.45);
    color: #2f58d6;
}
.dispo-month-button--today:hover {
    background-color: rgba(76, 139, 255, 0.18);
}
.dispo-month-select.employee-month-select {
    margin: 0;
}

.dispo-calendar-card {
    width: 100%;
    margin: 0;
    gap: 1.25rem;
    align-self: stretch;
    flex: 1 1 auto;
}
.dispo-calendar-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.dispo-calendar-card__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
}
.dispo-calendar {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 0.8vw, 1rem);
    width: 100%;
}
.dispo-calendar__weekdays,
.dispo-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(0.4rem, 0.6vw, 0.75rem);
    width: 100%;
}
.dispo-calendar__weekdays span {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.dispo-calendar__day {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: clamp(0.5rem, 0.7vw, 0.85rem);
    border-radius: 12px;
    border: 1px solid rgba(217, 219, 225, 0.85);
    font-weight: 600;
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: var(--dark);
    background: rgba(255, 255, 255, 0.92);
    min-height: clamp(4.5rem, 7.5vw, 6.5rem);
    position: relative;
    box-shadow: 0 6px 14px rgba(34, 36, 40, 0.04);
}
.dispo-calendar__day-number {
    font-weight: 700;
}
.dispo-calendar__day--today {
    border-color: rgba(76, 139, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(76, 139, 255, 0.18);
}
.dispo-calendar__day--weekend {
    background: rgba(76, 139, 255, 0.12);
}
.dispo-calendar__day--empty {
    border-style: dashed;
    border-color: rgba(217, 219, 225, 0.5);
    color: rgba(107, 111, 122, 0.45);
    background: transparent;
    box-shadow: none;
}
.dispo-weekplan-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.dispo-weekplan-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.dispo-weekplan-table-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.dispo-weekplan-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.dispo-weekplan-table-block h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}
.dispo-weekplan-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dispo-weekplan-card__header--center {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.dispo-weekplan-card__intro h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}
.dispo-weekplan-card__subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.dispo-weekplan-card__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.dispo-weekplan-select {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}
.dispo-weekplan-select select {
    min-width: 220px;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 600;
}
.dispo-weekplan-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.dispo-weekplan-table-wrapper {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    background: var(--card-bg);
}
.dispo-weekplan-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    font-size: 0.9rem;
    table-layout: fixed;
}
.dispo-weekplan-table th,
.dispo-weekplan-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
    height: 2.2rem;
}
.dispo-weekplan__day-divider {
    border-right: 2px solid rgba(180, 184, 193, 0.9);
}
.dispo-weekplan__day-divider-left {
    border-left: 2px solid rgba(180, 184, 193, 0.9);
}
.dispo-weekplan__ats-cell {
    font-weight: 600;
    width: 3.5rem;
    overflow: hidden;
}
.dispo-weekplan__ats-cell--empty {
    background: rgba(255, 140, 0, 0.32);
}
.dispo-weekplan__ats-cell--low {
    background: rgba(255, 151, 49, 0.28);
}
.dispo-weekplan__ats-cell.is-positive {
    color: #1f8a4d;
}
.dispo-weekplan__ats-cell.is-negative {
    color: #c5342d;
}
.dispo-weekplan__comment-cell {
    text-align: center;
}
.dispo-comment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f7f8fb;
    color: #6b6f7a;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.dispo-comment-btn--has-comments {
    opacity: 1;
}
.dispo-comment-btn:hover,
.dispo-comment-btn:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.4);
    color: #2f58d6;
}
.dispo-comment-btn svg {
    width: 16px;
    height: 16px;
}
.xplus3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(34, 36, 40, 0.45);
    background: #fff;
    color: var(--dark);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.xplus3-btn:hover,
.xplus3-btn:focus-visible {
    background: rgba(34, 36, 40, 0.08);
    border-color: rgba(34, 36, 40, 0.75);
}
.xplus3-btn.is-empty {
    opacity: 0.5;
}
.xplus3-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.xplus3-value {
    font-variant-numeric: tabular-nums;
}
.dispo-weekplan__tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.dispo-weekplan__tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 36, 40, 0.45);
    background: #fff;
    color: #2f3034;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1;
}
.dispo-weekplan__tag.is-muted {
    opacity: 0.5;
}
.auftraege-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #c5342d;
    color: #fff;
    font-weight: 700;
    min-width: 1.5rem;
}
.auftraege-badge.is-confirmed {
    background: #1f8a4d;
}
.xplus3-time-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.xplus3-time-row label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.xplus3-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.xplus3-list-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.1rem 0 0;
}
.xplus3-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.xplus3-delete-btn:hover,
.xplus3-delete-btn:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.4);
    color: #2f58d6;
}
.dispo-weekplan__base-cell {
    width: 4.4rem;
}
.dispo-weekplan__base-subhead {
    width: 4.4rem;
}
.dispo-weekplan__ats-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font: inherit;
    text-align: center;
    appearance: textfield;
    box-sizing: border-box;
    height: 1.6rem;
    line-height: 1.6rem;
}
.dispo-weekplan__ats-input::-webkit-outer-spin-button,
.dispo-weekplan__ats-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.dispo-weekplan-table thead th {
    background: rgba(237, 239, 244, 0.9);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.dispo-weekplan-table thead th.dispo-weekplan__group-head {
    background: rgba(217, 219, 225, 0.6);
    color: var(--dark);
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0.02em;
}
.dispo-weekplan__name-head,
.dispo-weekplan__name-subhead,
.dispo-weekplan__name-cell {
    text-align: center;
    font-weight: 700;
    min-width: 0;
}
.dispo-weekplan__name-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}
.dispo-weekplan__name-button:hover,
.dispo-weekplan__name-button:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    outline: none;
}
.dispo-weekplan__team-head,
.dispo-weekplan__team-cell {
    text-align: left;
    font-weight: 700;
    min-width: 0;
}
.dispo-weekplan__team-head {
    text-align: center;
}
.dispo-weekplan__team-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}
.dispo-weekplan__group-head-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}
.dispo-weekplan__team-button:hover,
.dispo-weekplan__team-button:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    outline: none;
}
.dispo-weekplan-table tbody tr:hover {
    background: rgba(255, 212, 0, 0.12);
}
.dispo-weekplan-table tbody tr.dispo-weekplan__summary-divider td {
    border-top: 2px solid rgba(180, 184, 193, 0.9);
}

.preload-button {
    position: absolute;
    top: 0.5rem;
    right: 0;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.preload-button:hover:not(:disabled),
.preload-button:focus-visible {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(76, 139, 255, 0.15);
    outline: none;
}

.preload-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.preload-button.is-busy::after {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-left: 0.5rem;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: preload-spin 0.8s linear infinite;
    vertical-align: middle;
}

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

.employee-header-actions {
    position: absolute;
    top: 0.5rem;
    right: 0;
    display: inline-flex;
    gap: 0.5rem;
}

.employee-header-actions .preload-button {
    position: static;
}

.employee-month-select {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    align-items: center;
    text-align: center;
    margin: 0 auto;
}

.employee-month-select .employee-interval-switch {
    margin-bottom: 0.1rem;
}

.employee-month-select .switch-button {
    font-size: 0.9rem;
    padding: 0.4rem 0.95rem;
}

.employee-month-select select {
    min-width: 190px;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    font-size: 0.98rem;
    font-weight: 600;
}

.employee-month-select select:focus {
    outline: none;
    border-color: rgba(76, 139, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(76, 139, 255, 0.12);
}

.employee-month-select__label {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .panel-header--employees {
        flex-direction: column;
        align-items: stretch;
        padding-top: 1.25rem;
    }

    .panel-header--dispo {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .employee-header-actions {
        position: static;
        width: 100%;
        flex-direction: column;
        margin-top: 0.5rem;
    }

    .employee-header-actions .preload-button {
        width: 100%;
    }

    .employee-month-select {
        position: static;
        transform: none;
        margin: 0 auto;
        align-items: center;
    }

    .dispo-month-controls {
        justify-content: center;
    }

    .dispo-weekplan-card__actions {
        width: 100%;
        justify-content: center;
    }

    .dispo-weekplan-select,
    .dispo-weekplan-select select {
        width: 100%;
        min-width: 0;
    }

    .panel-header--employees::after {
        display: none;
    }

    .panel-body.panel-body--dispo {
        padding: 0;
    }

    .dispo-calendar__grid {
        gap: 0.4rem;
    }

    .dispo-calendar__day {
        min-height: clamp(3.6rem, 24vw, 5.5rem);
    }
}

.panel-body {
    display: grid;
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: clamp(1rem, 1.4vw, 1.75rem);
    align-items: stretch;
}

.panel-body--compact {
    display: block;
}

.panel-body.panel-body--dispo {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2vw, 2.5rem);
    padding: 0;
    align-items: stretch;
}

#dispo.panel {
    margin-left: calc(var(--page-gutter) * -1);
    margin-right: calc(var(--page-gutter) * -1);
    border-radius: 0;
    box-shadow: none;
}
/* KPI Analytics */
#kpi-analytics .panel-body {
    display: block;
    padding-bottom: 6rem;
}

#ablage .panel-body {
    display: block;
}

#admin .panel-body {
    display: block;
}

#kpi-analytics .panel-header--analytics {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

#kpi-analytics .panel-header__intro {
    flex: 1 1 320px;
    min-width: 260px;
}

.analytics-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin: 0;
}
#kpi-analytics .analytics-config .preload-button {
    position: static;
}

.interval-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
}

.switch-button {
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.switch-button:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--text-primary, #111827);
}

.switch-button.is-active {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.context-select {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.95rem;
    border-radius: 16px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    min-width: 280px;
}

.context-select__label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

.context-select select {
    border: none;
    background: transparent;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    min-width: 200px;
    padding: 0;
}

.context-select select:focus {
    outline: none;
}

.analytics-board {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 2vw, 2.4rem);
    margin-top: 1.5rem;
}

.kpi-card-list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.35rem, 0.5vw, 0.6rem);
}

.kpi-card {
    display: block;
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(23, 37, 84, 0.05);
    padding: clamp(0.3rem, 0.5vw, 0.55rem) clamp(0.9rem, 1.3vw, 1.6rem);
}

.kpi-card__label {
    margin-bottom: clamp(0.1rem, 0.2vw, 0.25rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-card__label h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.35vw, 1.6rem);
    font-weight: 700;
    color: var(--dark);
}

.kpi-card__chart {
    position: relative;
    padding: clamp(0.15rem, 0.3vw, 0.35rem) clamp(0.15rem, 0.35vw, 0.4rem) clamp(0.2rem, 0.3vw, 0.35rem);
}
.kpi-card--orderload .kpi-card__chart {
    padding: clamp(0.25rem, 0.3vw, 0.4rem) clamp(0.25rem, 0.4vw, 0.5rem) clamp(0.35rem, 0.45vw, 0.6rem);
}
.kpi-card--orderload .kpi-card__line-periods {
    min-height: clamp(40px, 4vw, 56px);
}
.kpi-card--elq .kpi-card__chart {
    padding: clamp(0.25rem, 0.35vw, 0.45rem) clamp(0.25rem, 0.45vw, 0.55rem) clamp(0.4rem, 0.5vw, 0.65rem);
}
.kpi-card--elq .kpi-card__line-periods {
    min-height: clamp(40px, 4vw, 56px);
}
.orderload-legend {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0 0.25rem 0.25rem;
}
.elq-legend {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0 0.25rem 0.35rem;
}
.orderload-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.elq-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.orderload-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.elq-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.orderload-legend__swatch--bs {
    background: #2563eb;
}
.orderload-legend__swatch--mh {
    background: #10b981;
}
.orderload-legend__swatch--se {
    background: #f59e0b;
}

.orderload-chart {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.35rem;
}

.orderload-chart__donut {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(#2563eb 0deg 120deg, #10b981 120deg 240deg, #f59e0b 240deg 360deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.orderload-chart__donut::after {
    content: "";
    position: absolute;
    inset: 24%;
    background: var(--card-bg, #fff);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.orderload-chart__legend {
    display: grid;
    gap: 0.25rem;
}

.orderload-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--dark);
}

.orderload-chart__legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.orderload-chart__legend-swatch--bs {
    background: #2563eb;
}

.orderload-chart__legend-swatch--mh {
    background: #10b981;
}

.orderload-chart__legend-swatch--se {
    background: #f59e0b;
}
.elq-legend__swatch--elq {
    background: #2563eb;
}
.elq-legend__swatch--ordershare {
    background: #2563eb;
}
.orderload-legend__label {
    letter-spacing: 0.02em;
}
.elq-legend__label {
    letter-spacing: 0.02em;
}
.orderload-period-values {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: clamp(0.74rem, 0.85vw, 0.95rem);
}
.elq-period-values {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: clamp(0.74rem, 0.85vw, 0.95rem);
}
.orderload-period-value {
    font-weight: 700;
}
.elq-period-value {
    font-weight: 700;
}
.orderload-period-value--bs {
    color: #2563eb;
}
.orderload-period-value--mh {
    color: #0f9d84;
}
.orderload-period-value--se {
    color: #d97706;
}
.elq-period-value.is-series-elq {
    color: #2563eb;
}
.elq-period-value.is-series-ordershare {
    color: #d97706;
}
.kpi-card--orderload .kpi-card__line-path.is-series-bs {
    stroke: #2563eb;
    filter: none;
}
.kpi-card--orderload .kpi-card__line-path.is-series-mh {
    stroke: #0f9d84;
    filter: none;
}
.kpi-card--orderload .kpi-card__line-path.is-series-se {
    stroke: #d97706;
    filter: none;
}
.kpi-card--orderload .kpi-card__line-path {
    stroke-width: 2.4;
}
.kpi-card--elq .kpi-card__line-path.is-series-elq {
    stroke: #2563eb;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.25));
}
.kpi-card--elq .kpi-card__line-path.is-series-ordershare {
    stroke: #2563eb;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.25));
}
.kpi-card--orderload .kpi-card__line-point {
    display: none;
}
.kpi-card--elq .kpi-card__line-point {
    display: block;
    stroke: #fff;
    stroke-width: 1.6;
}
.kpi-card--orderload .kpi-card__line-point.is-series-bs {
    fill: #2563eb;
}
.kpi-card--orderload .kpi-card__line-point.is-series-mh {
    fill: #0f9d84;
}
.kpi-card--orderload .kpi-card__line-point.is-series-se {
    fill: #d97706;
}
.kpi-card--elq .kpi-card__line-point.is-series-elq {
    fill: #2563eb;
}
.kpi-card--elq .kpi-card__line-point.is-series-ordershare {
    fill: #2563eb;
}
.orderload-empty {
    margin: 0.35rem 0 0;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-card__line-chart {
    position: relative;
    width: 100%;
    min-height: clamp(90px, 12vh, 140px);
    height: clamp(110px, 16vh, 160px);
    overflow: visible;
}

.kpi-card__line-chart::before,
.kpi-card__line-chart::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.kpi-card__line-chart.has-baseline::before,
.kpi-card__line-chart.has-baseline::after {
    opacity: 1;
}

.kpi-card__line-chart::before {
    top: 0;
    height: var(--baseline-percent, 50%);
    background: rgba(16, 185, 129, 0.2);
}

.kpi-card__line-chart::after {
    bottom: 0;
    height: calc(100% - var(--baseline-percent, 50%));
    background: rgba(248, 113, 113, 0.22);
}

.kpi-card__line-chart.is-inverted::before {
    background: rgba(248, 113, 113, 0.22);
}

.kpi-card__line-chart.is-inverted::after {
    background: rgba(16, 185, 129, 0.2);
}

.kpi-card__line-chart.is-bonus-malus::before,
.kpi-card__line-chart.is-bonus-malus::after {
    opacity: 0;
}

.kpi-card__line-chart.is-bonus-malus {
    background: linear-gradient(
        to top,
        rgba(185, 28, 28, 0.32) 0%,
        rgba(185, 28, 28, 0.32) 30%,
        rgba(239, 68, 68, 0.28) 30%,
        rgba(239, 68, 68, 0.28) 40%,
        rgba(148, 163, 184, 0) 40%,
        rgba(148, 163, 184, 0) 70%,
        rgba(74, 222, 128, 0.28) 70%,
        rgba(74, 222, 128, 0.28) 80%,
        rgba(16, 122, 59, 0.32) 80%,
        rgba(16, 122, 59, 0.32) 90%,
        rgba(6, 95, 70, 0.38) 90%,
        rgba(6, 95, 70, 0.38) 100%
    );
}

.kpi-card__line-chart svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.kpi-quickview-card {
    --kpi-quickview-yaxis-width: 56px;
    --kpi-quickview-yaxis-gap: 10px;
}
.kpi-card--with-yaxis {
    --kpi-quickview-yaxis-width: 56px;
    --kpi-quickview-yaxis-gap: 10px;
}

.kpi-quickview-yaxis {
    position: absolute;
    left: calc(-1 * (var(--kpi-quickview-yaxis-width, 56px) + var(--kpi-quickview-yaxis-gap, 10px)));
    top: 6px;
    bottom: 6px;
    width: var(--kpi-quickview-yaxis-width, 56px);
    pointer-events: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    gap: 0.35rem;
    z-index: 2;
}

.kpi-quickview-yaxis span {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(34, 36, 40, 0.08);
    pointer-events: none;
    min-width: 0;
}

.kpi-quickview-gridline {
    stroke: rgba(100, 116, 139, 0.42);
    stroke-width: 0.6;
}

.kpi-quickview-card .kpi-card__chart {
    padding-left: calc(var(--kpi-quickview-yaxis-width, 56px) + var(--kpi-quickview-yaxis-gap, 10px));
}
.kpi-card--with-yaxis .kpi-card__chart {
    padding-left: calc(var(--kpi-quickview-yaxis-width, 56px) + var(--kpi-quickview-yaxis-gap, 10px));
}

.kpi-quickview-card .kpi-card__line-chart {
    width: 100%;
    margin-left: 0;
}
.kpi-card--with-yaxis .kpi-card__line-chart {
    width: 100%;
    margin-left: 0;
}

.kpi-card__line-path {
    fill: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    stroke: #111827;
    filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.15));
}
.kpi-card__line-path.is-positive {
    stroke: var(--kpi-diff-positive, #166534);
}
.kpi-card__line-path.is-negative {
    stroke: var(--kpi-diff-negative, #b91c1c);
}
.kpi-card__line-path.is-comparison {
    stroke: #2563eb;
    filter: drop-shadow(0 4px 14px rgba(37, 99, 235, 0.25));
}

.kpi-card__line-point {
    display: none;
}
.kpi-card__line-point.is-comparison {
    display: none;
}
.kpi-diff-label {
    font-size: 0.72rem;
    font-weight: 700;
    fill: var(--kpi-diff-positive);
    text-anchor: middle;
    dominant-baseline: middle;
}
.kpi-diff-label.is-negative {
    fill: var(--kpi-diff-negative);
}

.kpi-card__line-periods {
    position: relative;
    width: 100%;
    margin-top: clamp(0.15rem, 0.3vw, 0.4rem);
    min-height: clamp(32px, 3.5vw, 42px);
    color: var(--text-muted);
}

.kpi-card__line-period {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
}

.kpi-card__line-period[data-align='start'] {
    transform: translateX(0);
    align-items: flex-start;
    text-align: left;
}

.kpi-card__line-period[data-align='end'] {
    transform: translateX(-100%);
    align-items: flex-end;
    text-align: right;
}
.kpi-card__line-period-values {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    line-height: 1.1;
}

.kpi-card__line-period-value {
    font-size: clamp(0.75rem, 0.9vw, 1rem);
    font-weight: 600;
    color: var(--dark);
    position: relative;
    padding-left: 0.8rem;
}
.kpi-card__line-period-value::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dark);
    transform: translateY(-50%);
    display: none;
}
.kpi-card__line-period-values.has-comparison .kpi-card__line-period-value::before {
    display: block;
}
.kpi-card__line-period-value.is-comparison {
    color: var(--dark);
    font-weight: 600;
}
.kpi-card__line-period-value.is-comparison::before {
    background: #2563eb;
}
.kpi-card__line-period-value.is-diff-positive,
.kpi-card__line-period.is-diff-positive .kpi-card__line-period-value {
    color: var(--kpi-diff-positive);
}
.kpi-card__line-period-value.is-diff-negative,
.kpi-card__line-period.is-diff-negative .kpi-card__line-period-value,
.kpi-card__line-period.is-negative .kpi-card__line-period-value {
    color: var(--kpi-diff-negative);
}
body.theme-dark .kpi-card__line-period-value.is-diff-positive,
body.theme-dark .kpi-card__line-period.is-diff-positive .kpi-card__line-period-value {
    color: var(--kpi-diff-positive);
}
body.theme-dark .kpi-card__line-period-value.is-diff-negative,
body.theme-dark .kpi-card__line-period.is-diff-negative .kpi-card__line-period-value,
body.theme-dark .kpi-card__line-period.is-negative .kpi-card__line-period-value {
    color: var(--kpi-diff-negative);
}

.kpi-card__line-period-label {
    font-size: clamp(0.68rem, 0.8vw, 0.85rem);
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-card__baseline {
    position: absolute;
    left: 0;
    right: 0;
    display: none;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 2;
}

.kpi-card__baseline-line {
    stroke: rgba(100, 116, 139, 0.45);
    stroke-width: 2.2;
    stroke-dasharray: none;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.kpi-card__baseline-label {
    transform: translateY(-140%);
    background: var(--card-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.kpi-board-empty {
    text-align: center;
    padding: 3rem 1rem;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    font-weight: 600;
}

.employee-sidebar {
    width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(217, 219, 225, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    box-shadow: 0 12px 28px rgba(34, 36, 40, 0.12);
}

.meta-modal-button {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    padding: 0.75rem 1rem;
    font-weight: 700;
    line-height: 1.3;
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    margin-left: 0.75rem;
    align-self: flex-end;
}

.meta-modal-button:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
}

.meta-toggle-line {
    display: inline-block;
}

.meta-toggle-subline {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.employee-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.employee-group-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.employee-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
    flex: 1;
}

.employee-list li {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.employee-list li:hover,
.employee-list li.active {
    border-color: var(--yellow);
    box-shadow: 0 10px 18px rgba(34, 36, 40, 0.06);
}

.employee-list li.has-pending-sms::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #dc2626;
    box-shadow: 0 0 0 2px var(--card-bg);
}

.employee-detail {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 1.4vw, 1.5rem);
    align-content: start;
    min-height: 100%;
}

.employee-detail .card {
    width: 100%;
}

.detail-top {
    --detail-top-height: 305px;
    display: grid;
    grid-template-columns:
        minmax(164px, 0.63fr)
        minmax(180px, 0.5fr)
        minmax(180px, 0.5fr)
        minmax(320px, 1fr);
    gap: clamp(0.75rem, 1vw, 1.15rem);
    align-items: stretch;
    grid-auto-rows: 1fr;
}

.detail-top > * {
    min-height: 0;
}

.detail-top .cash-card {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    color: var(--dark);
    box-shadow: 0 12px 30px rgba(34, 36, 40, 0.14);
    border: var(--container-border-width) solid rgba(217, 219, 225, 0.7);
    padding: 1rem 1.05rem;
}

.cash-card::before,
.cash-card::after {
    display: none;
}

.cash-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    position: relative;
    z-index: 1;
}

.cash-card h3 {
    margin: 0;
    color: var(--dark);
}

.cash-card__period {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.cash-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.cash-ats-toggle {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.cash-card .timestamp-label {
    color: var(--text-muted);
}

.cash-metric-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.cash-metric {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(217, 219, 225, 0.8);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-height: 187px;
    box-shadow: 0 8px 16px rgba(34, 36, 40, 0.08);
    position: relative;
    height: 100%;
}

.cash-metric__label {
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cash-metric > .stat-delta[data-cash-delta] {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    font-weight: 700;
}

.cash-metric__value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
}

.cash-metric__hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.cash-metric__value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.cash-metric__sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
}

.cash-metric__sub + .cash-metric__sub {
    margin-top: 0.3rem;
}

.cash-metric__sub--primary {
    color: var(--dark);
}

.cash-metric__sub--primary.is-positive {
    color: #15803d;
}

.cash-metric__sub--primary.is-negative {
    color: #dc2626;
}

.cash-metric__sub--block {
    display: block;
    margin-top: 0.15rem;
}

.cash-metric__info {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-left: 0.35rem;
    font-weight: 600;
}

.cash-metric__sub--inline {
    font-size: 0.85rem;
}

.cash-metric__sub--compact {
    font-size: 0.85rem;
    margin-top: -0.15rem;
}

.cash-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cash-subwidget {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.9rem;
    background: #f8fafc;
    border: var(--container-border-width) solid rgba(15, 23, 42, 0.12);
}

.cash-subwidget + .cash-subwidget {
    margin-top: 0.6rem;
}

.cash-subwidget--orders-chart {
    align-items: center;
    padding-bottom: 0.6rem;
}

.cash-metric__stack {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cash-metric__line {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.cash-metric__line .stat-delta {
    white-space: nowrap;
}

.cash-metric--forecast {
    min-height: 187px;
}

.cash-forecast {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.cash-forecast__row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.65rem;
}

.cash-forecast__value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}

.cash-forecast__number {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
}

.cash-forecast__hint {
    font-size: 0.8rem;
    color: #000;
    font-weight: 700;
}

.cash-metric--orderload {
    min-height: 187px;
}

.cash-orderload {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.cash-orderload__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.cash-orderload__label {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.cash-orderload__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
}

.cash-metric--bonus {
    min-height: 187px;
}

.cash-bonus {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.cash-bonus__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.cash-bonus__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
}

.cash-bonus__label {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.cash-bonus__empty {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cash-card__empty {
    position: relative;
    z-index: 1;
    margin: 0.2rem 0 0;
    font-weight: 700;
    color: var(--text-muted);
}

.cash-card.is-empty .cash-metric-grid {
    opacity: 0.6;
}

.detail-top .bonus-malus-card {
    align-self: stretch;
    padding: 0.85rem 0.95rem;
    width: 100%;
    min-height: var(--detail-top-height, auto);
    height: var(--detail-top-height, auto);
    max-height: var(--detail-top-height, none);
    overflow: hidden;
}

.detail-top .sms-card {
    min-height: var(--detail-top-height, auto);
    max-height: var(--sms-card-max-height, 21rem);
    height: var(--sms-card-height, auto);
    flex: 1 1 auto;
    overflow: hidden;
}

.detail-top .sms-card .latest-feedback {
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 0.3rem;
    max-height: var(--sms-feedback-max-height, none);
}

.detail-top .sms-card .latest-feedback ul {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
    max-height: var(--sms-feedback-max-height, none);
    height: var(--sms-feedback-height, auto);
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    border: var(--container-border-width) solid rgba(217, 219, 225, 0.75);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 12px 30px rgba(34, 36, 40, 0.12);
}

.profile-card {
    gap: 1.25rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
}

.profile-name {
    margin: 0;
    font-size: 1.6rem;
}

.profile-position {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.75rem;
}

.profile-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-meta dt {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.profile-meta dd {
    font-size: 0.95rem;
}

.profile-actions {
    margin-top: 1.25rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-button {
    border: none;
    border-radius: 12px;
    padding: 0.55rem 1.6rem;
    background: var(--yellow);
    color: var(--dark);
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.contact-button:not(:disabled):hover,
.contact-button:not(:disabled):focus-visible {
    background: #ffe45c;
}

.contact-button:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.75);
    outline-offset: 2px;
}

.contact-button:disabled {
    background: rgba(34, 36, 40, 0.08);
    color: rgba(34, 36, 40, 0.45);
    border: none;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.contact-button--secondary {
    background: var(--yellow);
    color: var(--dark);
    border: none;
}

.contact-button--secondary:disabled {
    background: rgba(34, 36, 40, 0.08);
    color: rgba(34, 36, 40, 0.45);
    border: none;
}

.cash-profit {
    margin-left: 0.35rem;
    font-weight: 700;
}

.cash-profit.is-positive {
    color: #15803d;
}

.cash-profit.is-negative {
    color: #dc2626;
}

.contact-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 30px rgba(34, 36, 40, 0.12);
    min-width: 220px;
    z-index: 20;
}

.contact-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 18px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--card-bg) transparent;
    filter: drop-shadow(0 -1px 1px rgba(34, 36, 40, 0.08));
}

.contact-menu.is-visible {
    display: flex;
}

.contact-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.contact-option:hover {
    background: var(--light-grey);
}

.contact-option:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
}

.contact-option .label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.contact-option .value {
    font-size: 0.95rem;
    font-weight: 600;
}

.contact-option--empty {
    font-style: italic;
    color: var(--text-muted);
    cursor: default;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.kpi-grid.kpi-grid--expanded {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.kpi-card {
    gap: 0.5rem;
    min-width: 260px;
}

.bonus-malus-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}


.bonus-malus-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.timestamp-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.5rem;
    white-space: nowrap;
}

body.theme-dark .timestamp-label {
    color: var(--text-muted);
    opacity: 0.9;
}

.timestamp-label.is-stale {
    color: #dc2626;
    font-weight: 600;
}

body.theme-dark .timestamp-label.is-stale {
    color: #f87171;
}

.cash-bonus__timestamp {
    display: inline-block;
    margin-left: 0;
    margin-top: 0.05rem;
}

.bonus-malus-score-header {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1rem;
    color: #111827;
    font-weight: 700;
}

.bonus-malus-score-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: inherit;
}
.bonus-malus-score-value.is-positive {
    color: #15803d;
}
.bonus-malus-score-value.is-negative {
    color: #dc2626;
}
.bonus-malus-score-value.is-neutral {
    color: var(--text-muted);
}

.bonus-malus-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.bonus-malus-scale-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}

.bonus-malus-scale-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.bonus-malus-scale-value.is-positive {
    color: #15803d;
}

.bonus-malus-scale-value.is-negative {
    color: #dc2626;
}

.bonus-malus-scale-value.is-neutral {
    color: var(--text-muted);
}


.bonus-malus-empty {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.bonus-malus-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    row-gap: 0.2rem;
}

.bonus-malus-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.35rem;
}

.bonus-malus-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.bonus-malus-points {
    font-weight: 600;
    font-size: 0.82rem;
    min-width: auto;
}

.bonus-malus-points.is-positive {
    color: #15803d;
}

.bonus-malus-points.is-negative {
    color: #dc2626;
}

.bonus-malus-points.is-neutral {
    color: var(--text-muted);
}

body.theme-dark .bonus-malus-points.is-positive {
    color: #34a36d;
}

body.theme-dark .bonus-malus-points.is-negative {
    color: #f87171;
}

body.theme-dark .bonus-malus-score-value.is-positive {
    color: #34a36d;
}

body.theme-dark .bonus-malus-score-value.is-negative {
    color: #f87171;
}

body.theme-dark .bonus-malus-score-value.is-neutral {
    color: var(--text-muted);
}

body.theme-dark .stat-delta.is-positive {
    color: #34a36d;
}

body.theme-dark .stat-delta.is-negative {
    color: #f87171;
}

body.theme-dark .stat-delta.is-neutral {
    color: var(--text-muted);
}

.kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.kpi-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.sms-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sms-card-header h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.sms-analysis-button {
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(34, 36, 40, 0.04);
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.sms-analysis-button:hover {
    background: rgba(34, 36, 40, 0.08);
    border-color: rgba(34, 36, 40, 0.35);
}

.sms-analysis-button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.sms-analysis-button:active {
    transform: translateY(1px);
}

.sms-analysis-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    background: rgba(34, 36, 40, 0.04);
    border-color: var(--border);
    color: var(--text-muted);
}

.sms-analysis-button:disabled:focus-visible {
    outline: none;
}

.kpi-history-ratio {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 800;
    white-space: nowrap;
}

.kpi-history-ratio.is-hidden {
    display: none;
}

.kpi-history-ratio.is-positive {
    color: #15803d;
}

.kpi-history-ratio.is-warning {
    color: #d97706;
}

.kpi-history-ratio.is-negative {
    color: #dc2626;
}

.kpi-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.kpi-chart {
    margin-top: 0.5rem;
    padding: 0 0.75rem 0.75rem;
}

.kpi-bars {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2.5rem;
    height: 160px;
}

.kpi-bar {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.kpi-bar .value {
    font-weight: 700;
    font-size: 1.05rem;
}

.kpi-bar .bar-wrapper {
    position: relative;
    width: 48px;
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.kpi-bar .bar {
    width: 100%;
    height: 0%;
    border-radius: 12px 12px 6px 6px;
    background: #d4d7e5;
    transition: height 0.3s ease;
}

.kpi-bar .bar.is-good {
    background: #1f8a4d;
}

.kpi-bar .bar.is-bad {
    background: #e0474c;
}

.kpi-bar .label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-bar .delta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1;
}

.kpi-bar .delta.delta-positive {
    color: #1f8a4d;
}

.kpi-bar .delta.delta-negative {
    color: #dc2626;
}

.kpi-bar .delta.delta-neutral {
    color: var(--text-muted);
}

body.theme-dark .kpi-bar .delta.delta-positive {
    color: #34a36d;
}

body.theme-dark .kpi-bar .delta.delta-negative {
    color: #f87171;
}

body.theme-dark .kpi-bar .delta.delta-neutral {
    color: var(--text-muted);
}

.kpi-marker {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px dashed rgba(20, 21, 26, 0.55);
    display: none;
    pointer-events: none;
    bottom: 0;
    z-index: 3;
}

.kpi-marker span {
    position: absolute;
    right: 0;
    top: -1.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(20, 21, 26, 0.7);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.ablage-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    align-items: start;
}

.central-comment-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    grid-column: 1 / -1;
    order: 1;
}

.central-comment-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.central-comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

.comment-grid .comment-list-card {
    display: flex;
    flex-direction: column;
}

.comment-card-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.comment-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.comment-grid .comment-list-card #comment-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-visible {
    display: flex;
}

.modal.is-front {
    z-index: 1100;
}

.modal.is-front .modal-backdrop {
    z-index: 1100;
}

.modal.is-front .modal-dialog {
    z-index: 1101;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 20, 24, 0.55);
    z-index: 1000;
}

.modal-dialog {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    max-width: 624px;
    width: min(90vw, 624px);
    max-height: min(90vh, 720px);
    overflow: hidden;
    overscroll-behavior: contain;
    box-shadow: 0 24px 60px rgba(17, 19, 22, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1001;
}

.modal-dialog--wide {
    max-width: none;
    width: min(62rem, 92vw);
    max-height: 85vh;
}

.sms-analysis-table-wrapper {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    background: var(--card-bg);
    max-height: min(60vh, 32rem);
    scrollbar-gutter: stable;
}

.sms-analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.sms-analysis-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--card-bg);
    box-shadow: inset 0 -1px 0 var(--border);
    text-align: left;
    padding: 0.65rem 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sms-analysis-table tbody td {
    padding: 0.6rem 0.9rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
    word-break: break-word;
}

.sms-analysis-table tbody tr {
    transition: background-color 0.2s ease;
}

.sms-analysis-table tbody tr.sms-analysis-row {
    background: rgba(31, 138, 77, 0.2);
}

.sms-analysis-table tbody tr.sms-analysis-row.is-positive {
    background: rgba(31, 138, 77, 0.2);
}

.sms-analysis-table tbody tr.sms-analysis-row:hover,
.sms-analysis-table tbody tr.sms-analysis-row.is-positive:hover {
    background: rgba(31, 138, 77, 0.28);
}

.sms-analysis-table tbody tr.sms-analysis-row.is-negative {
    background: rgba(220, 38, 38, 0.24);
}

.sms-analysis-table tbody tr.sms-analysis-row.is-negative:hover {
    background: rgba(220, 38, 38, 0.32);
}

.sms-analysis-table th:first-child,
.sms-analysis-table td:first-child {
    width: 7rem;
    text-align: center;
}

.sms-analysis-report-button {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(34, 36, 40, 0.04);
    color: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.sms-analysis-report-button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.sms-analysis-report-button.is-complete {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
    color: #166534;
}

.sms-analysis-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
}

.sms-analysis-table td:nth-child(4),
.sms-analysis-table td:nth-child(7) {
    text-align: center;
}

.sms-analysis-table th:nth-child(6),
.sms-analysis-table td:nth-child(6) {
    width: 24%;
}

.sms-analysis-table th:nth-child(7),
.sms-analysis-table td:nth-child(7) {
    width: 10%;
}

.sms-analysis-table th:last-child,
.sms-analysis-table td:last-child {
    text-align: right;
}

.sms-analysis-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 960px) {
    .sms-analysis-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .sms-analysis-table-wrapper {
        flex: 1 1 auto;
    }
}

.sms-report-context {
    margin: 0;
    color: var(--text-muted);
}

.sms-report-remarks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}

.sms-report-remark h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.sms-report-remark__text {
    margin: 0;
    white-space: pre-line;
    word-break: break-word;
}

.sms-archive-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.archive-filter-bar {
    display: flex;
    justify-content: flex-start;
}

.archive-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(15, 18, 23, 0.08);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.archive-filter input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.sms-report-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sms-report-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sms-report-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 18rem;
    overflow-y: auto;
}

.sms-report-list .note-entry {
    margin: 0;
}

.sms-report-view .ghost-btn {
    align-self: flex-start;
}

.sms-report-actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

.sms-report-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sms-report-form .modal-actions {
    margin: 0;
}

.sms-report-form .form-status {
    min-height: 1.2rem;
    margin: 0;
}

.sms-report-form.is-disabled {
    opacity: 0.65;
}

.modal-body,
.modal-dialog > form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.comment-modal__empty {
    margin: 0;
}
.comment-modal__list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.comment-modal__item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    background: var(--card-bg);
}
.comment-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.comment-modal__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.comment-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.comment-modal__button:hover,
.comment-modal__button:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.4);
    color: #2f58d6;
}
.comment-modal__author {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.comment-modal__timestamp {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.comment-modal__text {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
}
.tags-manager__form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.tags-manager__form input {
    flex: 1 1 auto;
}
.tags-manager__table {
    width: 100%;
    border-collapse: collapse;
}
.tags-manager__table th,
.tags-manager__table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}
.tags-manager__tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.tags-manager__tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 36, 40, 0.45);
    background: #fff;
    color: #2f3034;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
}
.tags-manager__tag.is-off {
    opacity: 0.5;
}
.tags-manager__context-menu {
    position: fixed;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.4rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 12px 24px rgba(20, 24, 35, 0.12);
}
.tags-manager__context-menu[hidden] {
    display: none;
}
.tags-manager__context-menu button {
    border: 0;
    background: transparent;
    padding: 0.35rem 0.6rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #2f3034;
}
.tags-manager__context-menu button:hover,
.tags-manager__context-menu button:focus-visible {
    background: rgba(76, 139, 255, 0.12);
    color: #2f58d6;
}

.absence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
    color: inherit;
    background: transparent;
}
.dispo-absence {
    position: relative;
    border-radius: 6px;
    color: #fff;
}
.dispo-absence--krank {
    background: #c5342d;
}
.dispo-absence--urlaub {
    background: #f2c94c;
    color: #1b1b1b;
}
.dispo-absence--schulung {
    background: #4a74ff;
}

.absence-calendar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(237, 239, 244, 0.7);
}
.absence-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.absence-calendar__label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
}
.absence-calendar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--dark);
    cursor: pointer;
    font-weight: 700;
}
.absence-calendar__nav:hover {
    background: rgba(76, 139, 255, 0.12);
    border-color: rgba(76, 139, 255, 0.4);
    color: #2f58d6;
}
.absence-calendar__weekdays,
.absence-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}
.absence-calendar__weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}
.absence-calendar__day {
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0;
    cursor: pointer;
    text-align: center;
}
.absence-calendar__day.is-empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}
.absence-calendar__day.is-range {
    border-color: rgba(76, 139, 255, 0.5);
    box-shadow: inset 0 0 0 2px rgba(76, 139, 255, 0.35);
}
.absence-calendar__day.is-start,
.absence-calendar__day.is-end {
    border-color: #2f58d6;
    box-shadow: inset 0 0 0 2px #2f58d6;
}
.absence-calendar__day--krank {
    background: #c5342d;
    color: #fff;
}
.absence-calendar__day--urlaub {
    background: #f2c94c;
    color: #1b1b1b;
}
.absence-calendar__day--schulung {
    background: #4a74ff;
    color: #fff;
}
.absence-calendar__hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.help-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
}

.help-topic h4 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.help-topic p {
    margin: 0;
    color: var(--text-muted);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.75);
    outline-offset: 2px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-grid label input[type="text"],
.form-grid label input[type="email"] {
    width: 100%;
}

.form-grid label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 1rem;
    font-size: 0.9rem;
}

.form-grid label.checkbox input {
    width: 1rem;
    height: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

.modal-preset {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-preset select {
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-weight: 600;
}

.kpi-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kpi-order-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 6px 16px rgba(34, 36, 40, 0.08);
    cursor: grab;
    user-select: none;
}

.kpi-order-item:active {
    cursor: grabbing;
}

.kpi-order-item__handle {
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.kpi-order-item.is-dragging {
    opacity: 0.75;
    box-shadow: 0 12px 26px rgba(34, 36, 40, 0.18);
}

.kpi-order-item.is-drop-target {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.75rem;
}

.stat-item {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border: var(--container-border-width) solid rgba(217, 219, 225, 0.75);
    box-shadow: 0 12px 26px rgba(34, 36, 40, 0.12);
}

.stat-item span {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-item strong {
    font-size: 1.2rem;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.sms-card .stat-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.stat-delta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-subtext {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: pre-line;
}

.stat-delta.is-positive {
    color: #15803d;
}

.stat-delta.is-negative {
    color: #dc2626;
}

.stat-delta.is-neutral {
    color: var(--text-muted);
}

.quality-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.metric-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

dl {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

dt {
    font-weight: 600;
    color: var(--text-muted);
}

dd {
    margin: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.metric {
    background: var(--light-grey);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
}

.metric-grid.compact .metric {
    padding: 0.6rem 0.75rem;
}

.history ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.history li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.45rem 0.55rem;
    background: #fffce5;
    border-radius: 10px;
    border-left: 3px solid var(--yellow);
}

.latest-feedback {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.latest-feedback h4,
.history h4,
.team-list h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.latest-feedback ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-height: 0;
}

.latest-feedback li {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(255, 212, 0, 0.12);
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
}

.feedback-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.feedback-text {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: var(--dark);
}

.feedback-text + .feedback-text {
    margin-top: 0.2rem;
}

.comment-list-card #comment-list {
    max-height: 440px;
}

.description {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.description-item {
    background: rgba(255, 212, 0, 0.1);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
}

.description-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.description-text {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: var(--dark);
}

#comment-list,
#central-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.note-entry {
    border-left: 3px solid var(--yellow);
    padding: 0.5rem 0.75rem;
    background: var(--light-grey);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.note-entry.note-entry--compact {
    border-left-color: var(--border);
    background: var(--card-bg);
}

.central-comment-card__list .note-entry {
    box-shadow: 0 12px 24px rgba(34, 36, 40, 0.12);
}

.note-entry__author {
    display: inline-block;
    margin-right: 0.5rem;
}

.note-entry__timestamp {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-entry__edited {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.note-entry__text {
    margin: 0.25rem 0 0;
    white-space: pre-wrap;
}

.comment-history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-history__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-entry {
    background: var(--light-grey);
    border-left: 3px solid var(--yellow);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.history-entry__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.history-entry__heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.history-entry__primary {
    font-weight: 600;
    color: var(--dark);
}

.history-entry__date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-entry__action {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-entry__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.history-entry__meta-item {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-entry__meta-label {
    font-weight: 600;
    color: var(--dark);
}

.history-entry__meta-value {
    color: var(--text-muted);
}

.history-entry__text {
    margin: 0;
    white-space: pre-wrap;
    color: var(--dark);
}

.note-entry__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.note-entry__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.note-entry__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.note-entry__button {
    background: transparent;
    border: none;
    padding: 0.25rem;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.note-entry__button:hover,
.note-entry__button:focus-visible {
    color: var(--dark);
    background-color: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
    outline: none;
}

.note-entry__button:active {
    transform: translateY(0);
}

.note-entry__icon {
    display: block;
    width: 18px;
    height: 18px;
}

.central-comment-form__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.central-comment-card__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
}

.download-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--light-grey);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(34, 36, 40, 0.08);
}

.download-item__meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.download-item__meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-button {
    background: var(--dark);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34, 36, 40, 0.2);
}

.download-card {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    order: 2;
}

@media (max-width: 960px) {
    .ablage-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .download-card {
        grid-column: 1 / -1;
        max-width: none;
    }
    .download-card {
        justify-self: stretch;
    }
}

.empty-state {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

#comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font: inherit;
    resize: vertical;
}

.primary-btn {
    align-self: flex-start;
    background: var(--yellow);
    color: var(--dark);
    font-weight: 700;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 212, 0, 0.25);
}

.ghost-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ghost-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ghost-btn:not(:disabled):hover {
    background: rgba(34, 36, 40, 0.05);
}

.form-status {
    min-height: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.toggle {
    display: inline-flex;
    background: var(--light-grey);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.2rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.2s ease, color 0.2s ease;
}

.toggle-btn.active {
    background: var(--yellow);
    color: var(--dark);
}

.analytics-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.team-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.team-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    background: var(--light-grey);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1280px) {
    .detail-top {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (max-width: 1100px) {
    .stat-group {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 1200px) {
    .cash-metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .cash-metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

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

@media (max-width: 600px) {
    .profile-meta {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 960px) {
    .panel-body {
        grid-template-columns: 1fr;
    }

    .employee-sidebar {
        max-height: 320px;
    }

    .employee-detail {
        min-height: auto;
    }

    .detail-top {
        grid-template-columns: 1fr;
    }

    .detail-top .sms-card {
        max-height: none;
    }

    .detail-top .sms-card .latest-feedback {
        max-height: none;
    }
}

@media (max-width: 720px) {
    body {
        padding-top: 160px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .hero-nav {
        gap: 1rem;
    }

    main {
        padding-top: 2.5rem;
    }
}

/* --------------------------------------------------------------
   Dark theme
   The base background color follows the provided PNG (dark blue-grey).
   Cards/widgets are slightly brighter for contrast.
-------------------------------------------------------------- */
body.theme-dark {
    --yellow: #ffd400;
    --dark: #f3f6fb;
    --grey: #262e3b;
    --light-grey: #101725;
    --card-bg: #1b2230;
    --border: #273040;
    --text-muted: #8f9bad;
    --accent-gradient: linear-gradient(150deg, #101620 0%, #17202d 50%, #1f2c3b 100%);
}

body.theme-dark {
    background: #0c1119;
    color: var(--dark);
}

body.theme-dark .hero::after {
    background:
        radial-gradient(circle at 78% 30%, rgba(255, 212, 0, 0.18), transparent 55%),
        radial-gradient(circle at 5% 95%, rgba(94, 234, 212, 0.12), transparent 50%);
}

body.theme-dark .hero {
    box-shadow: 0 12px 32px rgba(5, 9, 15, 0.55);
}

body.theme-dark .nav-btn {
    color: rgba(240, 243, 249, 0.8);
}

body.theme-dark .nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--yellow);
}

body.theme-dark .sms-analysis-button {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
}

body.theme-dark .sms-analysis-button:hover {
    border-color: rgba(148, 163, 184, 0.65);
    background: rgba(148, 163, 184, 0.18);
}

body.theme-dark .sms-analysis-button:focus-visible {
    outline-color: rgba(96, 165, 250, 0.6);
}

body.theme-dark .sms-analysis-button:disabled {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
    color: rgba(226, 232, 240, 0.6);
}

.sms-analysis-button.is-positive {
    background: rgba(31, 138, 77, 0.2);
    border-color: rgba(31, 138, 77, 0.35);
    color: #14532d;
}

.sms-analysis-button.is-positive:hover {
    background: rgba(31, 138, 77, 0.28);
}

.sms-analysis-button.is-negative {
    background: rgba(220, 38, 38, 0.24);
    border-color: rgba(220, 38, 38, 0.4);
    color: #7f1d1d;
}

.sms-analysis-button.is-negative:hover {
    background: rgba(220, 38, 38, 0.32);
}

body.theme-dark .sms-analysis-button.is-positive {
    background: rgba(46, 125, 96, 0.45);
    border-color: rgba(46, 125, 96, 0.6);
    color: #d1fae5;
}

body.theme-dark .sms-analysis-button.is-positive:hover {
    background: rgba(46, 125, 96, 0.58);
}

body.theme-dark .sms-analysis-button.is-negative {
    background: rgba(229, 72, 77, 0.45);
    border-color: rgba(229, 72, 77, 0.65);
    color: #fee2e2;
}

body.theme-dark .sms-analysis-button.is-negative:hover {
    background: rgba(229, 72, 77, 0.58);
}

body.theme-dark .sms-analysis-table-wrapper {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.75);
}

body.theme-dark .sms-analysis-table thead th {
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.35);
}

body.theme-dark .sms-analysis-table tbody td {
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-dark .sms-analysis-table tbody tr:nth-child(odd) {
    background: transparent;
}

body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row {
    background: rgba(46, 125, 96, 0.45);
}

body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row.is-positive {
    background: rgba(46, 125, 96, 0.45);
}

body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row:hover,
body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row.is-positive:hover {
    background: rgba(46, 125, 96, 0.58);
}

body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row.is-negative {
    background: rgba(229, 72, 77, 0.45);
}

body.theme-dark .sms-analysis-table tbody tr.sms-analysis-row.is-negative:hover {
    background: rgba(229, 72, 77, 0.58);
}

body.theme-dark .sms-analysis-report-button {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

body.theme-dark .sms-analysis-report-button.is-complete {
    background: rgba(45, 201, 115, 0.35);
    border-color: rgba(45, 201, 115, 0.65);
    color: #dcfce7;
}

body.theme-dark .nav-btn.active,
.theme-toggle[aria-pressed="true"] {
    background: rgba(255, 212, 0, 0.22);
    color: var(--yellow);
}

/* Chart and marker tweaks for dark background */
body.theme-dark .kpi-marker {
    border-top-color: rgba(255, 255, 255, 0.25);
}

body.theme-dark .kpi-marker span {
    color: rgba(243, 246, 251, 0.8);
}

body.theme-dark .dashboard-kpi-marker {
    background: rgba(243, 246, 251, 0.3);
}

body.theme-dark .dashboard-kpi-marker span {
    color: rgba(243, 246, 251, 0.75);
}

body.theme-dark .interval-switch {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(71, 85, 105, 0.6);
}
body.theme-dark .switch-button:hover {
    background: rgba(96, 165, 250, 0.18);
    color: #e2e8f0;
}
body.theme-dark .context-select {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(71, 85, 105, 0.6);
}
body.theme-dark .context-select__label {
    color: rgba(203, 213, 225, 0.78);
}
body.theme-dark .context-select select {
    color: #e2e8f0;
}
body.theme-dark .employee-month-select {
    color: rgba(203, 213, 225, 0.78);
}
body.theme-dark .employee-month-select select {
    background: rgba(27, 34, 48, 0.92);
    color: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.45);
    box-shadow: none;
}
body.theme-dark .dispo-month-button {
    background: rgba(27, 34, 48, 0.92);
    border-color: rgba(71, 85, 105, 0.45);
    color: #e2e8f0;
}
body.theme-dark .dispo-month-button:hover {
    background: rgba(76, 139, 255, 0.22);
    border-color: rgba(76, 139, 255, 0.55);
    color: #93c5fd;
}
body.theme-dark .dispo-month-button--today {
    background: rgba(76, 139, 255, 0.25);
    border-color: rgba(96, 165, 250, 0.55);
    color: #bfdbfe;
}
body.theme-dark .dispo-calendar-card__title {
    color: #e2e8f0;
}
body.theme-dark .dispo-calendar__weekdays span {
    color: rgba(203, 213, 225, 0.7);
}
body.theme-dark .dispo-calendar__day {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(71, 85, 105, 0.55);
    color: #e2e8f0;
    box-shadow: 0 12px 24px rgba(3, 6, 12, 0.35);
}
body.theme-dark .dispo-calendar__day--weekend {
    background: rgba(59, 130, 246, 0.22);
}
body.theme-dark .dispo-calendar__day--empty {
    border-color: rgba(71, 85, 105, 0.35);
    color: rgba(148, 163, 184, 0.45);
    background: transparent;
    box-shadow: none;
}
body.theme-dark .dispo-calendar__day--today {
    border-color: rgba(96, 165, 250, 0.8);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}
body.theme-dark .dispo-weekplan-select select {
    background: rgba(27, 34, 48, 0.92);
    color: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.45);
}
body.theme-dark .dispo-weekplan-table-wrapper {
    border-color: rgba(71, 85, 105, 0.45);
    background: rgba(15, 23, 42, 0.72);
}
body.theme-dark .dispo-weekplan-table thead th {
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
}
body.theme-dark .dispo-weekplan-table thead th.dispo-weekplan__group-head {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
}
body.theme-dark .dispo-weekplan-table td {
    border-color: rgba(71, 85, 105, 0.45);
}
body.theme-dark .dispo-weekplan-table tbody tr:hover {
    background: rgba(255, 212, 0, 0.16);
}
body.theme-dark .kpi-card {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(71, 85, 105, 0.45);
    box-shadow: 0 26px 52px rgba(8, 47, 73, 0.55);
}
body.theme-dark .kpi-card__label h3 {
    color: #e2e8f0;
}
body.theme-dark .orderload-legend__item {
    color: #cbd5e1;
}
body.theme-dark .orderload-chart__legend-item {
    color: #fff;
}
body.theme-dark .orderload-period-values {
    color: #e2e8f0;
}
body.theme-dark .elq-legend__item {
    color: #cbd5e1;
}
body.theme-dark .elq-period-values {
    color: #e2e8f0;
}
body.theme-dark .orderload-empty {
    color: #cbd5e1;
}
body.theme-dark .kpi-card--orderload .kpi-card__line-point {
    stroke: #0b1222;
}
body.theme-dark .kpi-card--elq .kpi-card__line-point {
    stroke: #0b1222;
}
body.theme-dark .kpi-card__line-path {
    stroke: #e2e8f0;
    filter: drop-shadow(0 10px 24px rgba(15, 23, 42, 0.45));
}
body.theme-dark .kpi-card__line-path.is-comparison {
    stroke: #60a5fa;
    filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.45));
}

body.theme-dark .kpi-card__line-chart::before {
    background: rgba(34, 197, 94, 0.2);
}

body.theme-dark .kpi-card__line-chart::after {
    background: rgba(248, 113, 113, 0.24);
}

body.theme-dark .kpi-card__line-chart.is-bonus-malus {
    background: linear-gradient(
        to top,
        rgba(127, 29, 29, 0.4) 0%,
        rgba(127, 29, 29, 0.4) 30%,
        rgba(185, 28, 28, 0.36) 30%,
        rgba(185, 28, 28, 0.36) 40%,
        rgba(71, 85, 105, 0) 40%,
        rgba(71, 85, 105, 0) 70%,
        rgba(22, 163, 74, 0.3) 70%,
        rgba(22, 163, 74, 0.3) 80%,
        rgba(16, 185, 129, 0.32) 80%,
        rgba(16, 185, 129, 0.32) 90%,
        rgba(21, 128, 61, 0.38) 90%,
        rgba(21, 128, 61, 0.38) 100%
    );
}

body.theme-dark .kpi-quickview-yaxis span {
    background: rgba(27, 34, 48, 0.9);
    color: #e2e8f0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

body.theme-dark .kpi-quickview-gridline {
    stroke: rgba(148, 163, 184, 0.35);
}

.kpi-card__line-point.bonus-tier-strong-positive {
    fill: #065f46;
    stroke: #065f46;
}

.kpi-card__line-point.bonus-tier-elite {
    fill: #064e3b;
    stroke: #064e3b;
}

.kpi-card__line-point.bonus-tier-positive {
    fill: #15803d;
    stroke: #15803d;
}

.kpi-card__line-point.bonus-tier-soft-positive {
    fill: #22c55e;
    stroke: #22c55e;
}

.kpi-card__line-point.bonus-tier-neutral {
    fill: #94a3b8;
    stroke: #94a3b8;
}

.kpi-card__line-point.bonus-tier-light-negative {
    fill: #fca5a5;
    stroke: #fca5a5;
}

.kpi-card__line-point.bonus-tier-negative {
    fill: #ef4444;
    stroke: #ef4444;
}

.kpi-card__line-point.bonus-tier-strong-negative {
    fill: #b91c1c;
    stroke: #b91c1c;
}

body.theme-dark .kpi-card__line-chart.is-inverted::before {
    background: rgba(248, 113, 113, 0.24);
}

body.theme-dark .kpi-card__line-chart.is-inverted::after {
    background: rgba(34, 197, 94, 0.2);
}
body.theme-dark .kpi-card__line-point {
    stroke: #34d399;
    fill: #34d399;
}
body.theme-dark .kpi-card__line-point.is-negative {
    stroke: #f87171;
    fill: #f87171;
}
body.theme-dark .kpi-card__line-point.is-comparison {
    stroke: none;
    fill: #60a5fa;
}
body.theme-dark .kpi-card__line-periods {
    color: rgba(203, 213, 225, 0.78);
}
body.theme-dark .kpi-card__line-period-value {
    color: #e2e8f0;
}
body.theme-dark .kpi-card__line-period.is-negative .kpi-card__line-period-value {
    color: var(--kpi-diff-negative);
}
body.theme-dark .kpi-card__line-period-label {
    color: rgba(203, 213, 225, 0.72);
}
body.theme-dark .kpi-card__baseline {
    color: rgba(148, 163, 184, 0.65);
}
body.theme-dark .kpi-card__baseline-line {
    stroke: rgba(148, 163, 184, 0.65);
}
body.theme-dark .kpi-card__baseline-label {
    background: rgba(15, 23, 42, 0.95);
    color: rgba(226, 232, 240, 0.78);
}
body.theme-dark .kpi-board-empty {
    background: rgba(30, 41, 59, 0.64);
    color: rgba(226, 232, 240, 0.7);
}

}

/* Bar neutral fill on dark */
body.theme-dark .kpi-bar .bar {
    background: #2f3a4f;
}

body.theme-dark .kpi-bar .bar.is-good {
    background: #2fa360;
}

body.theme-dark .kpi-bar .bar.is-bad {
    background: #ef6a75;
}

body.theme-dark .dashboard-kpi-bar {
    background: rgba(53, 155, 101, 0.22);
}

body.theme-dark .dashboard-kpi-bar .fill {
    background: #34a36d;
}

body.theme-dark .dashboard-kpi-bar.is-negative {
    background: rgba(215, 38, 61, 0.18);
}

body.theme-dark .dashboard-kpi-bar.is-negative .fill {
    background: #ef6a75;
}

/* Make widgets a bit brighter than page background */
body.theme-dark .card,
body.theme-dark .panel,
body.theme-dark .employee-sidebar,
body.theme-dark .metric,
body.theme-dark .stat-item,
body.theme-dark .team-list li,
body.theme-dark .comment-list-card #comment-list .note-entry,
body.theme-dark #central-comment-list .note-entry,
body.theme-dark .download-item {
    background: var(--card-bg);
    box-shadow: 0 18px 36px rgba(6, 10, 17, 0.55);
}

body.theme-dark .cash-card {
    background: var(--card-bg);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
    color: #f8fafc;
}

body.theme-dark .cash-metric {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

body.theme-dark .cash-card__empty {
    color: rgba(226, 232, 240, 0.92);
}

body.theme-dark .cash-card .timestamp-label {
    color: rgba(226, 232, 240, 0.85);
}

body.theme-dark .cash-card h3 {
    color: #fff;
}

body.theme-dark .cash-card__period {
    color: rgba(226, 232, 240, 0.85);
}

body.theme-dark .cash-metric__label,
body.theme-dark .cash-metric__sub {
    color: rgba(226, 232, 240, 0.8);
}

body.theme-dark .cash-metric__sub--primary {
    color: #fff;
}

body.theme-dark .cash-metric__sub--primary.is-positive {
    color: #34a36d;
}

body.theme-dark .cash-metric__sub--primary.is-negative {
    color: #f87171;
}

body.theme-dark .kpi-history-ratio.is-positive {
    color: #34a36d;
}

body.theme-dark .kpi-history-ratio.is-warning {
    color: #f59e0b;
}

body.theme-dark .kpi-history-ratio.is-negative {
    color: #f87171;
}

body.theme-dark .cash-metric__value {
    color: #fff;
}

body.theme-dark .cash-forecast__number {
    color: #fff;
}

body.theme-dark .cash-forecast__hint {
    color: rgba(226, 232, 240, 0.8);
}

body.theme-dark .cash-bonus__label {
    color: rgba(226, 232, 240, 0.8);
}

body.theme-dark .cash-bonus__value {
    color: #fff;
}

body.theme-dark .cash-orderload__label {
    color: rgba(226, 232, 240, 0.8);
}

body.theme-dark .cash-orderload__value {
    color: #fff;
}

body.theme-dark .note-entry__button {
    color: rgba(226, 232, 240, 0.65);
}
body.theme-dark .note-entry__button:hover,
body.theme-dark .note-entry__button:focus-visible {
    background-color: rgba(226, 232, 240, 0.16);
    color: #f8fafc;
}
body.theme-dark .meta-modal-button {
    color: rgba(226, 232, 240, 0.9);
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.45);
}
body.theme-dark .meta-toggle-subline {
    color: rgba(148, 163, 184, 0.78);
}
body.theme-dark .download-button {
    color: #1f1f1f;
    background: var(--yellow);
}

/* Inputs readable on dark */
body.theme-dark input[type="text"],
body.theme-dark input[type="search"],
body.theme-dark select,
body.theme-dark textarea {
    background: #161c27;
    color: var(--dark);
    border-color: rgba(143, 154, 173, 0.18);
}

/* Hover backgrounds on dark */
body.theme-dark .contact-option:hover,
body.theme-dark .employee-list li:hover,
body.theme-dark .employee-list li.active,
body.theme-dark .toggle {
    background: rgba(255, 212, 0, 0.14);
}

body.theme-dark .history li {
    background: rgba(255, 212, 0, 0.1);
}

body.theme-dark .history-entry {
    background: rgba(17, 24, 39, 0.92);
    border-left-color: var(--yellow);
}

body.theme-dark .history-entry__primary,
body.theme-dark .history-entry__date,
body.theme-dark .history-entry__meta-label,
body.theme-dark .history-entry__text {
    color: rgba(226, 232, 240, 0.9);
}

body.theme-dark .history-entry__action,
body.theme-dark .history-entry__meta-item,
body.theme-dark .history-entry__meta-value {
    color: rgba(148, 163, 184, 0.9);
}

body.theme-dark .contact-button,
body.theme-dark .primary-btn,
body.theme-dark .comment-open-button,
body.theme-dark .profile-avatar {
    color: #1f1f1f;
}

body.theme-dark .bonus-malus-score-header,
body.theme-dark .bonus-malus-scale-title {
    color: var(--dark);
}

body.theme-dark .bonus-malus-scale-value.is-positive {
    color: #34a36d;
}

body.theme-dark .profile-card .profile-meta dt {
    color: rgba(243, 246, 251, 0.65);
}

/* ---------------------------------------------------------
   KPI Analytics Dashboard
--------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kpi-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kpi-dashboard.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.kpi-header-grid {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 1.5rem;
}

.kpi-controls-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.kpi-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.control-label {
    font-weight: 600;
    min-width: 120px;
    color: var(--text-muted);
}

.chip-group {
    display: inline-flex;
    gap: 0.5rem;
}

.chip-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip-button.is-active,
.chip-button:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--dark);
}

.kpi-controls-card select,
.kpi-controls-card input[type="search"] {
    flex: 1 1 180px;
    min-width: 200px;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
}

.kpi-context-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.context-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.context-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem 1.25rem;
}

.context-metrics div {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.context-metrics dt {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.context-metrics dd {
    font-size: 1.1rem;
    font-weight: 700;
}

.kpi-widget-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.dashboard-kpi-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-kpi-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.dashboard-kpi-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    min-width: 90px;
}

.dashboard-kpi-value .value {
    font-size: 1.2rem;
    font-weight: 700;
}

.dashboard-kpi-value .delta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dashboard-kpi-value .delta.is-positive {
    color: #1f8a4d;
}

.dashboard-kpi-value .delta.is-negative {
    color: #d7263d;
}

body.theme-dark .dashboard-kpi-value .delta.is-positive {
    color: #34a36d;
}

.dashboard-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-kpi-track {
    position: relative;
    width: 100%;
    background: var(--light-grey);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem 0.85rem;
    overflow: hidden;
}

.dashboard-kpi-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(26, 31, 44, 0.55);
    transform: translateX(-50%);
}

.dashboard-kpi-marker span {
    position: absolute;
    top: 0.4rem;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.dashboard-kpi-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    height: 120px;
}

.dashboard-kpi-bar {
    position: relative;
    flex: 1 1 auto;
    max-width: 55px;
    border-radius: var(--radius-sm);
    background: rgba(31, 138, 77, 0.25);
    overflow: hidden;
}

.dashboard-kpi-bar span {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-kpi-bar .fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f8a4d;
    border-radius: var(--radius-sm);
}

.dashboard-kpi-bar.is-negative {
    background: rgba(215, 38, 61, 0.25);
}

.dashboard-kpi-bar.is-negative .fill {
    background: #d7263d;
}

.dashboard-kpi-periods {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

.kpi-table-grid {
    grid-template-columns: 1fr;
}

.kpi-employee-table {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow: auto;
}

.kpi-employee-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.kpi-employee-table th,
.kpi-employee-table td {
    padding: 0.75rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.kpi-employee-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.kpi-employee-table tbody tr:hover {
    background: rgba(255, 212, 0, 0.12);
}

.kpi-employee-table tbody tr.is-selected {
    background: rgba(76, 139, 255, 0.18);
}

.kpi-empty-state {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.panel-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-panel-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-panel-body > .card {
    width: 100%;
    max-width: 1100px;
}

.admin-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-card__header h3 {
    margin: 0 0 0.25rem 0;
}

.admin-user-table__wrapper {
    overflow-x: auto;
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table-responsive--auto {
    display: inline-block;
    width: auto;
}

.table--compact th,
.table--compact td {
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
}

.card--snug {
    display: inline-block;
    padding: 0.75rem 1rem;
}

.admin-user-table th,
.admin-user-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-user-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.admin-user-table__actions {
    width: 9rem;
    text-align: right;
}

.admin-user-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.admin-user-row-actions .switch-button {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
}

.admin-status-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(34, 36, 40, 0.08);
    color: var(--dark);
}

.admin-status-badge.is-good {
    background: rgba(31, 138, 77, 0.14);
    color: #15733d;
}

.admin-status-badge.is-warn {
    background: rgba(255, 212, 0, 0.25);
    color: #755c00;
}

.admin-password-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1200;
}

.admin-password-popup[hidden] {
    display: none;
}

.admin-password-popup__dialog {
    position: relative;
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 360px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.admin-password-popup__close {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-password-popup__title {
    margin: 0 0 0.75rem;
    font-weight: 600;
    font-size: 1.2rem;
}

.admin-password-popup__body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-password-popup__body code {
    font-size: 1.25rem;
    font-weight: 600;
    background: rgba(37, 53, 92, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border);
}

.admin-password-popup__hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
}

.admin-password-popup__note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tab-selector {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tab-selector legend {
    font-weight: 600;
    padding: 0 0.25rem;
}

.tab-selector__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem 0.75rem;
}

.tab-selector__hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-access-status {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

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

    .admin-user-table__actions {
        width: auto;
    }

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

body.theme-dark .admin-status-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f0;
}

body.theme-dark .admin-status-badge.is-good {
    color: #6feb9f;
    background: rgba(111, 235, 159, 0.15);
}

body.theme-dark .admin-status-badge.is-warn {
    color: #ffd966;
    background: rgba(255, 217, 102, 0.18);
}

body.theme-dark .admin-password-result {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
}

body.theme-dark .admin-password-result code {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f0f0f0;
}

@media (max-width: 1180px) {
    .kpi-header-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .kpi-controls-card select,
    .kpi-controls-card input[type="search"] {
        min-width: 0;
        width: 100%;
    }

    .control-label {
        min-width: 0;
        width: 100%;
    }

    .chip-group {
        width: 100%;
        justify-content: flex-start;
    }
}

:root {
    --container-border-width: 2.5px;
}

.card,
.panel,
.metric,
.stat-item,
.team-list li,
.employee-sidebar,
.employee-detail,
.cash-card,
.kpi-card,
.modal-dialog,
.sms-analysis-table-wrapper,
.contact-menu,
.context-select,
.employee-month-select,
.meta-modal-button,
.cash-metric,
.cash-subwidget,
.kpi-order-list,
.kpi-employee-table,
.kpi-context-card,
.kpi-controls-card,
.dashboard-kpi-card,
.central-comment-card,
.comment-list-card,
.download-item,
.tab-selector,
.admin-password-result {
    border-width: var(--container-border-width);
}
