:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e5e7ef;
    --primary: #004aad;
    --primary-contrast: #ffffff;
    --success: #15803d;
    --danger: #b42318;
    --warning: #b54708;
    --radius: 10px;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --control-height: 42px;
    --control-border: #d7deea;
    --control-border-hover: #b8c4d8;
    --control-focus: rgba(0, 74, 173, 0.14);
    --control-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --control-shadow-focus: 0 0 0 3px var(--control-focus), 0 8px 18px rgba(0, 74, 173, 0.08);
    --checkbox-size: 22px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; font-weight: 600; }
.sidebar-overlay,
.mobile-topbar {
    display: none;
}
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: #101828;
    color: white;
    padding: 24px 18px;
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.brand { font-size: 20px; font-weight: 800; margin-bottom: 28px; }
.sidebar nav {
    display: grid;
    gap: 18px;
    align-content: start;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}
.sidebar nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}
.sidebar-group {
    display: grid;
    gap: 6px;
}
.sidebar-group + .sidebar-group {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-group-title {
    padding: 0 12px 1px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}
.sidebar a, .link-button {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #d0d5dd;
    padding: 11px 12px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.sidebar a:hover, .link-button:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar a.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.22);
    box-shadow: inset 3px 0 0 #60a5fa;
}
.sidebar-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #98a2b3;
}
.sidebar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar a:hover .sidebar-icon,
.sidebar a.active .sidebar-icon {
    color: #ffffff;
}
.sidebar-footer { margin-top: auto; padding-top: 20px; }
.sidebar-user {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}
.sidebar-user strong,
.sidebar-user span {
    display: block;
}
.sidebar-user strong {
    font-size: 14px;
    color: white;
}
.sidebar-user span {
    margin-top: 4px;
    font-size: 12px;
    color: #98a2b3;
}
.main { margin-left: 240px; padding: 32px; }
.admin-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    margin: -32px -32px 20px;
    padding: 12px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7ef;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.admin-header-heading {
    min-width: 0;
}
.admin-header-title {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.18;
}
.admin-header-description {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}
.mobile-topbar {
    margin: -12px 0 20px;
    align-items: center;
    gap: 12px;
}
.menu-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    cursor: pointer;
}
.menu-button span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 999px;
    background: var(--text);
}
.mobile-topbar-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}
.admin-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 0;
    flex: 0 0 auto;
}
.account-menu {
    position: relative;
}
.account-menu::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    height: 10px;
}
.account-menu > summary {
    list-style: none;
}
.account-menu > summary::-webkit-details-marker {
    display: none;
}
.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 5px 10px 5px 5px;
    border: 1px solid #d7e0f0;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}
