/* Tokens and base components reproduced from https://freeslots.bazabz.ru/ui-kit (2026-10-20). */
:root {
    --font-bump: 0px;
    --btn-height: 36px;
    --bg-app: #fff;
    --bg-sidebar: #f8fafc;
    --border: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
}
* {
    box-sizing: border-box;
}
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}
body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text-main);
    background: #fff;
    font-size: 14px;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
input,
select,
textarea {
    outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
}
button {
    cursor: pointer;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.app-shell {
    display: flex;
    height: 100dvh;
    background: var(--bg-app);
}
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    height: 100%;
}
.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 7px 10px 23px;
    font-weight: 650;
    font-size: 15px;
}
.brand-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e0e7ff;
    color: #1d4ed8;
}
.menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: 10px;
    color: #374151;
    text-decoration: none;
    font-size: calc(14px + var(--font-bump));
    height: var(--btn-height);
    min-height: var(--btn-height);
    background: transparent;
    border: 0;
    text-align: left;
}
.menu-item svg {
    color: #6b7280;
}
.menu-item:hover {
    background: #eef2ff;
    color: #1f2937;
}
.menu-item.active {
    background: #e0e7ff;
    color: #1d4ed8;
    font-weight: 600;
}
.menu-item.active svg {
    color: inherit;
}
.nav-count {
    margin-left: auto;
    font-size: 12px;
    background: #fff;
    padding: 2px 7px;
    border-radius: 6px;
}
.menu-label {
    margin: 24px 10px 4px;
    font-size: 11px;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.footer-menu {
    margin-top: auto;
    padding-top: 16px;
}
.footer-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    font-family: inherit;
    text-decoration: none;
    color: inherit;
}
.footer-title {
    font-size: 13px;
    font-weight: 600;
}
.main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 20px;
}
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.page-title {
    margin: 0;
    font-size: calc(24px + var(--font-bump));
    font-weight: 700;
    letter-spacing: -0.025em;
}
.page-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: calc(14px + var(--font-bump));
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.page-divider {
    border-top: 1px solid var(--border);
    margin: 12px 0 18px;
}
.section {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
}
.section h2 {
    margin: 0 0 8px;
    font-size: calc(18px + var(--font-bump));
}
.section p {
    color: var(--text-muted);
    line-height: 1.45;
}
.btn {
    min-height: var(--btn-height);
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: calc(14px + var(--font-bump));
    line-height: 1.1;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    color: #fff;
    background: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-secondary {
    color: #374151;
    background: #fff;
    border-color: #d1d5db;
}
.btn-secondary:hover {
    border-color: #9ca3af;
    color: #111827;
}
.btn-danger {
    color: #fff;
    background: var(--danger);
}
.btn-danger:hover {
    background: var(--danger-hover);
}
.btn-ghost {
    color: var(--primary);
    background: #eff6ff;
    border-color: #bfdbfe;
}
.icon-btn {
    padding: 0;
    width: var(--btn-height);
}
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
label {
    font-size: calc(13px + var(--font-bump));
    color: #374151;
}
input,
select,
textarea {
    min-height: var(--btn-height);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 10px;
    font-size: calc(14px + var(--font-bump));
    width: 100%;
    color: #111827;
    background: #fff;
}
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #bfdbfe;
    border-color: var(--primary);
}
textarea {
    min-height: 92px;
    padding: 10px;
    resize: vertical;
}
.hint {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}
.cards-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}
.mini-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}
.mini-card-title {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mini-card-value {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 700;
}
.mini-card .hint {
    display: block;
    margin-top: 4px;
}
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    min-height: 30px;
    padding: 0 14px;
    font-size: 14px;
    border: 1.5px solid transparent;
    line-height: 1;
    white-space: nowrap;
}
.badge-success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}
.badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}
.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}
.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.alert-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.demo-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: #6b7280;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
}
.demo-note b {
    color: #374151;
}
.demo-note a {
    color: var(--primary);
    margin-left: auto;
    white-space: nowrap;
}
.tab-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.tab-button {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    padding: 0 18px;
    border-radius: 999px;
    min-height: var(--btn-height);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.tab-button.is-active {
    background: #e0e7ff;
    border-color: #c7d2fe;
    color: #1d4ed8;
    font-weight: 600;
}
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar .search {
    max-width: 270px;
    flex: 1;
    min-width: 180px;
}
.toolbar select {
    width: auto;
    max-width: 220px;
}
.period {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.period strong {
    min-width: 135px;
    text-align: center;
    font-weight: 600;
    text-transform: capitalize;
}
.calendar-section {
    padding: 0;
    overflow: hidden;
}
.calendar-top {
    padding: 16px 16px 0;
}
.table-wrap {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    font-size: 14px;
}
th,
td {
    border-bottom: 1px solid var(--border);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}
th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}
tr:last-child td {
    border-bottom: 0;
}
.calendar {
    table-layout: fixed;
    min-width: 1000px;
}
.calendar th,
.calendar td {
    padding: 0;
    text-align: center;
    border-right: 1px solid #f0f1f3;
    height: 66px;
}
.calendar th {
    height: 56px;
    font-weight: 400;
    font-size: 12px;
}
.calendar th:first-child,
.calendar td:first-child {
    width: 234px;
    text-align: left;
    padding: 10px 16px;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    border-right: 1px solid var(--border);
}
.calendar th:first-child {
    background: #f9fafb;
    z-index: 3;
}
.calendar td {
    position: relative;
}
.calendar .weekend {
    background: #f8fafc;
}
.calendar .today {
    background: #eff6ff;
}
.day-number {
    display: block;
    margin: 4px auto 0;
    font-weight: 600;
    font-size: 13px;
    width: 24px;
    line-height: 24px;
}
.today .day-number {
    background: var(--primary);
    color: white;
    border-radius: 6px;
}
.person {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.person-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.person small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.absence {
    position: absolute;
    left: 2px;
    top: 18px;
    height: 30px;
    width: calc(100% - 3px);
    border: 1px solid #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0;
    font-size: 11px;
    z-index: 1;
    overflow: hidden;
    white-space: nowrap;
}
.absence.start {
    border-radius: 6px 0 0 6px;
}
.absence.end {
    border-radius: 0 6px 6px 0;
}
.absence.start.end {
    border-radius: 6px;
}
.absence.pending {
    border: 1px dashed #93c5fd;
    background: #eff6ff;
}
.absence.business {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.absence.unpaid {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}
.absence.other {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.absence:hover {
    filter: brightness(0.95);
    outline: 2px solid #2563eb;
    z-index: 4;
}
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 16px;
    color: #6b7280;
    font-size: 12px;
}
.legend span {
    display: flex;
    gap: 7px;
    align-items: center;
}
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #dbeafe;
    border: 1px solid #93c5fd;
}
.dot.green {
    background: #dcfce7;
    border-color: #86efac;
}
.dot.gray {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.dot.yellow {
    background: #fffbeb;
    border-color: #fde68a;
}
.dot.dashed {
    background: #eff6ff;
    border-style: dashed;
}
.empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}
.empty h2 {
    color: var(--text-main);
    font-size: 18px;
}
.row-actions {
    display: flex;
    gap: 8px;
}
.bottom-note {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    gap: 16px;
    margin-top: 18px;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.info-row {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.info-row:last-child {
    border: 0;
}
.info-row small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
}
.progress {
    height: 7px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}
.progress i {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 8px;
}
.hamburger {
    display: none;
}
dialog {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(560px, calc(100vw - 32px));
    max-height: 90dvh;
    color: var(--text-main);
    box-shadow: 0 24px 80px #0f172a26;
}
dialog::backdrop {
    background: #0f172a66;
}
.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.dialog-head h2 {
    font-size: 18px;
    margin: 0;
}
.dialog-body {
    padding: 20px;
    display: grid;
    gap: 18px;
}
.dialog-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.error {
    color: #991b1b;
    background: #fee2e2;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
}
.full {
    grid-column: 1/-1;
}
#toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: calc(100vw - 48px);
    border: 1px solid #86efac;
    border-radius: 10px;
    background: #ecfdf3;
    color: #166534;
    padding: 14px 20px;
    z-index: 100;
    box-shadow: 0 8px 28px #0f172a12;
    display: none;
}
.activity-row {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.activity-row p {
    margin: 4px 0;
}
.chart-row {
    display: grid;
    grid-template-columns: 150px 1fr 45px;
    gap: 16px;
    align-items: center;
    margin: 22px 0;
}
.chart-row .progress {
    margin: 0;
    height: 16px;
}
.settings-form {
    max-width: 650px;
    display: grid;
    gap: 20px;
}
.settings-form input[type="number"] {
    max-width: 180px;
}
.loading {
    padding: 48px;
    color: var(--text-muted);
}
@media (min-width: 1600px) {
    .main {
        padding: 28px 32px;
    }
}
@media (max-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .top-bar {
        flex-wrap: wrap;
    }
    .top-actions {
        margin-left: 0;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .period {
        margin-left: 0;
    }
}
@media (max-width: 768px) {
    :root {
        --font-bump: 2px;
        --btn-height: 42px;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 50;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 0 100vmax #0f172a66;
    }
    .main {
        padding: 16px;
    }
    .hamburger {
        display: inline-flex;
    }
    .page-title {
        font-size: 24px;
    }
    .top-bar {
        align-items: flex-start;
    }
    .top-actions {
        width: 100%;
    }
    .top-actions .btn-primary {
        flex: 1;
    }
    .cards-grid {
        gap: 8px;
    }
    .mini-card {
        padding: 12px;
    }
    .mini-card-title {
        font-size: 12px;
    }
    .mini-card-title svg {
        display: none;
    }
    .mini-card-value {
        font-size: 23px;
    }
    .field-grid {
        grid-template-columns: 1fr;
    }
    .demo-note {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .demo-note a {
        margin-left: 0;
    }
    .toolbar .search {
        max-width: none;
        width: 100%;
    }
    .toolbar select {
        max-width: none;
        flex: 1;
    }
    .period {
        width: 100%;
        justify-content: space-between;
    }
    .calendar th:first-child,
    .calendar td:first-child {
        width: 190px;
    }
    .bottom-note {
        flex-direction: column;
    }
    .chart-row {
        grid-template-columns: 110px 1fr 30px;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
}
@media (prefers-reduced-motion: no-preference) {
    button,
    a {
        transition:
            background 0.15s,
            border-color 0.15s;
    }
    .sidebar {
        transition: transform 0.2s;
    }
}

select {
    appearance: none;
    padding-right: 30px;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 50%,
        calc(100% - 11px) 50%;
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}
