:root {
    --surface: #f4f5f7;
    --surface-strong: #ffffff;
    --tone-900: #1f2933;
    --tone-700: #374151;
    --tone-500: #6b7280;
    --tone-300: #d1d5db;
    --tone-200: #e5e7eb;
    --tone-100: #f3f4f6;
    --accent: #4b5563;
    --accent-strong: #2d3748;
    --shadow-soft: 0 18px 40px rgba(31, 41, 51, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: radial-gradient(circle at top left, #f7f8fa 0%, var(--surface) 65%, #ebeef2 100%);
    color: var(--tone-900);
    min-height: 100vh;
    line-height: 1.55;
}

body.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

body.nav-open {
    overflow: hidden;
}

body.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-strong);
}

a:focus-visible {
    outline: 2px solid var(--tone-300);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.nav-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: none;
    background: rgba(45, 55, 72, 0.95);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #f9fafb;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
}

.nav-toggle:focus-visible {
    outline: 3px solid rgba(148, 163, 184, 0.75);
    outline-offset: 2px;
}

.nav-toggle:active {
    transform: scale(0.96);
}

.nav-toggle-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

body.nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
}

.main-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    background: linear-gradient(180deg, #2f3640 0%, #1f242b 100%);
    color: #f3f4f6;
    padding: 4.5rem 1.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 50;
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 20px 0 45px rgba(15, 23, 42, 0.35);
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.nav-open .main-nav {
    transform: translateX(0);
}

.nav-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.nav-subtitle {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.75);
}

.nav-sections {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 1rem 0.75rem 0.75rem;
}

.nav-section.current {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.section-header {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(229, 231, 235, 0.65);
    padding: 0 0.6rem 0.35rem;
}

.nav-section.current .section-header {
    color: #f9fafb;
}

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

.section-links a {
    display: block;
    padding: 0.55rem 0.75rem 0.55rem 0.9rem;
    border-radius: 0.75rem;
    color: rgba(229, 231, 235, 0.9);
    transition: background 0.2s ease, color 0.2s ease;
}

.section-links a:hover {
    background: rgba(55, 65, 81, 0.4);
}

.section-links a.active {
    background: rgba(55, 65, 81, 0.85);
    color: #f9fafb;
    font-weight: 600;
}

.section-links a:focus-visible {
    outline: 2px solid rgba(209, 213, 219, 0.9);
    outline-offset: 2px;
}

.top-bar {
    grid-column: 1;
    display: flex;
    justify-content: center;
    padding: clamp(3rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem) 0;
    order: 0;
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(244, 245, 247, 0.98) 0%, rgba(244, 245, 247, 0.92) 65%, rgba(244, 245, 247, 0));
    backdrop-filter: blur(8px);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.top-bar-inner {
    width: min(1080px, 100%);
    background: var(--surface-strong);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.6rem;
    box-shadow: var(--shadow-soft);
    padding: 1.75rem clamp(1.75rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.top-bar-inner > * {
    position: relative;
    z-index: 1;
}

.top-bar-status {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.status-pill {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.8rem 1.4rem;
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 22px rgba(15, 23, 42, 0.08);
    min-width: 160px;
}

.status-pill.status {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    text-transform: none;
    background: var(--surface-strong);
    color: var(--tone-900);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 14px 28px rgba(148, 163, 184, 0.18);
}

.status-pill.status.running {
    color: #1d4ed8;
}

.status-pill.status.paused {
    color: #b45309;
}

.status-pill.status.idle {
    color: var(--tone-700);
}

.status-pill.metric {
    gap: 0.35rem;
}

.metric-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tone-500);
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tone-900);
}

.status-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--tone-500);
    font-size: 0.95rem;
}

.status-meta .meta-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(55, 65, 81, 0.75);
    margin-bottom: 0.25rem;
}

.status-meta .meta-value {
    font-weight: 600;
    color: var(--tone-900);
}

.status-hint {
    margin: 0;
    color: var(--tone-500);
}

