/*
 * TimeSpy – settings
 * Teil der aufgeteilten timespy.css (siehe base.css für Variablen).
 * Reihenfolge der <link>-Tags in layout.php/login.php ist wichtig
 * und entspricht exakt der ursprünglichen Reihenfolge in dieser Datei.
 */

/* =========================================================
   SETTINGS
   ========================================================= */

.settings-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 28px;
}

/*
 * Farbliche Unterscheidung der beiden Bereichs-Überschriften auf
 * der Genehmigungen-Seite - dieselben Farben, die auch die
 * Status-Badges an anderer Stelle verwenden (Bernstein =
 * "Beantragt", Grün = "Genehmigt"), damit auf einen Blick klar
 * ist, welcher Bereich welche Anträge zeigt.
 */
.approvals-pending-header {
    background: rgba(234, 179, 8, .10);
    border: 1px solid rgba(234, 179, 8, .22);
}

.approvals-pending-header .settings-hero-icon {
    background: rgba(234, 179, 8, .16);
    color: #a16207;
}

.approvals-approved-header {
    margin-top: 32px;

    background: rgba(22, 163, 74, .06);
    border: 1px solid rgba(22, 163, 74, .16);
}

.approvals-approved-filter {
    margin-top: 16px;
    margin-bottom: 16px;
}

.approvals-approved-employee-filter {
    display: flex;
    align-items: center;

    gap: 8px;
}

.approvals-approved-employee-filter select {
    min-width: 200px;
}

.holidays-section-title {
    margin: 0 0 12px;

    font-size: 1.05rem;
    font-weight: 700;
}

.holidays-section-title--spaced {
    margin-top: 32px;
}

.holidays-section-title small {
    display: block;

    margin-top: 2px;

    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 500;
}

.holiday-recurring-toggle {
    display: inline-flex;
    vertical-align: top;

    margin-top: 16px;
}

.holiday-recurring-label {
    display: inline-block;
    vertical-align: top;

    margin-top: 18px;
    margin-left: 10px;

    max-width: 480px;

    color: var(--text-secondary);
    font-size: .8rem;
    line-height: 1.4;
}

/* -------------------------------------------------------
   Berechtigungsprofile-Liste: Berechtigungen sauber
   untereinander statt nebeneinander, zugewiesene
   Mitarbeiter direkt sichtbar statt nur als Zahl.
   ------------------------------------------------------- */

.permission-profile-list {
    display: flex;
    flex-direction: column;

    gap: 16px;
}

.permission-profile-card {
    padding: 20px 22px;
}

.permission-profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 12px;

    padding-bottom: 16px;
    margin-bottom: 16px;

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

.permission-profile-card-title {
    display: flex;
    align-items: center;

    gap: 12px;
}

.permission-profile-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.permission-profile-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 24px;
}

@media (max-width: 760px) {

    .permission-profile-card-body {
        grid-template-columns: 1fr;
    }
}

.permission-profile-section-label {
    display: block;

    margin-bottom: 10px;

    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.permission-profile-permission-list {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.permission-profile-permission-list li {
    display: flex;
    align-items: center;

    gap: 8px;

    font-size: .84rem;
}

.permission-profile-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    flex-shrink: 0;

    border-radius: 50%;

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

    font-size: .68rem;
    font-weight: 700;
}

.permission-profile-none {
    margin: 0;

    color: var(--text-muted);
    font-size: .82rem;
}

.permission-profile-employee-chips {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}

.permission-profile-chip {
    padding: 5px 10px;

    border-radius: 999px;

    background: var(--bg-solid);
    border: 1px solid var(--border);

    font-size: .76rem;
    font-weight: 560;
}

.settings-hero h2 {
    margin: 0;

    font-size: 2rem;
    font-weight: 650;

    letter-spacing: -.045em;
}

.settings-hero p {
    margin: 8px 0 0;

    color: var(--text-secondary);

    font-size: .9rem;
}

.settings-hero-icon {
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    color: var(--accent);

    background: var(--accent-soft);

    border-radius: 18px;

    font-size: 1.6rem;
}

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

    gap: 14px;
}

.settings-tile {
    display: flex;
    align-items: flex-start;

    gap: 16px;

    min-height: 140px;

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

.settings-tile-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    color: var(--accent);

    background: var(--accent-soft);

    border-radius: 13px;

    font-size: 1.15rem;
}

.settings-tile strong {
    display: block;

    font-size: .95rem;
}

.settings-tile span {
    display: block;

    margin-top: 7px;

    color: var(--text-muted);

    font-size: .76rem;
    line-height: 1.5;
}

@media (max-width: 760px) {

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   WORK SCHEDULE SETTINGS
   ========================================================= */

.work-model-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
}

.work-model-types {
    align-self: start;
}

.work-model-options {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 18px;
}