.account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
}
.account-text {
    display: grid;
    gap: 2px;
    text-align: left;
}
.account-text strong {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1.1;
}
.account-caret {
    color: #1e3a8a;
    width: 20px;
    height: 20px;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex: 0 0 20px;
}
.account-caret::before {
    content: "";
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
    transform-origin: center;
    transition: transform .16s ease;
}
.account-menu[open] .account-caret::before,
.account-menu:hover .account-caret::before,
.account-menu:focus-within .account-caret::before {
    transform: rotate(225deg) translate(-1px, -1px);
}
.account-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 220px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
    z-index: 20;
}
.account-menu:not([open]) .account-panel {
    display: none;
}
.account-menu:hover .account-panel,
.account-menu:focus-within .account-panel {
    display: grid;
}
.account-action,
.account-action-form button {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.account-action {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
}
.account-action-form {
    margin: 0;
}
.account-action.danger {
    color: var(--danger);
    background: #fff5f5;
    border-color: #fecaca;
}
.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}
h1 { margin: 0; font-size: 28px; }
p { color: var(--muted); margin: 6px 0 0; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.primary, .secondary, button.primary, .filters button, .login-card button {
    border: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.primary, button.primary, .filters button, .login-card button {
    background: var(--primary);
    color: var(--primary-contrast);
}
.secondary {
    background: #eef4ff;
    color: var(--primary);
    border: 1px solid #c7d7fe;
}
.btn {
    border-radius: 8px;
    font-weight: 700;
    min-height: 40px;
    padding: 9px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease, color .16s ease;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}
.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn:focus-visible {
    outline: 0;
    box-shadow: var(--control-shadow-focus);
}
.btn-primary {
    background: linear-gradient(180deg, #0b5ed7 0%, var(--primary) 100%);
    border-color: var(--primary);
}
.btn-outline-secondary {
    color: #344054;
    background: #ffffff;
    border-color: #ccd5e3;
}
.btn-outline-secondary:hover {
    color: var(--text);
    background: #f8fafc;
    border-color: var(--control-border-hover);
}
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mt { margin-top: 18px; }
.stat, table, .form-grid, .filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat { padding: 18px; }
.stat span { color: var(--muted); font-size: 14px; }
.stat strong { display: block; font-size: 32px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; overflow: hidden; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); background: #f8fafc; }
td { font-size: 14px; }
.muted { color: var(--muted); max-width: 260px; word-break: break-word; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions form { margin: 0; }
.actions button {
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #175cd3;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.badge.ok { background: #dcfae6; color: var(--success); }
.badge.bad { background: #fee4e2; color: var(--danger); }
.filters { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr .8fr auto; gap: 10px; padding: 14px; margin-bottom: 16px; }
.monthly-filters { grid-template-columns: .8fr .8fr 1.2fr auto; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
    width: 100%;
}
.form-page {
    width: 100%;
}
.location-form-grid {
    align-items: start;
}
.location-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.location-section-head strong {
    color: var(--text);
    font-size: 14px;
}
.location-policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.form-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
input, select, textarea,
.form-control, .form-select {
    width: 100%;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    min-height: var(--control-height);
    padding: 9px 12px;
    color: var(--text);
    background-color: white;
    box-shadow: var(--control-shadow);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input:hover, select:hover, textarea:hover,
.form-control:hover, .form-select:hover {
    border-color: var(--control-border-hover);
}
input:focus, select:focus, textarea:focus,
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    outline: 0;
    background-color: #ffffff;
    box-shadow: var(--control-shadow-focus);
}
input::placeholder, textarea::placeholder,
.form-control::placeholder {
    color: #98a2b3;
}
input[type="checkbox"],
input[type="checkbox"].form-check-input {
    width: var(--checkbox-size);
    min-width: var(--checkbox-size);
    height: var(--checkbox-size);
    min-height: var(--checkbox-size);
    padding: 0;
    margin: 0;
    float: none;
    vertical-align: middle;
    border: 1px solid var(--control-border);
    border-radius: 6px;
    background-color: #ffffff;
    accent-color: var(--primary);
    cursor: pointer;
    box-shadow: none;
    flex: 0 0 var(--checkbox-size);
}
input[type="checkbox"].form-check-input:hover {
    border-color: var(--control-border-hover);
}
input[type="checkbox"].form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
input[type="checkbox"]:focus-visible,
input[type="checkbox"].form-check-input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: var(--control-shadow-focus);
}
textarea { resize: vertical; font: inherit; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input[type="checkbox"] { flex: 0 0 var(--checkbox-size); }
.weekly-work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
.weekly-work-grid label {
    margin: 0;
}
.shift-table-wrap {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
}
.shift-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.shift-head > label {
    margin: 0;
}
.shift-add-text {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}
.shift-delete-btn {
    border: 1px solid #fca5a5;
    background: #fee2e2;
    color: #b42318;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 700;
    cursor: pointer;
}
.shift-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.shift-table th,
.shift-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    vertical-align: middle;
}
.shift-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.shift-table td input[type="text"],
.shift-table td input[type="time"] {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
}
.shift-table td.center {
    text-align: center;
}
.shift-table td.center input[type="checkbox"] {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    min-height: var(--checkbox-size);
}
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-card {
    width: min(420px, calc(100vw - 32px));
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 28px;
    display: grid;
    gap: 14px;
}
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.error { color: var(--danger); font-size: 14px; }
.success { color: var(--success); font-size: 14px; }
.matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.legend-swatch.full { background: #bbf7d0; border-color: #16a34a; }
.legend-swatch.missing { background: #fde68a; border-color: #d97706; }
.legend-swatch.warn { background: #fdba74; border-color: #ea580c; }
.legend-swatch.leave-paid { background: #d1d5db; border-color: #111827; }
.legend-swatch.leave-unpaid { background: #f5d0fe; border-color: #c026d3; }
.legend-swatch.trip { background: #bfdbfe; border-color: #1d4ed8; }
.legend-swatch.special { background: #ddd6fe; border-color: #7c3aed; }
.legend-swatch.empty { background: #f8fafc; border-color: var(--border); }
.matrix-wrap {
    width: 100%;
    overflow: auto;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.matrix-table {
    min-width: 1180px;
    width: max-content;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: visible !important;
}
.matrix-table th,
.matrix-table td {
    padding: 8px;
    border-right: 1px solid var(--border);
    text-align: center;
}
.matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}
.matrix-employee-col {
    position: sticky;
    left: 0;
    z-index: 8;
    width: 150px;
    min-width: 150px;
    text-align: left !important;
    background: #ffffff !important;
}
.matrix-table td.matrix-employee-col {
    font-weight: 600;
}
.matrix-summary-col-sticky-1,
.matrix-summary-col-sticky-2,
.matrix-summary-col-sticky-3,
.matrix-summary-col-sticky-4,
.matrix-summary-col-sticky-5 {
    position: sticky;
    z-index: 7;
    background: #ffffff;
    box-shadow: 1px 0 0 var(--border);
}
.matrix-summary-col-sticky-1 { left: 150px; }
.matrix-summary-col-sticky-2 { left: 266px; }
.matrix-summary-col-sticky-3 { left: 382px; }
.matrix-summary-col-sticky-4 { left: 498px; }
.matrix-summary-col-sticky-5 { left: 614px; }
.matrix-table thead .matrix-employee-col {
    background: #f8fafc !important;
    z-index: 10;
}
.matrix-table thead .matrix-summary-col-sticky-1,
.matrix-table thead .matrix-summary-col-sticky-2,
.matrix-table thead .matrix-summary-col-sticky-3,
.matrix-table thead .matrix-summary-col-sticky-4,
.matrix-table thead .matrix-summary-col-sticky-5 {
    background: #f8fafc !important;
    z-index: 9;
}
.matrix-table tbody .matrix-employee-col,
.matrix-table tbody .matrix-summary-col-sticky-1,
.matrix-table tbody .matrix-summary-col-sticky-2,
.matrix-table tbody .matrix-summary-col-sticky-3,
.matrix-table tbody .matrix-summary-col-sticky-4,
.matrix-table tbody .matrix-summary-col-sticky-5 {
    position: sticky;
    background-clip: padding-box;
}
.matrix-day-col {
    width: 70px;
    min-width: 70px;
}
.matrix-summary-col {
    min-width: 116px;
    width: 116px;
    white-space: normal;
}
.helper-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}
.matrix-day-col span,
.matrix-day-col small {
    display: block;
}
.matrix-day-col small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}
.employee-cell strong,
.employee-cell span,
.employee-cell small {
    display: block;
}
.employee-cell strong { font-size: 12px; }
.employee-cell span { margin-top: 2px; font-size: 12px; color: var(--text); }
.employee-cell small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.matrix-day-cell {
    height: 72px;
    vertical-align: middle;
    font-size: 12px;
}
.matrix-summary-cell {
    background: #f8fafc;
    font-weight: 800;
    color: #1f2937;
    font-size: 12px;
}
.matrix-summary-cell span {
    display: block;
    line-height: 1.35;
    white-space: normal;
}
.cell-time {
    display: block;
    line-height: 1.3;
    font-weight: 800;
}
.cell-edit-btn {
    border: 0;
    background: transparent;
    padding: 4px 0;
    width: 100%;
    cursor: pointer;
    text-align: center;
}
.cell-time.in { color: #14532d; }
.cell-time.out { color: #1e3a8a; margin-top: 2px; }
.cell-time.muted-label { color: #0f172a; font-size: 11px; }
.cell-leave-symbol {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.75);
    margin-bottom: 3px;
}
.cell-leave-text {
    display: block;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    color: #334155;
}
.cell-trip-symbol {
    display: inline-flex;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.82);
}
.cell-none { color: #98a2b3; }
.cell-full { background: #bbf7d0; color: #14532d; }
.cell-missing { background: #fde68a; color: #92400e; }
.cell-warn { background: #fdba74; color: #9a3412; }
.cell-bad { background: #fecaca; color: #991b1b; }
.cell-leave-paid { background: #d1d5db; color: #111827; }
.cell-leave-unpaid { background: #f5d0fe; color: #86198f; }
.cell-trip { background: #bfdbfe; color: #1e3a8a; }
.cell-special { background: #ddd6fe; color: #5b21b6; }
.cell-request-mixed { background: #fbcfe8; color: #9d174d; }
.cell-mixed-leave { background: #c7d2fe; color: #3730a3; }
.cell-mixed-trip { background: #99f6e4; color: #115e59; }
.cell-mixed-all { background: #fecdd3; color: #9f1239; }
.cell-empty { background: #f8fafc; }
.matrix-day-cell .cell-edit-btn { color: inherit; }
.monthly-session-block {
    display: grid;
    gap: 8px;
}
.monthly-session-title {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.monthly-session-table {
    width: 100%;
    border: 1px solid var(--border);
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
}
.monthly-session-table th,
.monthly-session-table td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}
.monthly-session-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.monthly-session-table td {
    background: #ffffff;
}
.monthly-session-table strong,
.monthly-session-table small {
    display: block;
}
.monthly-session-table small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.monthly-session-table input[type="time"],
.monthly-session-table input[type="text"] {
    min-width: 112px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
}
.monthly-session-table input[name="sessionNotes"] {
    min-width: 190px;
}
.monthly-session-table-readonly td:not(:first-child) {
    font-weight: 800;
    color: var(--text);
}
.panel-section { margin-top: 24px; }
.section-head { margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 20px; }
.decision-box { display: grid; gap: 8px; min-width: 220px; }
.decision-box form { display: grid; gap: 8px; }
.decision-box button {
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}
.decision-box .primary { background: var(--primary); color: white; border-color: var(--primary); }
.span-2 { grid-column: span 2; }
.form-actions {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 12px;
}
.form-actions > .primary,
.form-actions > .secondary,
.form-grid > button.primary,
.form-grid > button.secondary {
    width: auto;
    min-width: 140px;
    min-height: 42px;
    align-self: start;
}
.pager {
    margin-top: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.pager > span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}
.pager > a.secondary {
    min-width: 88px;
    text-align: center;
    padding: 8px 12px;
}
.pager .disabled {
    pointer-events: none;
    opacity: .5;
}
.recipient-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}
.recipient-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.recipient-head strong {
    display: block;
    font-size: 14px;
}
.recipient-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.recipient-action-btn {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
}
.bulk-employee-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.bulk-employee-head label {
    margin: 0;
}
.bulk-employee-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
}
.employee-selection-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}
.employee-selection-link:hover {
    text-decoration: underline;
}
.employee-selection-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}
.overtime-time-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.recipient-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.overtime-employee-grid {
    max-height: 320px;
    overflow: auto;
}
.recipient-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.recipient-item input[type="checkbox"] {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    min-height: var(--checkbox-size);
    margin: 0;
    accent-color: var(--primary);
    flex: 0 0 var(--checkbox-size);
}
.recipient-item span {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.recipient-item strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.recipient-item small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.html-editor {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    overflow: hidden;
}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.editor-toolbar button {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    border-radius: 8px;
    min-width: 38px;
    min-height: 34px;
    padding: 0 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.editor-surface {
    min-height: 280px;
    padding: 14px;
    line-height: 1.6;
    outline: none;
    color: var(--text);
    background: white;
}
.editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #98a2b3;
    font-weight: 500;
}
.editor-help {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}
.decision-dialog {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: none;
}
.decision-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
}
.decision-dialog-card {
    width: min(520px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
    margin: auto;
    padding: 22px;
    display: grid;
    gap: 16px;
}
.decision-dialog-card.monthly-attendance-dialog-card {
    width: min(860px, calc(100vw - 32px));
}
.decision-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.decision-dialog-head h3 {
    margin: 0;
    font-size: 20px;
}
.decision-dialog-subtitle {
    margin: -8px 0 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
}
.icon-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.decision-summary {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
.decision-summary-row {
    display: grid;
    gap: 4px;
}
.decision-summary-row span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.decision-summary-row strong {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}
.decision-dialog-form {
    display: grid;
    gap: 14px;
}
.decision-dialog-form label {
    display: grid;
    gap: 8px;
}
.decision-dialog-form-left,
.decision-dialog-form-left label {
    text-align: left;
}
.decision-dialog-form input,
.decision-dialog-form select,
.decision-dialog-form textarea {
    width: 100%;
    background: white;
}
.decision-dialog-form input[readonly] {
    background: #f8fafc;
    color: #334155;
}
.decision-dialog-form textarea {
    min-height: 112px;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}
.mt-2 { margin-top: 8px; }
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.legend-bar {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}
.legend-bar.blue { background: #3b82f6; }
.legend-bar.amber { background: #f59e0b; }
.legend-bar.green { background: #22c55e; }
.mini-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    min-height: 240px;
}
.mini-chart-col {
    display: grid;
    gap: 12px;
    justify-items: center;
}
.mini-chart-col strong {
    font-size: 12px;
    color: var(--muted);
}
.mini-chart-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 190px;
}
.mini-bar {
    width: 24px;
    min-height: 8px;
    border-radius: 8px 8px 4px 4px;
    position: relative;
}
.mini-bar span {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
}
.mini-bar.blue { background: #3b82f6; }
.mini-bar.amber { background: #f59e0b; }
.mini-bar.green { background: #22c55e; }

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.page-actions,
.head-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.page-actions-row {
    justify-content: flex-end;
    margin: 0 0 16px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.admin-card,
.card.admin-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.filter-bar .form-control,
.filter-bar .form-select {
    min-height: var(--control-height);
    border-radius: 8px;
}

.filter-bar {
    align-items: flex-end;
}

.filter-bar .filter-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.filter-bar .filter-label {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.filter-bar .filter-actions {
    align-self: flex-end;
    align-items: center;
    justify-content: flex-start;
}

.filter-bar .filter-actions .btn {
    min-height: 40px;
    white-space: nowrap;
}

.select2-container {
    width: 100% !important;
    font-size: 14px;
}

.filter-bar .select2-container {
    min-width: 0;
}

.select2-container--default .select2-selection--single {
    min-height: var(--control-height);
    border: 1px solid var(--control-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: var(--control-shadow);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    color: var(--text);
    line-height: calc(var(--control-height) - 2px);
    padding-left: 12px;
    padding-right: 32px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--control-height) - 2px);
    right: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    height: calc(var(--control-height) - 2px);
    margin-right: 24px;
    color: var(--muted);
}

.select2-container--default .select2-selection--multiple {
    min-height: var(--control-height);
    border: 1px solid var(--control-border);
    border-radius: 8px;
    padding: 3px 6px;
    box-shadow: var(--control-shadow);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--primary);
    box-shadow: var(--control-shadow-focus);
}

.select2-dropdown {
    border-color: var(--control-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.select2-search--dropdown {
    padding: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--control-border);
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 10px;
    box-shadow: var(--control-shadow);
}

.select2-results__option {
    padding: 9px 12px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
}

.admin-table {
    border: 1px solid var(--border);
    border-collapse: collapse;
    box-shadow: none;
    margin-bottom: 0;
}

.table-responsive:has(.bootstrap-table) {
    overflow: visible;
}

.bootstrap-table .admin-table > :not(caption) > * > * {
    border: 1px solid var(--border);
    padding: 12px 14px;
    vertical-align: middle;
}

.bootstrap-table .admin-table .table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    height: auto;
    vertical-align: middle;
}

.bootstrap-table .admin-table .table-actions > *,
.bootstrap-table .admin-table .table-actions form,
.bootstrap-table .admin-table .table-actions .btn {
    flex: 0 0 auto;
    height: auto;
    align-self: center;
}

.bootstrap-table .admin-table .table-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.bootstrap-table .admin-table .table-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3px 7px;
    border-radius: 5px !important;
    font-size: 12px;
    line-height: 1.2;
}

.bootstrap-table .admin-table > thead > tr > th,
.bootstrap-table .admin-table > thead > tr > th .th-inner {
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.bootstrap-table .fixed-table-container,
.bootstrap-table .fixed-table-toolbar .columns,
.bootstrap-table .fixed-table-toolbar .bs-bars,
.bootstrap-table .fixed-table-toolbar .search {
    border-radius: 8px;
}

.bootstrap-table .fixed-table-container {
    border: 1px solid var(--border);
    overflow: hidden;
}

.bootstrap-table .fixed-table-body {
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bootstrap-table .fixed-table-body .admin-table {
    width: max-content !important;
    min-width: 100%;
}

.bootstrap-table .fixed-table-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    overflow: visible;
    position: relative;
    z-index: 4;
}

.bootstrap-table .fixed-table-toolbar .columns .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--control-border);
    background: #fff;
    color: var(--text);
    box-shadow: var(--control-shadow);
    white-space: nowrap;
}

.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu {
    min-width: 240px;
    max-height: min(420px, 70vh);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    z-index: 1050;
}

.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu .dropdown-item,
.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu .dropdown-item:hover,
.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu label:hover {
    background: #eef4ff;
    color: var(--primary);
}

.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu input[type="checkbox"] {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    min-height: var(--checkbox-size);
    margin: 0;
    flex: 0 0 var(--checkbox-size);
    accent-color: var(--primary);
}

.bootstrap-table .fixed-table-pagination {
    margin-top: 12px;
}

.bootstrap-table .pagination-detail,
.bootstrap-table .pagination {
    font-size: 13px;
}

.admin-inline-action {
    display: grid;
    grid-template-columns: minmax(120px, 1fr);
    gap: 6px;
    min-width: 180px;
    margin: 0;
}

.admin-inline-action .btn {
    width: 100%;
}

.btn-group form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.decision-detail-box {
    white-space: pre-line;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
}

.empty-state {
    min-height: 140px;
}

.jconfirm .btn {
    border-radius: 8px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 20;
    }
    .sidebar {
        width: 280px;
        max-width: calc(100vw - 32px);
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    .main { margin: 0; padding: 20px; }
    .admin-header {
        margin: -20px -20px 16px;
        padding: 12px 20px;
        min-height: 0;
        display: grid;
        gap: 12px;
        justify-content: stretch;
    }
    .admin-header-title {
        font-size: 22px;
    }
    .mobile-topbar {
        display: flex;
        margin: 0;
    }
    .admin-topbar {
        justify-content: stretch;
    }
    .account-menu {
        width: 100%;
    }
    .account-trigger {
        width: 100%;
        justify-content: space-between;
    }
    .account-panel {
        width: 100%;
    }
    .stats, .form-grid, .filters, .monthly-filters, .location-policy-grid { grid-template-columns: 1fr; }
    .span-2, .form-actions { grid-column: span 1; }
    .recipient-grid { grid-template-columns: 1fr; }
    .recipient-head { align-items: flex-start; flex-direction: column; }
    .bulk-employee-head,
    .bulk-employee-actions,
    .recipient-actions { justify-content: flex-start; }
    .overtime-time-grid { grid-template-columns: 1fr; }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        margin: 0 0 18px;
        padding: 0;
    }
    .head-actions,
    .page-actions { width: 100%; flex-wrap: wrap; }
    .page-actions-row { justify-content: flex-start; }
    .pager { justify-content: center; }
    .mini-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