.top-bar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: flex-end;
}

.top-bar-actions button {
    min-width: 130px;
}

main.content {
    grid-column: 1;
    grid-row: 2;
    width: min(1080px, calc(100% - 2.5rem));
    margin: 1.5rem auto 3rem;
    background: var(--surface-strong);
    border-radius: 1.6rem;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    box-shadow: var(--shadow-soft);
    order: 1;
    flex: 1 0 auto;
}

main.content > header {
    margin-bottom: 2.25rem;
    text-align: center;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 3vw, 2rem);
}

h2 {
    margin-top: 2.5rem;
    color: var(--tone-700);
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
}

p {
    margin: 0 0 1rem;
}

p.message,
.alert {
    background: var(--tone-200);
    border-left: 4px solid var(--tone-500);
    padding: 0.85rem 1.15rem;
    border-radius: 1rem;
    color: var(--tone-700);
    margin: 1rem 0;
}

p.error {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #b91c1c;
}

form {
    display: grid;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.filter-section {
    margin: 1.5rem 0 2rem;
    background: var(--surface-strong);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.table-filter {
    gap: 1rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

form.inline {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.time-account-form {
    display: flex;
    width: 100%;
    margin-bottom: 1.5rem;
}

.time-account-grid {
    margin-top: 0.75rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--tone-500);
}

label > input,
label > select {
    width: min(100%, 22rem);
}

label > textarea {
    width: min(100%, 32rem);
}

fieldset {
    border: 1px solid var(--tone-300);
    border-radius: 1.25rem;
    padding: 1rem 1.25rem 1.25rem;
    margin: 0;
}

fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
    color: var(--tone-500);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.working-days-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--tone-900);
}

label.checkbox input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}

.hidden {
    display: none !important;
}

.date-selection .date-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

button.date-option {
    background: var(--tone-200);
    color: var(--tone-700);
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

button.date-option:hover,
button.date-option:focus-visible {
    background: var(--tone-300);
    color: var(--tone-900);
    box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.15);
}

button.date-option.active {
    background: var(--accent);
    color: #fff;
}

.time-mode {
    display: grid;
    gap: 1rem;
}

.time-mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    padding: 0.5rem;
    border: 1px solid var(--tone-300);
    border-radius: 1rem;
    background: var(--tone-100);
}

label.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--tone-700);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

label.radio-option:hover {
    background: rgba(209, 213, 219, 0.3);
}

label.radio-option input[type="radio"] {
    width: auto;
    accent-color: var(--accent);
    margin: 0;
}

label.radio-option input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

label.radio-option input[type="radio"]:checked + span {
    color: var(--accent-strong);
}

.mode-field {
    display: none;
    padding: 1rem;
    border: 1px solid var(--tone-200);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.mode-field.active {
    display: grid;
    gap: 0.75rem;
}

.time-range-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.time-range-fields label {
    flex: 1 1 180px;
}

.mode-field label {
    width: 100%;
}

.field-hint {
    margin: -0.25rem 0 0.25rem;
    font-size: 0.85rem;
    color: var(--tone-500);
}

.form-hint {
    margin: 0.75rem 0 1.5rem;
    font-size: 0.9rem;
    color: var(--tone-700);
}

input,
select,
textarea {
    width: auto;
    max-width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--tone-300);
    border-radius: 0.85rem;
    background: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 8rem;
}

.support-card {
    margin-top: 2rem;
    padding: 1.75rem;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 1rem;
}

.support-form {
    display: grid;
    gap: 1rem;
}

.support-form label {
    display: grid;
    gap: 0.5rem;
}

.support-form input[type="text"],
.support-form textarea {
    width: 100%;
}

.support-form button {
    justify-self: flex-start;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 38rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.25);
}

button,
.button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 12px 24px rgba(75, 85, 99, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(75, 85, 99, 0.3);
}

button:active,
.button:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(75, 85, 99, 0.2);
}

