:root {
    --bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #b45309;
    --accent-soft: rgba(180, 83, 9, 0.12);
    --accent-hover: #92400e;
    --success: #059669;
    --danger: #dc2626;
    --info: #2563eb;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, .page-title, .logo span {
    font-family: 'Outfit', sans-serif;
}

/* hidden attribute must win over display:flex (otherwise login stays on screen after sign-in) */
[hidden] {
    display: none !important;
}

.salon-login-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff7ed 0%, #f8fafc 50%, #fef3c7 100%);
}

.salon-login-screen:not([hidden]) {
    display: flex;
}

.salon-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.salon-login-brand { text-align: center; margin-bottom: 1.5rem; }
.salon-login-brand i { font-size: 2.5rem; color: var(--accent); margin-bottom: 0.5rem; display: block; }
.salon-login-brand h1 { font-size: 1.5rem; font-weight: 700; }
.salon-login-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

.salon-login-form { display: flex; flex-direction: column; gap: 0.75rem; }
.salon-label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }

.salon-input, .form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.salon-input:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.salon-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; }

.salon-login-form .password-field-wrap {
    position: relative;
    width: 100%;
}
.salon-login-form .password-field-wrap .salon-input,
.salon-login-form .password-field-wrap .password-field-input {
    width: 100%;
    padding-right: 2.75rem;
}
.salon-login-form .btn-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    padding: 0.35rem 0.45rem;
    line-height: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.salon-login-form .btn-password-toggle:hover {
    color: var(--accent);
}

.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.nav-menu { flex: 1; padding: 0.75rem; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font: inherit;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
}