.work-model-option {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 6px;

    padding: 14px;

    color: var(--text);
    text-align: left;

    background: rgba(255,255,255,.48);

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

    border-radius: 14px;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.work-model-option:hover {
    background: white;

    transform:
        translateY(-1px);
}

.work-model-option.active {
    border-color:
        rgba(37,99,235,.35);

    background:
        var(--accent-soft);

    box-shadow:
        0 8px 22px
        rgba(37,99,235,.08);
}

.work-model-option strong {
    font-size: .84rem;
}

.work-model-option span {
    color: var(--text-muted);

    font-size: .72rem;
    line-height: 1.45;
}

.work-model-config {
    padding: 24px;
}

.work-week-grid {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 20px;
}

.work-day-row {
    display: grid;

    grid-template-columns:
        minmax(180px,1fr)
        70px
        120px
        120px;

    align-items: center;

    gap: 14px;

    padding: 12px 14px;

    background:
        rgba(255,255,255,.55);

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

    border-radius: 13px;
}

.work-day-info {
    display: flex;
    flex-direction: column;
}

.work-day-info strong {
    font-size: .82rem;
}

.work-day-info span {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: .68rem;
}

.work-day-time label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: .64rem;
}

.work-day-time .input {
    min-height: 38px;
}

.work-day-toggle {
    position: relative;

    width: 44px;
    height: 24px;

    flex-shrink: 0;
    box-sizing: content-box;
}

.work-day-toggle input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.work-day-toggle span {
    position: absolute;
    inset: 0;

    background:
        rgba(0,0,0,.10);

    border-radius: 999px;

    cursor: pointer;

    transition:
        background var(--transition);
}

.work-day-toggle span::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    background: white;

    border-radius: 50%;

    box-shadow:
        0 2px 6px
        rgba(0,0,0,.15);

    transition:
        transform var(--transition);
}

.work-day-toggle input:checked + span {
    background:
        var(--accent);
}

.work-day-toggle input:checked + span::after {
    transform:
        translateX(20px);
}

.shift-placeholder {
    min-height: 340px;

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

    text-align: center;

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

.shift-placeholder[hidden] {
    display: none;
}

.shift-placeholder span {
    max-width: 480px;

    margin-top: 8px;

    color: var(--text-muted);

    font-size: .76rem;
    line-height: 1.5;
}

.work-model-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 22px;

    padding-top: 20px;

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

.work-model-summary {
    display: flex;
    flex-direction: column;
}

.work-model-summary span {
    color: var(--text-muted);

    font-size: .68rem;
}

.work-model-summary strong {
    margin-top: 4px;

    font-size: 1.2rem;
}

@media (max-width: 980px) {

    .work-model-layout {
        grid-template-columns: 1fr;
    }

    .work-day-row {
        grid-template-columns:
            1fr
            60px
            100px
            100px;
    }
}

@media (max-width: 640px) {

    .work-day-row {
        grid-template-columns:
            1fr
            60px;

        gap: 10px;
    }

    .work-day-time {
        grid-column:
            span 1;
    }

    .work-model-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
   WORK WEEK DISTRIBUTION
   ========================================================= */

.work-week-distribution {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;

    margin-top: 20px;
    padding: 16px;

    background: rgba(37,99,235,.045);

    border:
        1px solid
        rgba(37,99,235,.10);

    border-radius: 14px;
}

.work-week-target {
    min-width: 0;
}

.work-week-target-fields {
    display: flex;
    gap: 8px;
}

.work-week-target-fields > div {
    width: 100px;
}

.work-week-target-fields small {
    display: block;

    margin-top: 4px;

    color: var(--text-muted);

    font-size: .62rem;
}

@media (max-width: 640px) {

    .work-week-distribution {
        align-items: stretch;
        flex-direction: column;
    }

    .work-week-target-fields > div {
        flex: 1;
        width: auto;
    }
}

/* =========================================================
   WORK MODEL EDIT MODE
   ========================================================= */

.work-model-layout {
    transition:
        opacity var(--transition),
        filter var(--transition);
}

.work-model-layout:not(.is-editing) {
    opacity: .72;
}

.work-model-layout:not(.is-editing)
input:disabled,
.work-model-layout:not(.is-editing)
button:disabled {
    cursor: default;
}

.work-model-layout:not(.is-editing)
.input:disabled {
    background: rgba(0,0,0,.025);
    color: var(--text-muted);
    border-color: rgba(0,0,0,.06);
}

.work-model-layout:not(.is-editing)
.work-model-option:disabled {
    opacity: .72;
}

.work-model-layout.is-editing {
    opacity: 1;
}


.timeline-absence-track {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.timeline-absence-bar {
    position: absolute;

    left: 0;
    right: 0;

    top: 10px;

    height: 8px;

    border-radius: 999px;

    background: rgba(124, 58, 237, .75);

    box-shadow:
        0 2px 8px
        rgba(124, 58, 237, .18);
}