button.primary,
.button.primary {
    background: linear-gradient(135deg, #4b5563 0%, #4b5563 100%);
    box-shadow: 0 18px 34px rgba(75, 85, 99, 0.28);
}

button.primary:hover,
.button.primary:hover {
    box-shadow: 0 22px 38px rgba(75, 85, 99, 0.32);
}

button.primary:active,
.button.primary:active {
    box-shadow: 0 12px 22px rgba(75, 85, 99, 0.24);
}

button.secondary,
.button.secondary {
    background: linear-gradient(135deg, #f2f4f8 0%, #dfe3ec 100%);
    color: var(--tone-900);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 12px 22px rgba(148, 163, 184, 0.25);
}

button.secondary:hover,
.button.secondary:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 16px 26px rgba(148, 163, 184, 0.28);
}

button.secondary:active,
.button.secondary:active {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 16px rgba(148, 163, 184, 0.2);
}

button.danger,
.button.danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 18px 34px rgba(220, 38, 38, 0.3);
}

button.danger:hover,
.button.danger:hover {
    box-shadow: 0 22px 40px rgba(220, 38, 38, 0.34);
}

button.danger:active,
.button.danger:active {
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.26);
}

.table-wrapper {
    margin-top: 2rem;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.password-reset-row td {
    background: var(--surface-strong);
    border-top: 1px solid var(--tone-200);
}

.reset-password-form {
    margin: 0;
}

.reset-password-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 100%;
}

table th,
table td {
    padding: 0.9rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--tone-200);
}

table th {
    background: var(--tone-100);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.82rem;
    color: var(--tone-700);
}

table tr:nth-child(even) td {
    background: #f9fafb;
}

.table-actions-column {
    width: 3rem;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: transparent;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    color: inherit;
}

.icon-button:hover,
.icon-button:focus {
    background: rgba(0, 0, 0, 0.08);
    outline: none;
}

.icon-button-form {
    display: inline;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

main.auth-card {
    background: var(--surface-strong);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
    width: min(420px, 92vw);
    padding: clamp(2.25rem, 6vw, 3rem) clamp(1.75rem, 5vw, 2.75rem);
}

main.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
}

main.auth-card form {
    margin-top: 1rem;
}

main.auth-card p {
    text-align: center;
}

.auth-note {
    font-size: 0.95rem;
    color: var(--tone-500);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--tone-200);
    color: var(--tone-700);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--tone-500);
}

@media (min-width: 600px) {
    .top-bar-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .top-bar-status {
        flex-direction: row;
        align-items: center;
    }
}

@media (min-width: 720px) {
    .top-bar {
        padding: 4rem 2rem 0;
    }

    main.content {
        width: min(1080px, calc(100% - 4rem));
        margin: 2rem auto 3rem;
    }
}

@media (min-width: 960px) {
    .top-bar {
        padding: clamp(3rem, 4vw, 3.5rem) clamp(2.5rem, 6vw, 3.5rem) 0;
    }

    .top-bar-inner {
        flex-direction: row;
        align-items: center;
    }

    main.content {
        width: min(1080px, calc(100% - 6rem));
        margin: 2.25rem auto 3.5rem;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 4.5rem 1rem 0;
    }

    .top-bar-inner {
        padding: 1.25rem 1.5rem;
    }

    main.content {
        width: calc(100% - 2rem);
        margin: 1.5rem auto 2.5rem;
        padding: 1.5rem;
    }

    table th,
    table td {
        padding: 0.75rem;
    }
}

@media (max-width: 720px) {
    .table-wrapper {
        overflow-x: auto;
    }

    form.inline {
        gap: 0.5rem;
    }
}

.calendar-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.calendar-year-nav {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.calendar-year-nav__link {
    color: var(--accent-strong);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    background: rgba(55, 65, 81, 0.12);
    border: 1px solid rgba(55, 65, 81, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-year-nav__link:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 18px rgba(55, 65, 81, 0.2);
}

.calendar-year-nav__link:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.65);
    outline-offset: 3px;
}

