/* Bonussystem Si-Ju - Custom Styles */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
}

/* Layout */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1450px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Super-Admin Banner */
.super-admin-banner {
    background: #fff3cd;
    padding: 0.5rem;
    text-align: center;
    border-bottom: 1px solid #ffc107;
    font-size: 0.875rem;
}

.super-admin-banner a {
    color: var(--primary);
    margin-left: 0.5rem;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: width 0.2s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    min-height: 57px;
}

.sidebar-logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.sidebar-toggle:hover {
    color: #1f2937;
}

.sidebar-toggle .icon-close {
    display: none;
}

.sidebar.collapsed .sidebar-toggle .icon-menu {
    display: none;
}

.sidebar.collapsed .sidebar-toggle .icon-close {
    display: block;
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

/* Tenant Switcher */
.tenant-switcher {
    flex: 1;
    min-width: 0;
}

.tenant-switcher-select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: white;
    cursor: pointer;
}

.tenant-switcher-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.sidebar.collapsed .tenant-switcher {
    display: none;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-group {
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

.nav-group-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 0.5rem 0.5rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-group-label {
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #4b5563;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-light);
    color: #1f2937;
}

.nav-item.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 500;
    border-left: 3px solid var(--primary);
    padding-left: calc(0.5rem - 3px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.5rem;
}

.sidebar.collapsed .nav-item.active {
    padding-left: 0.5rem;
    border-left: none;
}

.sidebar.collapsed .nav-group {
    padding: 0 0.5rem;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem;
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-user .nav-label {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer .nav-item {
    justify-content: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
    overflow-x: hidden;
    transition: margin-left 0.2s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 64px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.mobile-header-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

.sidebar-overlay.active {
    display: block;
}

/* Main Content */
main {
    padding-bottom: 3rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.page-header p {
    color: var(--muted);
    margin: 0;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

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

/* Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--muted);
    background: var(--bg-light);
}

tr:hover {
    background: var(--bg-light);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    color: #374151;
}

.btn:hover {
    background: var(--bg-light);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

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

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-muted {
    background: #f3f4f6;
    color: #6b7280;
}

/* Bonus Report Specific */
.bonus-schema {
    overflow-x: auto;
}

.bonus-schema table {
    min-width: 800px;
}

.bonus-schema th {
    white-space: nowrap;
}

.bonus-schema .sum-row {
    font-weight: 600;
    background: var(--bg-light);
}

.bonus-schema .total-col {
    background: #eff6ff;
}

.pool-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pool-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.375rem;
    text-align: center;
}

.pool-item .label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pool-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
}

.login-container .card {
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--muted);
}

/* Utility Classes */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-mono { font-family: monospace; }
.font-bold { font-weight: 600; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Print Styles */
@media print {
    .sidebar, .sidebar-overlay, .mobile-header, .btn, .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
    }

    .card {
        border: none;
        box-shadow: none;
    }
}

/* ================================
   Calendar UI
   ================================ */

/* Toolbar */
.cal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cal-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.15s;
}

.cal-nav-btn:hover {
    background: var(--bg-light);
}

.cal-title {
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.cal-views {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    overflow: hidden;
}

.cal-view-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: white;
    font-size: 0.8125rem;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border);
}

.cal-view-btn:last-child {
    border-right: none;
}

.cal-view-btn.active {
    background: var(--primary);
    color: white;
}

.cal-view-btn:hover:not(.active) {
    background: var(--bg-light);
}

/* Legend */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.cal-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Calendar Grid */
.cal-container {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.cal-grid {
    display: grid;
    min-width: fit-content;
}

.cal-grid-month {
    grid-template-columns: 160px repeat(var(--days), minmax(28px, 1fr));
}

.cal-grid-week {
    grid-template-columns: 160px repeat(7, 1fr);
}

/* Header cells */
.cal-header-cell {
    padding: 0.25rem 0.125rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
    border-right: 1px solid #f3f4f6;
    user-select: none;
}

.cal-header-cell .cal-day-num {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.cal-header-week {
    padding: 0.5rem 0.25rem;
    font-size: 0.8125rem;
}

/* Name column */
.cal-name-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: white;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    border-right: 2px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-corner {
    position: sticky;
    left: 0;
    z-index: 3;
    background: white;
    border-bottom: 2px solid var(--border);
    border-right: 2px solid var(--border);
}

/* Day cells */
.cal-day-cell {
    position: relative;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    min-height: 40px;
    user-select: none;
}

.cal-day-cell-week {
    min-height: 60px;
    padding: 0.25rem;
}

.cal-day-weekend {
    background: #f3f4f6;
}

.cal-day-holiday {
    background: #ede9fe;
}

.cal-day-today {
    background-color: hsl(221 83% 90% / 1);
    /*box-shadow: inset 0 0 0 2px var(--primary);*/
}

.cal-header-cell.cal-day-today .cal-day-num {
    background: var(--primary);
    color: white;
    border-radius: 11px;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    padding: 0 6px;
    display: block;
    margin: 0 auto;
    text-align: center;
    width: fit-content;
}

.cal-day-cell.cal-clickable {
    cursor: pointer;
}

.cal-day-cell.cal-clickable:hover {
    background: #eff6ff;
}

.cal-day-cell.cal-drag-selected {
    background: #dbeafe !important;
}

.cal-day-weekend.cal-clickable:hover {
    background: #e5e7eb;
}

/* Employee row (relative container for bars) */
.cal-employee-row {
    display: contents;
}

/* Absence bars */
.cal-bar {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 4px;
    z-index: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: filter 0.15s;
    box-sizing: border-box;
}

.cal-bar:hover {
    filter: brightness(0.9);
    z-index: 5;
}

.cal-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Absence type colors */
.cal-type-vacation { background: #3b82f6; color: white; }
.cal-type-sick_with_pay { background: #f59e0b; color: #78350f; }
.cal-type-holiday { background: #8b5cf6; color: white; }
.cal-type-sick_without_pay { background: #ef4444; color: white; }
.cal-type-unexcused {
    background: repeating-linear-gradient(
        -45deg,
        #dc2626,
        #dc2626 4px,
        #b91c1c 4px,
        #b91c1c 8px
    );
    color: white;
}
.cal-type-parental_leave { background: #14b8a6; color: white; }
.cal-type-unpaid_leave { background: #6b7280; color: white; }
.cal-type-suspended {
    background: repeating-linear-gradient(
        0deg,
        #a1a1aa,
        #a1a1aa 3px,
        #d4d4d8 3px,
        #d4d4d8 6px
    );
    color: #3f3f46;
}

/* Bar continuation indicators */
.cal-bar-continues-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.cal-bar-continues-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Calendar Modal */
.cal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
}

.cal-modal-overlay.active {
    display: flex;
}

.cal-modal {
    background: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow-y: auto;
}

.cal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cal-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.cal-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    line-height: 1;
}

.cal-modal-body {
    padding: 1.5rem;
}

.cal-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
}

.cal-modal-footer .btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Warnings in modal */
.cal-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #92400e;
    margin-bottom: 1rem;
}

/* Year view */
.cal-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.cal-mini-month {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.cal-mini-month:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cal-mini-month h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--primary);
}

.cal-mini-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.cal-mini-name {
    width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.cal-mini-bar-container {
    flex: 1;
    height: 12px;
    background: #f3f4f6;
    border-radius: 2px;
    display: flex;
    overflow: hidden;
}

.cal-mini-segment {
    height: 100%;
}

/* Print styles for calendar */
@media print {
    .cal-toolbar .cal-views,
    .cal-toolbar .cal-nav-btn,
    .cal-modal-overlay,
    .no-print,
    .absence-summary-col {
        display: none !important;
    }

    .cal-container {
        overflow: visible;
        border: 1px solid #ccc;
    }

    .cal-grid {
        min-width: 100%;
    }

    .cal-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cal-day-weekend,
    .cal-day-holiday,
    .cal-type-vacation,
    .cal-type-sick_with_pay,
    .cal-type-holiday,
    .cal-type-sick_without_pay,
    .cal-type-unexcused,
    .cal-type-parental_leave,
    .cal-type-unpaid_leave,
    .cal-type-suspended {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    body {
        font-size: 10pt;
    }

    .cal-title {
        font-size: 14pt;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 100;
        width: 240px;
    }

    .sidebar.collapsed {
        width: 240px;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.open .nav-label {
        opacity: 1;
        width: auto;
    }

    .sidebar.open .nav-group-label {
        visibility: visible;
        height: auto;
        padding: 0.5rem 0.5rem 0.25rem;
    }

    .sidebar.open .sidebar-logo {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .container {
        padding: 0 0.75rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .cal-toolbar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cal-nav {
        justify-content: center;
    }

    .cal-views {
        align-self: center;
    }

    .cal-name-cell {
        max-width: 100px;
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }

    .cal-grid-month {
        grid-template-columns: 100px repeat(var(--days), minmax(28px, 1fr));
    }

    .cal-mobile-hint {
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--muted);
        padding: 0.25rem;
    }

    .absence-layout {
        flex-direction: column;
    }

    .absence-summary-col {
        width: 100%;
        max-height: none;
        position: static;
    }
}

.cal-mobile-hint {
    display: none;
}

/* ================================
   Absence Layout: Calendar + Summary
   ================================ */
.absence-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.absence-calendar-col {
    flex: 1;
    min-width: 0;
}

.absence-summary-col {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-height: 70vh;
    overflow-y: auto;
    position: sticky;
    top: 1rem;
}

.absence-summary-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.absence-summary-header h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

/* Summary employee blocks */
.summary-employee {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border);
}

.summary-employee:last-child {
    border-bottom: none;
}

.summary-employee-name {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.summary-type-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    font-size: 0.75rem;
}

.summary-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.summary-type-label {
    flex: 1;
    color: #4b5563;
}

.summary-type-days {
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
}

/* ================================
   Batch Sales Wizard
   ================================ */

.batch-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1rem 0;
}

.batch-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--muted);
    transition: all 0.2s;
}

.batch-step.active {
    color: var(--primary);
    font-weight: 600;
}

.batch-step.done {
    color: var(--success);
}

.batch-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.8125rem;
}

.batch-step.active .batch-step-num {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.batch-step.done .batch-step-num {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.batch-step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* Rule Cards */
.rule-card-category h3 {
    font-size: 0.875rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}

.rule-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.rule-card {
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}

.rule-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.rule-card.selected {
    border-color: var(--primary);
    background: #dbeafe;
    box-shadow: 0 0 0 1px var(--primary);
}

.rule-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.rule-card-amount {
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Employee Checkbox Grid */
.employee-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.employee-checkbox-item {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.employee-checkbox-item:hover {
    background: var(--bg-light);
}

/* Batch inputs in review table */
.batch-input {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}

.batch-input:disabled {
    background: #f3f4f6;
    color: var(--muted);
}
