:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --line: #e4e9ef;
    --line-soft: #edf1f5;
    --text: #182231;
    --muted: #6d7685;
    --blue: #1aa3df;
    --green: #20b99f;
    --amber: #f4b000;
    --red: #ff3d4f;
    --shadow: 0 6px 18px rgba(24, 34, 49, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 18px 24px 10px;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #e8edf3;
    color: #3d4858;
    padding: 0 18px;
    cursor: pointer;
}

.tab.active {
    background: var(--blue);
    color: #ffffff;
    font-weight: 700;
}

.tab:disabled {
    opacity: 0.55;
    cursor: default;
}

.workspace {
    padding: 0 24px 28px;
}

.summary {
    display: grid;
    grid-template-columns: 292px 292px minmax(420px, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}

.summary-card {
    min-height: 132px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 18px;
    text-align: center;
}

.summary-card strong {
    font-size: 34px;
    line-height: 1.1;
}

.summary-card span {
    color: var(--muted);
}

.summary-label {
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 700;
    color: #9aa4b2;
}

.user-card strong {
    font-size: 22px;
}

.toolbar {
    min-height: 58px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
}

.period-controls,
.view-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 8px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.switch-button {
    height: 34px;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 8px;
    padding: 0 12px;
    color: #3d4858;
    cursor: pointer;
}

.switch-button.active {
    background: #182231;
    color: #ffffff;
}

.calendar-panel {
    display: grid;
    grid-template-columns: 438px minmax(620px, 1fr);
    min-height: 650px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.people-panel {
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.people-head {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 22px;
}

.search-box {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.search-box input {
    width: 100%;
    height: 36px;
    border: 1px solid #cfd7e2;
    border-radius: 7px;
    padding: 0 12px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 163, 223, 0.16);
}

.people-list {
    overflow: auto;
    max-height: 590px;
}

.row-label {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}

.row-label.department {
    height: 42px;
    font-weight: 800;
    background: #fbfcfd;
}

.chevron {
    width: 18px;
    color: #111827;
    font-size: 22px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #a6b0bd;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex: 0 0 auto;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--red);
    flex: 0 0 auto;
}

.status-dot.warn {
    background: var(--amber);
}

.timeline-wrap {
    overflow: auto;
}

.timeline-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.time-cell {
    height: 52px;
    min-width: 52px;
    border-right: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.time-cell.today {
    background: var(--blue);
    color: #ffffff;
}

.time-cell .weekday {
    display: block;
    font-size: 11px;
    color: inherit;
    opacity: 0.75;
}

.timeline-grid {
    position: relative;
    display: grid;
}

.grid-row {
    position: relative;
    display: grid;
    border-bottom: 1px solid var(--line-soft);
}

.grid-row.department {
    height: 42px;
    background: #fbfcfd;
}

.grid-row.person {
    height: 52px;
}

.grid-cell {
    min-width: 52px;
    border-right: 1px solid var(--line-soft);
}

.grid-cell.weekend {
    background: #faf2f2;
}

.grid-cell.today {
    background: rgba(26, 163, 223, 0.22);
}

.absence {
    position: absolute;
    top: 14px;
    height: 24px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 10px 18px rgba(32, 185, 159, 0.18);
    cursor: pointer;
}

.absence.single {
    width: 24px;
}

.tooltip {
    position: fixed;
    z-index: 20;
    display: none;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #182231;
    color: #ffffff;
    box-shadow: var(--shadow);
    font-size: 13px;
    pointer-events: none;
}

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

    .calendar-panel {
        grid-template-columns: 320px minmax(620px, 1fr);
    }
}