.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.sidebar-payroll { padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.sidebar-payroll-label { display: block; color: var(--text-muted); margin-bottom: 0.15rem; }
.sidebar-payroll-value { font-weight: 600; color: var(--accent); }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.sidebar-user-detail { margin-bottom: 0.35rem; font-size: 0.85rem; }
.sidebar-user-label { color: var(--text-muted); margin-right: 0.35rem; }
.sidebar-user-value { font-weight: 500; }
.salon-logout-btn { width: 100%; margin-top: 0.75rem; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title { font-size: 1.35rem; font-weight: 600; flex: 1; }
.top-bar-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.mobile-menu-btn { display: none; }

.content-wrapper { padding: 1.5rem; flex: 1; }
.loader-container { text-align: center; padding: 3rem; color: var(--text-muted); font-size: 1.5rem; }

.btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-icon { padding: 0.45rem 0.65rem; background: transparent; border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}
.card > .card-title + .empty-hint {
    margin-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow);
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; font-family: 'Outfit', sans-serif; }
.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }
.stat-value.accent { color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #f1f5f9; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(180, 83, 9, 0.04); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table input, .data-table select { min-width: 80px; padding: 0.35rem 0.5rem; font-size: 0.85rem; }

/* Payroll table — uniform left alignment, compact */
.payroll-table-wrap { overflow-x: auto; }
.data-table.payroll-table {
    font-size: 0.82rem;
    width: max-content;
    min-width: 100%;
}
.data-table.payroll-table th,
.data-table.payroll-table td {
    text-align: left;
    vertical-align: middle;
    padding: 0.5rem 0.7rem;
    white-space: nowrap;
}
.data-table.payroll-table th {
    font-size: 0.72rem;
    font-weight: 600;
}
.data-table.payroll-table td {
    font-variant-numeric: tabular-nums;
}
.data-table.payroll-table th:first-child,
.data-table.payroll-table td:first-child {
    min-width: 7rem;
}
.data-table.payroll-table th:nth-child(2),
.data-table.payroll-table td:nth-child(2) {
    min-width: 8.5rem;
}

.dashboard-staff-table-wrap { overflow-x: auto; }
.data-table.dashboard-staff-table {
    font-size: 0.82rem;
    width: max-content;
    min-width: 100%;
}
.data-table.dashboard-staff-table th,
.data-table.dashboard-staff-table td {
    text-align: left;
    vertical-align: middle;
    padding: 0.5rem 0.7rem;
    white-space: nowrap;
}
.data-table.dashboard-staff-table th {
    font-size: 0.72rem;
    font-weight: 600;
}
.data-table.dashboard-staff-table td {
    font-variant-numeric: tabular-nums;
}
.data-table.dashboard-staff-table th:first-child,
.data-table.dashboard-staff-table td:first-child {
    min-width: 7rem;
}

.expense-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.expense-option-table .expense-option-name {
    width: 100%;
    min-width: 10rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
}
.expense-option-add {
    margin-top: 0.75rem;
    margin-bottom: 0;
}
.expense-option-add .form-input {
    flex: 1;
    min-width: 10rem;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.leave-form-grid { grid-template-columns: 1fr 1fr; }
.leave-form-grid .form-group.full,
.leave-form-grid .modal-actions { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full { grid-column: 1 / -1; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.badge-success { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.badge-warning { background: rgba(180, 83, 9, 0.12); color: var(--accent); }
.badge-daily-log-pending { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

.leave-row-daily-log td { background: rgba(251, 191, 36, 0.1); }
.data-table tr.leave-row-daily-log:hover td { background: rgba(251, 191, 36, 0.18); }
.leave-pending-cell { color: #b45309; font-weight: 600; font-style: italic; }
.leave-review-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
    font-size: 0.9rem;
}
.leave-hint-inline { display: block; font-size: 0.75rem; color: #b45309; margin-top: 0.15rem; }
.field-hint { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

.staff-passport-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 0.9rem;
}
.staff-row-passport-no td { background: rgba(239, 68, 68, 0.08); }
.data-table tr.staff-row-passport-no:hover td { background: rgba(239, 68, 68, 0.14); }
.badge-passport-no {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.badge-danger { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.toolbar .form-input, .toolbar .form-select { width: auto; min-width: 160px; }
.month-range-toolbar { align-items: flex-end; }
.month-range-field { display: flex; flex-direction: column; gap: 0.3rem; }
.month-range-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.month-range-input { min-width: 10rem; }

.salon-setup-intro { max-width: 42rem; }
.staff-history-toolbar { align-items: flex-end; flex-wrap: wrap; }
.staff-history-picker .staff-history-select { min-width: 12rem; }
.staff-history-intro { max-width: 52rem; }
.staff-history-stats { margin-bottom: 1rem; }
.staff-history-table { font-size: 0.88rem; }
.staff-history-payroll-table { font-size: 0.82rem; }
.dl-conflict-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 0.9rem;
}
.dl-row-conflict td { background: rgba(239, 68, 68, 0.08); }
.data-table tr.dl-row-conflict:hover td { background: rgba(239, 68, 68, 0.14); }
.dl-leave-hint {
    display: inline-block;
    font-size: 0.75rem;
    color: #b91c1c;
    font-weight: 600;
    margin-top: 0.2rem;
}
.dl-sync-hint { max-width: 52rem; margin-bottom: 1rem; }
.leave-conflict-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 0.9rem;
}
.leave-row-attendance-conflict td { background: rgba(239, 68, 68, 0.06); }
.data-table tr.leave-row-attendance-conflict:hover td { background: rgba(239, 68, 68, 0.12); }
.dl-advance-hint { max-width: 52rem; margin-bottom: 1rem; }
.dl-table-wrap { overflow-x: auto; }
.dl-deduct-cell { min-width: 14rem; max-width: 18rem; vertical-align: top; }
.dl-deduct-idle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}
.dl-deduct-panel { display: flex; flex-direction: column; gap: 0.5rem; }
.dl-deduct-modes {
    display: flex;
    gap: 0.2rem;
    padding: 0.15rem;
    background: var(--surface-muted, #f1f5f9);
    border-radius: 8px;
}
.dl-deduct-mode {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.dl-deduct-mode:hover { color: var(--text); }
.dl-deduct-mode.is-active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.dl-deduct-body.hidden { display: none; }
.dl-deduct-note,
.dl-field-label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dl-field-label { display: block; margin-bottom: 0.25rem; }
.dl-deduct-month,
.dl-inst-month { font-size: 0.82rem; padding: 0.35rem 0.5rem; width: 100%; }
.dl-split-table { font-size: 0.75rem; }
.dl-split-head,
.dl-split-row {
    display: grid;
    grid-template-columns: 5rem 1fr 1.75rem;
    gap: 0.35rem;
    align-items: center;
}
.dl-split-head {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.dl-split-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.dl-split-row .dl-inst-amount {
    width: 100%;
    padding: 0.35rem 0.4rem;
    font-size: 0.82rem;
}
.dl-split-spacer { width: 1.75rem; }
.dl-inst-add { align-self: flex-start; margin-top: 0.15rem; }
.dl-split-total {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dl-split-sum--warn { color: #b45309; }
.dl-split-sum--ok { color: #047857; }
.dl-deduct-readonly { font-size: 0.85rem; line-height: 1.4; }
.salon-setup-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1rem;
    align-items: start;
}
.salon-setup-admin-grid > .card {
    margin-bottom: 0;
    height: 100%;
}
.salon-setup-activity-card .table-wrap {
    max-height: 28rem;
    overflow: auto;
}
@media (max-width: 1100px) {
    .salon-setup-admin-grid {
        grid-template-columns: 1fr;
    }
    .salon-setup-admin-grid > .card {
        height: auto;
    }
}
.backup-restore-card .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.login-users-card .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.login-users-table .form-input {
    min-width: 10rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}
.login-users-table .login-user-email {
    min-width: 12rem;
}
.login-users-table .password-field-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 10rem;
}
.login-users-table .password-field-wrap .password-field-input {
    flex: 1;
    min-width: 7rem;
}
.login-users-table .btn-password-toggle {
    flex-shrink: 0;
    padding: 0.35rem 0.45rem;
    line-height: 1;
}
.login-users-table .login-user-current-password[readonly] {
    background: #f8fafc;
    color: var(--text-muted);
}
.login-users-table .login-user-role {
    font-weight: 600;
    font-size: 0.85rem;
}
.login-user-staff {
    color: var(--text-muted);
}
.login-user-you {
    font-weight: 400;
    color: var(--accent);
    font-size: 0.8rem;
}
.login-user-access-row td {
    background: #f8fafc;
    padding-top: 0.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.login-access-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.login-access-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}
.login-access-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}
.login-access-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.salon-name-toolbar {
    margin-top: 0.75rem;
    align-items: flex-end;
}
.salon-name-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 12rem;
    max-width: 24rem;
}
.salon-name-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.backup-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.backup-section-title {
    font-size: 0.95rem;
    margin-bottom: 0.45rem;
}
.backup-warning {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}
.table-actions-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    text-align: right;
    padding: 0.45rem 0.65rem !important;
}
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    flex-wrap: nowrap;
}
.table-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    flex-wrap: nowrap;
}
.table-action-btn,
.table-action-delete .table-action-btn,
.table-action-delete .btn-sm.table-action-btn {
    width: 1.75rem;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 !important;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}
a.table-action-btn {
    text-decoration: none;
    color: var(--text);
}
.table-action-btn i {
    font-size: 0.78rem;
    pointer-events: none;
}
.table-action-delete {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table-action-delete--empty {
    visibility: hidden;
    pointer-events: none;
}
.data-table .table-actions-cell .btn-sm:not(.table-action-btn) {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.empty-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal-panel { position: relative; background: var(--card-bg); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1rem; border-radius: 8px; background: var(--text); color: #fff; font-size: 0.9rem; box-shadow: var(--shadow); animation: fadeIn 0.2s; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.commission-intro { max-width: 42rem; }
.commission-tier-table .form-select,
.commission-tier-table .form-input { font-size: 0.82rem; padding: 0.4rem 0.5rem; }
.commission-tier-table code {
    font-size: 0.85em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text);
}
.commission-config-list {
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.commission-config-item {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}
.commission-config-item dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.commission-config-item dd {
    margin: 0;
    font-size: 0.95rem;
}
.commission-config-item dd + dd {
    margin-top: 0.35rem;
}
.commission-config-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.commission-tiers li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.commission-tiers li:last-child { border-bottom: none; }

.payroll-actions {
    display: inline-flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.payroll-status {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    min-height: 52px;
}

.payroll-status__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.payroll-status__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.payroll-status__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
}

.payroll-status__meta {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.payroll-status--approved {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(5, 150, 105, 0.04));
    border-color: rgba(5, 150, 105, 0.22);
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.08);
}

.payroll-status--approved .payroll-status__icon {
    background: rgba(5, 150, 105, 0.14);
    color: var(--success);
}

.payroll-status--approved .payroll-status__title {
    color: #047857;
}

.payroll-status--draft {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.08), rgba(180, 83, 9, 0.03));
    border-color: rgba(180, 83, 9, 0.18);
}

.payroll-status--draft .payroll-status__icon {
    background: rgba(180, 83, 9, 0.12);
    color: var(--accent);
}

.payroll-status--draft .payroll-status__title {
    color: var(--accent-hover);
}

.btn-payroll-approve {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 52px;
}

.btn-payroll-approve:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.32);
    transform: translateY(-1px);
}

.btn-payroll-approve:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-payroll-approve:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

.btn-payroll-reopen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    background: #fff;
    min-height: 52px;
    transition: background 0.15s, border-color 0.15s;
}

.btn-payroll-reopen:hover {
    background: var(--bg);
    border-color: #94a3b8;
}

.payroll-status--blocked {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.03));
    border-color: rgba(220, 38, 38, 0.2);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.06);
}

.payroll-status--blocked .payroll-status__icon {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.payroll-status--blocked .payroll-status__title {
    color: #b91c1c;
}

.payroll-block-banner {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.22);
}

.payroll-block-banner__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.payroll-block-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.payroll-block-banner__text {
    flex: 1;
    min-width: 200px;
}

.payroll-block-banner__text strong {
    display: block;
    color: #991b1b;
    margin-bottom: 0.2rem;
}

.payroll-block-banner__text p {
    margin: 0;
    font-size: 0.88rem;
    color: #7f1d1d;
    line-height: 1.45;
}

.payroll-block-banner__list {
    margin: 0.85rem 0 0 2.85rem;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: #7f1d1d;
}

.payroll-block-banner__list li {
    padding: 0.35rem 0;
    border-top: 1px solid rgba(220, 38, 38, 0.12);
}

.payroll-block-banner__list li:first-child {
    border-top: none;
    padding-top: 0;
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: inline-flex; }
}
