/* Calendar */

.week-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.week-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
}

.cal-day {
    min-height: 190px;
    padding: 16px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition:
        transform 0.14s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.cal-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 104, 232, 0.30);
    background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
}

.cal-today {
    border-color: rgba(79, 104, 232, 0.50);
    background: linear-gradient(180deg, rgba(79,104,232,0.14) 0%, #1e2c40 100%);
    box-shadow:
        0 0 0 3px rgba(79, 104, 232, 0.10),
        var(--shadow-sm);
}

.cal-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.cal-weekday {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-4);
    margin-bottom: 6px;
}

.cal-date {
    font-size: 28px;
    line-height: 1;
    font-weight: 820;
    color: var(--text-1);
    letter-spacing: -0.06em;
}

.cal-date-today {
    color: var(--accent-strong);
}

.cal-type {
    margin-bottom: 0;
    padding: 5px 10px;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    white-space: nowrap;
    align-self: flex-start;
}

.type-arbeit {
    background: var(--success-soft);
    color: #a8f0cc;
    border: 1px solid rgba(28, 184, 112, 0.24);
}
.type-blockiert {
    background: var(--danger-soft);
    color: #f0a8b4;
    border: 1px solid rgba(224, 78, 100, 0.24);
}
.type-andere {
    background: var(--warning-soft);
    color: #f0d090;
    border: 1px solid rgba(212, 149, 46, 0.24);
}

.cal-steps-count {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
}

.cal-bar {
    height: 8px;
    margin-bottom: 8px;
    background: rgba(233, 240, 248, 0.14);
    border-radius: 999px;
    overflow: hidden;
}

.cal-bar-fill {
    background: linear-gradient(90deg, #7d93f4 0%, var(--accent) 100%);
}

.cal-bar-over {
    background: linear-gradient(90deg, #f0a0ae 0%, var(--danger) 100%);
}

.cal-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
}

.cal-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-3);
    font-style: normal;
    line-height: 1.5;
}

.cal-day > .cal-note:last-child {
    margin-top: auto;
    padding-top: 10px;
}

.cal-day.is-empty .cal-steps-count,
.cal-day.is-empty .cal-bar,
.cal-day.is-empty .cal-bar-label,
.cal-day.is-empty .cal-note {
    opacity: 0.7;
}

/* Calendar enhancements */

.cal-day.day-blockiert {
    background: linear-gradient(180deg, rgba(224,78,100,0.12) 0%, var(--surface) 100%);
    border-color: rgba(224, 78, 100, 0.26);
}
.cal-day.day-andere {
    background: linear-gradient(180deg, rgba(212,149,46,0.12) 0%, var(--surface) 100%);
    border-color: rgba(212, 149, 46, 0.26);
}

.cal-day-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-type-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.cal-type-label {
    display: none;
    font-size: 10px;
    letter-spacing: 0;
    font-weight: 700;
}

.cal-type-btn {
    flex: 1;
    height: 30px;
    min-width: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
    color: var(--text-4);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    gap: 3px;
    white-space: nowrap;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.cal-type-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-2);
}
.cal-type-btn.active {
    background: var(--success-soft);
    border-color: rgba(28,184,112,0.32);
    color: #a8f0cc;
}
.cal-type-btn--block.active {
    background: var(--danger-soft);
    border-color: rgba(224,78,100,0.32);
    color: #f0a8b4;
}
.cal-type-btn--other.active {
    background: var(--warning-soft);
    border-color: rgba(212,149,46,0.32);
    color: #f0d090;
}

.cal-step-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 4px;
}

.cal-step-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cal-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-step-name {
    font-size: 11.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.cal-empty-hint {
    font-size: 11.5px;
    color: var(--text-4);
    margin-bottom: 6px;
    font-style: italic;
}

.cal-more {
    font-size: 10.5px;
    color: var(--text-4);
    font-weight: 700;
    padding-left: 12px;
}

.cal-blocked-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* KW badge & mode toggle */

.kw-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(79, 104, 232, 0.26);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cal-kw-inline {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-strong);
    letter-spacing: 0.06em;
    margin-top: 2px;
    opacity: 0.8;
}

.cal-mode-toggle {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.cal-mode-btn {
    height: 34px;
    padding: 0 14px;
    border: none;
    background: var(--surface-2);
    color: var(--text-3);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    transition: background 0.14s ease, color 0.14s ease;
}
.cal-mode-btn:hover {
    background: var(--surface-3);
    color: var(--text-1);
}
.cal-mode-btn.active {
    background: linear-gradient(180deg, #6a7ff0 0%, var(--accent) 100%);
    color: #ffffff;
}

/* Month view */

.month-outer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.month-header-row {
    display: grid;
    grid-template-columns: 36px repeat(7, minmax(0, 1fr));
    gap: 6px;
    padding: 0 2px;
}

.month-kw-hdr {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    padding-top: 4px;
}

.month-wday-hdr {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-4);
    padding: 4px 0;
}

.month-grid {
    display: grid;
    grid-template-columns: 36px repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.month-kw-cell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-4);
    letter-spacing: 0.04em;
}

.month-cell {
    min-height: 80px;
    padding: 10px 10px 8px;
    border-radius: var(--r);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: transform 0.12s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.month-cell:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: rgba(79, 104, 232, 0.28);
}
.month-cell.cal-today {
    border-color: rgba(79, 104, 232, 0.50);
    background: linear-gradient(180deg, rgba(79,104,232,0.14) 0%, var(--surface) 100%);
}
.month-cell.day-blockiert {
    background: linear-gradient(180deg, rgba(224,78,100,0.11) 0%, var(--surface) 100%);
    border-color: rgba(224, 78, 100, 0.22);
}
.month-cell.day-andere {
    background: linear-gradient(180deg, rgba(212,149,46,0.11) 0%, var(--surface) 100%);
    border-color: rgba(212, 149, 46, 0.22);
}
.month-cell--out {
    opacity: 0.38;
}

.month-cell-num {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.04em;
    line-height: 1;
}

.month-cell-bar {
    height: 5px;
    border-radius: 999px;
    background: rgba(233, 240, 248, 0.14);
    overflow: hidden;
}

.month-cell-h {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-4);
}

.month-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
}

/* Calendar settings modal */

.weekday-default-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}
.weekday-default-row:last-child {
    border-bottom: none;
}
.weekday-default-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
}
.weekday-default-select {
    width: 160px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-1);
    font-size: 13px;
    cursor: pointer;
}

/* ─── Responsive: Kalender ────────────────────────────────────── */

/* Ab column-Topbar: Woche-Nav in einer Zeile halten */
@media (max-width: 680px) {
    .week-nav {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
}

/* Ab 2-spaltigem Layout: Typ-Labels sichtbar, Buttons größer */
@media (max-width: 980px) {
    .cal-type-label {
        display: inline;
    }

    .cal-type-btn {
        height: 36px;
        font-size: 12px;
        border-radius: 10px;
    }

    .btn-icon-sm {
        width: 38px;
        height: 38px;
        font-size: 18px;
        border-radius: 12px;
    }

    .cal-mode-btn {
        height: 38px;
        padding: 0 16px;
        font-size: 13px;
    }

    .week-nav-controls {
        gap: 8px;
    }
}

/* Vollbild-Mobilansicht */
@media (max-width: 480px) {
    .week-nav {
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: space-between;
    }

    .week-nav-controls {
        gap: 4px;
    }

    .btn-icon-sm {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }

    .cal-mode-btn {
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }

    .cal-type-btn {
        height: 40px;
        font-size: 12px;
        border-radius: 10px;
    }

    .cal-date {
        font-size: 22px;
    }
}
