/* Calendar components use the shared FreeSlots UI-kit tokens. */
.upcoming-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.upcoming-item {
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-main);
}
.upcoming-item small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}
.balance-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.balance-person {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 210px;
}
.balance-person .btn {
    margin-top: 4px;
    align-self: flex-start;
}
.balance-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(75px, 1fr));
    flex: 1;
    gap: 20px;
}
.balance-values span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}
.balance-values b {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}
.balance-notes {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.long-warning,
.negative {
    color: #92400e;
}
.scale-tabs {
    margin-left: auto;
}
.scale-tabs .tab-bar,
.calendar-top .toolbar > .tab-bar {
    margin-bottom: 0;
}
.timeline-scroll {
    overflow: auto;
    max-height: 650px;
    position: relative;
}
.timeline-inner {
    min-width: 100%;
}
.timeline-header,
.timeline-row,
.timeline-group {
    display: flex;
    position: relative;
    width: 100%;
    border-bottom: 1px solid var(--border);
}
.timeline-header {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--bg-sidebar);
}
.timeline-corner {
    position: sticky;
    left: 0;
    z-index: 7;
    flex: 0 0 234px;
    background: var(--bg-sidebar);
    padding: 22px 16px;
    border-right: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}
.timeline-dates {
    flex-shrink: 0;
}
.timeline-months {
    display: flex;
    height: 32px;
    border-bottom: 1px solid var(--border);
}
.timeline-months span {
    flex-shrink: 0;
    text-align: center;
    font-size: 12px;
    line-height: 32px;
    border-right: 1px solid var(--border);
    text-transform: capitalize;
    overflow: hidden;
}
.timeline-weeks {
    height: 28px;
    position: relative;
}
.timeline-weeks span {
    position: absolute;
    text-align: center;
    line-height: 28px;
    font-size: 11px;
    color: var(--text-muted);
}
.timeline-group {
    background: var(--bg-sidebar);
    height: 38px;
}
.timeline-group > button {
    position: sticky;
    left: 0;
    z-index: 4;
    flex: 0 0 234px;
    border: 0;
    border-right: 1px solid var(--border);
    padding: 0 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-sidebar);
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}
.timeline-group small {
    margin-left: auto;
    color: var(--text-muted);
}
.timeline-person {
    position: sticky;
    left: 0;
    z-index: 4;
    flex: 0 0 234px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
    color: var(--text-main);
}
.timeline-person b {
    font-size: 12px;
    font-weight: 600;
    display: block;
    max-width: 158px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.timeline-person small {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}
.timeline-person:hover,
.selected-person .timeline-person {
    background: #eff6ff;
}
.timeline-track {
    position: relative;
    flex-shrink: 0;
    height: 62px;
    background: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(var(--unit) * 7 - 1px),
        #f1f5f9 calc(var(--unit) * 7 - 1px),
        #f1f5f9 calc(var(--unit) * 7)
    );
}
.today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary);
    opacity: 0.35;
    pointer-events: none;
    z-index: 2;
}
.timeline-period {
    position: absolute;
    top: 17px;
    height: 29px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    background: #dbeafe;
    color: #1d4ed8;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 3px;
    font-size: 11px;
    z-index: 3;
}
.timeline-period:hover {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
.timeline-period.pending {
    border-style: dashed;
    opacity: 0.75;
}
.type-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    background: #dbeafe;
    border: 1px solid #93c5fd;
}
.type-dot.pending {
    background: #fff;
    border-style: dashed;
}
.business {
    --type-bg: #dcfce7;
    --type-fg: #166534;
    --type-border: #86efac;
}
.unpaid {
    --type-bg: #f3f4f6;
    --type-fg: #4b5563;
    --type-border: #d1d5db;
}
.sick {
    --type-bg: #fffbeb;
    --type-fg: #92400e;
    --type-border: #fde68a;
}
.maternity {
    --type-bg: #e0e7ff;
    --type-fg: #1d4ed8;
    --type-border: #c7d2fe;
}
.truancy {
    --type-bg: #fee2e2;
    --type-fg: #991b1b;
    --type-border: #fca5a5;
}
.other {
    --type-bg: #f8fafc;
    --type-fg: #374151;
    --type-border: #d1d5db;
}
.timeline-period:not(.vacation),
.type-dot:not(.vacation):not(.pending),
.month-day.approved:not(.vacation),
.month-day.pending:not(.vacation) {
    background: var(--type-bg);
    color: var(--type-fg);
    border-color: var(--type-border);
}
.year-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.month-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
.month-card h2 {
    font-size: 16px;
    text-transform: capitalize;
    margin: 0;
}
.month-card h2 span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}
.month-card p {
    margin: 6px 0 14px;
}
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}
.weekday {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 0;
}
.month-day {
    height: 33px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    color: var(--text-main);
}
.month-day.weekend {
    background: var(--bg-sidebar);
    color: var(--text-muted);
}
.month-day.holiday {
    background: #fffbeb;
    color: #92400e;
}
.month-day.today {
    box-shadow: inset 0 0 0 2px var(--primary);
    font-weight: 700;
}
.month-day.approved,
.month-day.pending {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.month-day.pending {
    border-style: dashed;
}
.month-day.range-start {
    background: var(--primary);
    color: white;
}
.month-day:hover {
    outline: 1px solid var(--primary);
}
.selection-guide {
    margin-bottom: 12px;
}
.employee-picker {
    min-width: 280px;
    max-width: 420px;
}
.text-button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.text-button:hover {
    text-decoration: underline;
}
.summary-table {
    min-width: 1400px;
}
.summary-table th {
    font-size: 12px;
    max-width: 130px;
}
.summary-table th:first-child,
.summary-table td:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    min-width: 180px;
}
.summary-table th:first-child {
    background: #f9fafb;
}
.pagination {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-muted);
    font-size: 13px;
}
.dialog-footer {
    flex-wrap: wrap;
}
.pre-wrap {
    white-space: pre-wrap;
}
.reviewer-list {
    display: grid;
    gap: 10px;
    max-height: 240px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.reviewer-list label {
    display: flex;
    gap: 10px;
    align-items: center;
}
.reviewer-list input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.settings-tabs {
    margin-bottom: 20px;
}
.allocation-form {
    display: grid;
    gap: 16px;
    max-width: 700px;
}
.allocation-form .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
#print-document {
    display: none;
}
.heatmap {
    display: grid;
    grid-template-columns: 150px repeat(12, minmax(40px, 1fr));
    min-width: 750px;
    gap: 4px;
}
.heatmap span {
    padding: 10px 4px;
    font-size: 12px;
    text-align: center;
    border-radius: 5px;
}
.heatmap .heatmap-label {
    text-align: left;
    color: var(--text-muted);
}
@media (max-width: 1200px) {
    .year-month-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}
