:root {
    --bg-page: #1b1d20;
    --bg-panel: rgba(22, 24, 27, 0.82);
    --bg-panel-strong: rgba(28, 31, 34, 0.96);
    --bg-elevated: rgba(35, 38, 42, 0.9);
    --border-soft: rgba(148, 163, 184, 0.14);
    --text-main: #f3f4f6;
    --text-soft: #d4d8dc;
    --accent: #69d4a4;
    --accent-strong: #2ea884;
    --accent-soft: rgba(105, 212, 164, 0.18);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.38);
}

html, body {
    min-height: 100%;
    background: #2b2b2d;
    color: var(--text-main);
    font-family: "Segoe UI", "Inter", sans-serif;
}

body {
    margin: 0;
    padding: 24px;
}

#calendar {
    max-width: 1500px;
    margin: 0 auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.fc {
    --fc-border-color: rgba(148, 163, 184, 0.16);
    --fc-button-text-color: #f4fff9;
    --fc-button-bg-color: rgba(46, 168, 132, 0.8);
    --fc-button-border-color: rgba(46, 168, 132, 0.9);
    --fc-button-hover-bg-color: rgba(54, 191, 149, 0.95);
    --fc-button-hover-border-color: rgba(54, 191, 149, 1);
    --fc-button-active-bg-color: rgba(20, 121, 90, 1);
    --fc-button-active-border-color: rgba(20, 121, 90, 1);
    --fc-today-bg-color: rgba(105, 212, 164, 0.12);
    color: var(--text-main);
}

.fc-toolbar {
    padding: 1rem 1.25rem 0.5rem;
    background: rgba(9, 27, 34, 0.8);
    border-bottom: 1px solid var(--border-soft);
}

.fc-toolbar-title {
    font-size: clamp(1.45rem, 2vw, 2.25rem);
    letter-spacing: 0.03em;
    font-weight: 700;
}

.fc-button {
    border: none !important;
    border-radius: 12px !important;
    padding: 0.65rem 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fc-button:hover {
    transform: translateY(-1px);
}

.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.fc .fc-view-harness {
    background: rgba(2, 11, 16, 0.35);
}

.fc-daygrid-day {
    background: rgba(12, 32, 37, 0.12);
}

.fc-daygrid-day-frame {
    min-height: 110px;
}

.fc-daygrid-day-number {
    color: var(--text-soft);
    padding: 0.5rem 0.7rem 0;
    font-weight: 600;
}

.fc-day-today {
    background: rgba(105, 212, 164, 0.09) !important;
}

.fc-day-today .fc-daygrid-day-number {
    color: var(--accent);
}

.fc-event {
    border: 0 !important;
    border-radius: 10px !important;
    padding: 0.18rem 0.4rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.fc-event-title {
    white-space: normal;
    line-height: 1.3;
}

.fc-col-header-cell-cushion {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    padding: 0.8rem 0;
}

.fc-scrollgrid {
    border: 0 !important;
}

.fc-theme-bootstrap5 .fc-popover {
    background: var(--bg-panel-strong);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
}

.modal-content {
    background: linear-gradient(180deg, rgba(9, 27, 34, 0.98), rgba(18, 39, 46, 0.92));
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border-soft);
}

.modal-title {
    font-weight: 700;
}

.form-control,
.input-group .form-control {
    background: rgba(15, 35, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-main);
    border-radius: 12px;
    min-height: 52px;
    padding: 0.9rem 1rem;
}

.form-control:focus,
.input-group .form-control:focus {
    background: rgba(15, 35, 42, 0.85);
    border-color: rgba(105, 212, 164, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(105, 212, 164, 0.22);
    color: var(--text-main);
}

.form-floating > label {
    color: var(--text-soft);
}

.input-daterange {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-group-addon {
    color: var(--text-soft);
    font-weight: 600;
    padding: 0.5rem 0.25rem;
}

.btn {
    border-radius: 12px;
    padding: 0.72rem 1.2rem;
    font-weight: 600;
    border: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 12px 25px rgba(46, 168, 132, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7ae0b5, var(--accent-strong));
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-main);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, #dc2626);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--accent);
}

a,
a:hover {
    color: var(--text-main);
    text-decoration: none !important;
}

.fc-icon {
    color: var(--text-main);
}

.input-group .input-group-addon {
    margin-left: 5px !important;
    margin-right: 5px !important;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    #calendar {
        border-radius: 16px;
    }

    .fc-toolbar {
        display: block !important;
        text-align: center;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        margin-bottom: 0.55rem;
    }

    .fc-header-toolbar {
        gap: 0.35rem;
    }

    .fc-daygrid-day-frame {
        min-height: 90px;
    }
}