.calendar-year-nav__current {
    font-size: 1.15rem;
    color: var(--tone-700);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--tone-700);
}

.calendar-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-legend__color {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.calendar-legend__color--positive {
    background: #d8f4e1;
}

.calendar-legend__color--negative {
    background: #f9d8d8;
}

.calendar-legend__color--neutral {
    background: #e7ecff;
}

.calendar-legend__color--off {
    background: #e4e7eb;
}

.calendar-legend__color--vacation {
    background: #d7e7ff;
}

.calendar-legend__color--absence {
    background: #ffe4cc;
}

.calendar-legend__color--holiday {
    background: #d8f2d6;
}

.calendar-legend__color--weekend {
    background: #eceff4;
}

.year-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: transparent;
}

.year-calendar thead th {
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
}

.year-calendar th,
.year-calendar td {
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.35rem;
    text-align: center;
    vertical-align: middle;
}

.year-calendar__day-header {
    font-size: 0.75rem;
    color: var(--tone-500);
}

.calendar-cell {
    padding: 0.25rem;
    height: 3.25rem;
    position: relative;
}

.calendar-cell--disabled {
    background: rgba(255, 255, 255, 0.45);
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--surface-strong);
    border: 1px solid rgba(148, 163, 184, 0.45);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tone-900);
    text-align: center;
    padding: 0.3rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.calendar-day--off {
    background: #e4e7eb;
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--tone-700);
}

.calendar-day--positive {
    background: #d8f4e1;
    border-color: rgba(74, 222, 128, 0.4);
    color: #064e3b;
}

.calendar-day--negative {
    background: #f9d8d8;
    border-color: rgba(248, 113, 113, 0.45);
    color: #7f1d1d;
}

.calendar-day--neutral {
    background: #e7ecff;
    border-color: rgba(99, 102, 241, 0.35);
    color: #1e3a8a;
}

.calendar-day--vacation {
    background: #d7e7ff;
    border-color: rgba(59, 130, 246, 0.45);
    color: #1d4ed8;
}

.calendar-day--absence {
    background: #ffe4cc;
    border-color: rgba(249, 115, 22, 0.45);
    color: #9a3412;
}

.calendar-day--holiday {
    background: #d8f2d6;
    border-color: rgba(74, 222, 128, 0.35);
    color: #065f46;
}

.calendar-day--weekend {
    background: #eceff4;
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--tone-500);
}

button.calendar-day {
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
}

.calendar-day--interactive {
    cursor: pointer;
}

.calendar-day--interactive:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 22px rgba(15, 23, 42, 0.18);
}

.calendar-day--interactive:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.55);
    outline-offset: 4px;
}

.calendar-day--interactive:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.calendar-day--interactive.calendar-day--vacation:hover,
.calendar-day--interactive.calendar-day--absence:hover,
.calendar-day--interactive.calendar-day--holiday:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(15, 23, 42, 0.15);
}

.calendar-details {
    margin-top: 2rem;
    background: var(--surface-strong);
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow-soft);
}

.calendar-details h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.calendar-details__placeholder {
    color: var(--tone-500);
    margin: 0;
}

.calendar-details__content {
    display: grid;
    gap: 1.25rem;
}

.calendar-details__date {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

.calendar-details__group {
    display: grid;
    gap: 0.4rem;
}

.calendar-details__group h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--tone-700);
}

.calendar-details__list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--tone-900);
    line-height: 1.45;
}

.calendar-details__text {
    margin: 0;
    color: var(--tone-900);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .year-calendar__day-header {
        font-size: 0.7rem;
    }

    .calendar-day {
        font-size: 0.72rem;
    }
}

@media (max-width: 768px) {
    .calendar-controls {
        align-items: flex-start;
    }

    .calendar-year-nav {
        gap: 0.75rem;
    }

    .calendar-day {
        min-height: 2.25rem;
    }
}