@media (max-width: 768px) {
    .year-month-grid {
        grid-template-columns: 1fr;
    }
    .balance-values {
        gap: 10px;
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
    }
    .balance-values span {
        font-size: 11px;
    }
    .balance-values b {
        font-size: 20px;
    }
    .employee-picker {
        min-width: 100%;
        max-width: 100%;
    }
    .allocation-form .field-grid {
        grid-template-columns: 1fr;
    }
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    .month-day {
        height: 42px;
    }
    .scale-tabs {
        margin-left: 0;
    }
}
@media print {
    body > * {
        display: none !important;
    }
    #print-document {
        display: block !important;
        padding: 30px;
        font: 14px/1.7 system-ui;
        color: #000;
    }
    #print-document h1 {
        font-size: 22px;
    }
}
.advanced-settings {
    border: 0;
    padding: 0;
    min-width: 0;
}
.advanced-settings > details {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding: 18px 0;
}
.advanced-settings summary,
.department-tree summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}
.advanced-settings form {
    display: grid;
    gap: 14px;
    max-width: 780px;
    margin: 18px 0;
}
.advanced-settings label {
    display: block;
}
.advanced-settings input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}
.advanced-settings textarea {
    width: 100%;
}
.department-tree {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
}
.department-tree ul {
    list-style: none;
    border-left: 1px solid #e5e7eb;
    padding-left: 18px;
}
.department-tree li {
    padding: 4px;
}
.document-print {
    white-space: pre-wrap;
    font:
        14pt/1.7 Georgia,
        serif;
}
#document-output {
    min-height: 330px;
}
.advanced-settings details[open] > summary {
    color: #3159bd;
}

.timeline-period[class*="custom_"],
.month-day[class*="custom_"],
.type-dot[class*="custom_"] {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

/* Settings tabs use the UI-kit active tab tokens. */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}
.settings-tabs [role="tab"] {
    min-height: var(--btn-height);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    background: var(--bg-app);
    font-weight: 500;
}
.settings-tabs [role="tab"]:hover {
    background: var(--bg-sidebar);
    color: var(--text-main);
}
.settings-tabs [aria-selected="true"],
.settings-tabs [aria-selected="true"]:hover {
    color: #1d4ed8;
    background: #e0e7ff;
    border-color: #c7d2fe;
}
.advanced-settings [role="tabpanel"][hidden] {
    display: none;
}
.advanced-settings [role="tabpanel"] > .section {
    margin-bottom: 16px;
}
.advanced-settings .btn {
    justify-self: start;
}
.advanced-settings .field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 768px) {
    .settings-tabs {
        gap: 6px;
    }
    .settings-tabs [role="tab"] {
        flex: 1 1 auto;
    }
    .advanced-settings .field-grid {
        grid-template-columns: 1fr;
    }
}
.advanced-settings form.reference-settings {
    max-width: none;
    margin: 0 0 16px;
}
.reference-settings .section {
    display: grid;
    gap: 16px;
}
.reference-settings .field {
    max-width: 780px;
    display: grid;
    gap: 8px;
}
.setting-switch {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    max-width: 780px;
}
.setting-switch input {
    width: 18px !important;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--primary);
}
.settings-picker {
    max-width: 780px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
}
.settings-picker .reviewer-list {
    max-height: 240px;
    overflow: auto;
    padding: 12px 0;
}
.settings-save {
    display: flex;
    gap: 16px;
    align-items: center;
}

.settings-save-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border, #e5e7eb);
}
[data-doc-form] {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}
[data-doc-form] > label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 10px;
}
[data-doc-form] input[type="checkbox"] {
    width: 18px;
    height: 18px;
}
[data-doc-form] button[type="submit"] {
    justify-self: start;
}
.doc-template-table td:nth-child(6),
.doc-template-table td:nth-child(7) {
    white-space: nowrap;
}
