* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f6f8fb;
    color: #263238;
    margin: 0;
}
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}
.auth-container { max-width: 480px; min-height: 100vh; display: flex; align-items: center; }
.auth-card, .category-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(31, 42, 55, 0.08);
}
.auth-card { width: 100%; }

.app-heading-block h1 {
    margin-bottom: 6px;
}
.app-brand-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.app-brand-mark {
    width: 56px;
    height: 50px;
    object-fit: contain;
    flex: 0 0 auto;
}
.app-brand-name {
    color: #000;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.08em;
}
.app-brand-tagline {
    margin: 3px 0 0;
    color: #000;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-card-branded {
    padding-top: 26px;
}
.auth-brand {
    text-align: center;
    margin: -8px 0 18px;
}
.auth-brand-logo {
    display: block;
    width: min(280px, 82%);
    max-height: 150px;
    object-fit: contain;
    margin: 0 auto;
}
.auth-card-branded h1 {
    text-align: center;
    margin-bottom: 8px;
}

h1, h2, h3, h4 { margin-top: 0; color: #1f2937; }
.muted-text { color: #68768a; font-size: 14px; }
.auth-subtitle { color: #5d6a7d; margin-bottom: 18px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6dbe4;
    border-radius: 10px;
    margin-top: 6px;
    background: #fff;
    font-size: 16px;
}
textarea { resize: vertical; min-height: 88px; font-family: inherit; }
.btn {
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
}
.btn-inline { width: auto; }
.btn.primary { background: #2563eb; color: white; }
.btn.secondary { background: #e8edf7; color: #263238; }
.btn.danger { background: #dc3545; color: #fff; }
.btn.check { background: #28a745; color: white; }
.message { margin-top: 10px; color: #dc3545; font-size: 14px; font-weight: 600; }
.auth-message { min-height: 20px; }
.auth-actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.auth-actions .btn { min-height: 52px; }
.auth-submit-btn { min-width: 132px; }
.auth-secondary-action {
    flex: 1 1 auto;
    width: auto;
    margin-top: 0;
}
.hint-box {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eef3ff;
    color: #314369;
    font-size: 14px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.finish-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.finish-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}
.finish-btn:disabled {
    background: #bfc5cc;
    cursor: not-allowed;
}
.finish-hint {
    font-size: 12px;
    color: #6c757d;
    max-width: 200px;
    text-align: right;
    line-height: 1.35;
}
.category-header {
    background: #2f3b52;
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
}
.category-body { margin-top: 12px; }
.category-meta { font-size: 12px; opacity: 0.9; }
.blocked-category .category-header { opacity: 0.65; }
.subcategory-card { margin-bottom: 12px; border-left: 6px solid #9aa4b2; }
.status-grey { border-left-color: #9aa4b2; }
.status-green { border-left-color: #28a745; }
.status-orange { border-left-color: #fd7e14; }
.status-red { border-left-color: #dc3545; }
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.input-group input { margin: 0; flex: 1; }
.item-card {
    margin-top: 10px;
    padding: 12px;
    background: #f2f5f9;
    border-radius: 12px;
}
.items-container {
    margin-top: 15px;
    border-top: 2px dashed #ced6e0;
    padding-top: 12px;
}
.items-warning { color: #dc3545; font-weight: 700; }
.admin-container { max-width: 1180px; }
.user-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.user-form .form-actions {
    display: flex;
    gap: 10px;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.checkbox-row input { width: auto; margin: 0; }
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: #f7f9fc;
    border: 1px solid #e3e8f0;
}
.user-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-top-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.admin-delete-wrap { display: flex; align-items: flex-start; }
.totals { display: flex; gap: 20px; font-size: 18px; font-weight: 700; }
.total-plus { color: #28a745; }
.total-minus { color: #dc3545; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    border: 1px solid #dfe6ef;
    padding: 8px;
}
.admin-table th { background: #f1f5fb; }
.section-title { margin: 20px 0 12px; }

body.modal-open {
    overflow: hidden;
}
.header-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.header-actions .btn {
    width: 100%;
    margin: 0;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(31, 42, 55, 0.25);
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 22px;
}
.users-modal-card { width: min(980px, 100%); }
.form-modal-card { width: min(620px, 100%); }
.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.modal-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-users-list {
    max-height: calc(90vh - 140px);
    overflow: auto;
}
.warning-card {
    max-width: 720px;
    margin: 40px auto 0;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(31, 42, 55, 0.08);
    text-align: center;
}
.warning-card h2 { margin-bottom: 10px; color: #1f2937; }
.warning-card p { margin: 0; color: #5d6a7d; line-height: 1.5; }

.employee-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}
.employee-summary-card {
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    padding: 14px;
}
.employee-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.employee-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.employee-revision-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.employee-card-head h3 { margin: 0; font-size: 18px; }
.employee-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.employee-meta-grid strong { display: block; font-size: 20px; margin-top: 4px; }
.employee-category-chips, .category-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.category-chip, .employee-pill, .assigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}
.category-chip { background: #e8edf7; color: #314369; }
.employee-pill { background: #eef4ff; color: #234a91; }
.assigned-badge { background: #f4f7fb; color: #516174; }
.chip-button {
    border: none;
    background: #eef4ff;
    color: #234a91;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.chip-button-warning {
    background: #fff4e5;
    color: #b06000;
}

.admin-v2 .section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin: 22px 0 12px;
}
.admin-hero-card { padding: 18px 20px; }
.admin-toolbar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}
.admin-toolbar-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
}
.admin-period-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e7edf4;
}
.admin-period-toolbar label {
    min-width: 180px;
}
.admin-problem-export-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 0.8fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
    gap: 14px;
    align-items: end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e7edf4;
}
.admin-problem-export-toolbar > div:first-child p {
    margin: 4px 0 0;
}
.admin-problem-export-toolbar #problem-export-status {
    grid-column: 1 / -1;
    margin-top: 0;
}
.admin-period-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.admin-period-actions .btn[disabled],
.admin-toolbar-actions .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

#save-cycle-targets-btn[disabled] {
    background: #cbd5e1;
    color: #475569;
    cursor: not-allowed;
    opacity: 1;
}

.admin-filter-checkbox {
    background: #f3f6fb;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid #e3e8f0;
}

.report-summary-v2 { padding: 22px; }
.report-summary-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.report-status-chip {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.report-status-chip.completed { background: #eaf8ef; color: #137333; }
.report-status-chip.progress { background: #fff4e5; color: #b06000; }
.summary-topline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.summary-topline-item {
    background: #f8fafc;
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 12px 14px;
}
.summary-label, .summary-kpi-label {
    display: block;
    font-size: 12px;
    color: #68768a;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}
.summary-topline-item strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}
.summary-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.summary-kpi-card {
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e7edf4;
    background: #fbfcfe;
}
.summary-kpi-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}
.summary-kpi-card.plus { background: #eefaf2; }
.summary-kpi-card.minus { background: #fff1f2; }
.summary-kpi-card.warning { background: #fff8eb; }
.summary-kpi-card.neutral { background: #f8fafc; }
.summary-kpi-card.finance { background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%); }
.summary-kpi-card.finance.accent { background: linear-gradient(180deg, #fff8eb 0%, #fff1db 100%); }

.status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
}
.status-chip.green { background: #eaf8ef; color: #137333; }
.status-chip.orange { background: #fff4e5; color: #b06000; }
.status-chip.red { background: #ffebee; color: #c62828; }
.status-chip.grey { background: #eef2f7; color: #5f6b7a; }

.admin-category-card {
    padding: 0;
    overflow: hidden;
}
.admin-category-header {
    border: none;
    width: 100%;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    text-align: left;
}
.admin-category-header h3 { margin-bottom: 8px; }
.admin-category-subline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}
.admin-category-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.collapse-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    color: #314369;
    font-size: 20px;
    line-height: 1;
}
.admin-category-body {
    padding: 0 20px 20px;
}
.admin-category-body.hidden { display: none; }
.discrepancy-banner {
    margin-bottom: 12px;
    color: #d32f2f;
    font-weight: 800;
}
.admin-category-economics,
.employee-detail-economics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}
.admin-category-economics-card,
.employee-detail-economics-card {
    border: 1px solid #e4eaf3;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fbff;
}
.admin-category-economics-card strong,
.employee-detail-economics-card strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}
.admin-category-economics-card.accent,
.employee-detail-economics-card.accent {
    background: #fff6e8;
    border-color: #f0ddbc;
}
.table-scroll { overflow-x: auto; }
.discrepancy-table th,
.discrepancy-table td { vertical-align: top; }
.discrepancy-table th:nth-child(1),
.discrepancy-table td:nth-child(1) { min-width: 180px; }
.discrepancy-table th:nth-child(2),
.discrepancy-table td:nth-child(2) {
    min-width: 90px;
    width: 90px;
    max-width: 90px;
    white-space: nowrap;
}
.discrepancy-table th:nth-child(6),
.discrepancy-table td:nth-child(6),
.discrepancy-table th:nth-child(7),
.discrepancy-table td:nth-child(7),
.discrepancy-table th:nth-child(8),
.discrepancy-table td:nth-child(8) { min-width: 170px; }
.money-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}
.money-cell strong {
    font-size: 15px;
    line-height: 1.25;
}
.money-cell.emphasis strong { color: #8a5300; }
.money-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.money-badge-manual {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #c7d7fe;
}
.num-cell { text-align: center; }
.diff-plus { color: #1f9d55; font-weight: 800; }
.diff-minus { color: #d32f2f; font-weight: 800; }
.category-empty-state {
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: #425466;
    border: 1px solid #e7edf4;
}
.category-empty-state.green { background: #eefaf2; color: #137333; }
.category-empty-state.orange { background: #fff8eb; color: #b06000; }
.empty-text {
    text-align: center;
    color: #68768a;
    margin: 0;
}
.error-text { color: #d32f2f; }

@media (max-width: 1080px) {
    .summary-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-topline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-toolbar-grid { grid-template-columns: 1fr 1fr; }
    .admin-period-toolbar { flex-direction: column; align-items: stretch; }
    .admin-problem-export-toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .admin-period-actions { width: 100%; }
}

@media (max-width: 800px) {
    .user-admin-grid { grid-template-columns: 1fr; }
    .page-header, .top-bar, .report-summary-header { flex-direction: column; }
    .finish-block { align-items: stretch; }
    .finish-hint { text-align: left; max-width: none; }
    .input-group { flex-direction: column; align-items: stretch; }
    .user-row { flex-direction: column; }

    .modal-header,
    .modal-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-card { padding: 16px; }
    .admin-toolbar-grid { grid-template-columns: 1fr; }
    .summary-topline,
    .summary-kpi-grid { grid-template-columns: 1fr; }
    .employee-meta-grid { grid-template-columns: 1fr; }
    .admin-category-header { flex-direction: column; }
    .admin-category-header-right { width: 100%; justify-content: space-between; }
}


.section-title-row-with-tabs {
    align-items: center;
}

.view-mode-switch {
    display: inline-flex;
    gap: 8px;
    background: #eef3fb;
    border-radius: 999px;
    padding: 4px;
}

.view-mode-btn {
    border: none;
    background: transparent;
    color: #4a5a72;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.view-mode-btn.active {
    background: #fff;
    color: #1f3552;
    box-shadow: 0 4px 16px rgba(31, 42, 55, 0.10);
}

.employee-detail-card {
    margin-top: 12px;
}

.employee-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.employee-detail-kpis {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.employee-detail-kpis > div {
    min-width: 110px;
    background: #f6f8fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
}

.employee-detail-kpis strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}

.employee-detail-section {
    margin-top: 16px;
}

.employee-detail-section h4 {
    margin-bottom: 10px;
}

.employee-detail-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employee-detail-category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e5ebf3;
    border-radius: 12px;
    padding: 12px 14px;
}

@media (max-width: 860px) {
    .section-title-row-with-tabs {
        flex-direction: column;
        align-items: flex-start;
    }

    .employee-detail-header,
    .employee-detail-category-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .employee-detail-kpis {
        width: 100%;
    }

    .admin-category-economics,
    .employee-detail-economics {
        grid-template-columns: 1fr;
    }
}


.hidden {
    display: none !important;
}

.employee-container {
    max-width: 1120px;
}

.inventory-topbar {
    position: static;
    background: transparent;
    padding-top: 0;
}

.employee-tools-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(31, 42, 55, 0.08);
    margin-bottom: 16px;
}

.employee-tools-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(320px, 1fr);
    gap: 16px 20px;
    align-items: start;
}

.employee-search-label {
    display: block;
}

.employee-search-label input {
    width: 100%;
}

.employee-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.employee-stat-card {
    background: #f8fafc;
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 12px;
}

.employee-stat-label {
    display: block;
    font-size: 12px;
    color: #68768a;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}

.employee-stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    color: #1f2937;
}

.employee-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e7edf4;
}

.employee-view-btn {
    border: none;
    background: #eef3fb;
    color: #425466;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.employee-view-btn.active {
    background: #ffffff;
    color: #1f3552;
    box-shadow: 0 4px 16px rgba(31, 42, 55, 0.10);
    border: 1px solid #dfe6ef;
}

.employee-empty-state {
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed #d7dee9;
    background: #f8fafc;
    color: #68768a;
    text-align: center;
}

.main-category-block {
    margin-bottom: 14px;
}

@media (max-width: 980px) {
    .employee-tools-grid {
        grid-template-columns: 1fr;
    }

    .employee-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .employee-stats {
        grid-template-columns: 1fr 1fr;
    }

    .employee-view-switch {
        flex-direction: column;
    }

    .employee-view-btn {
        width: 100%;
    }
}


.inventory-status {
    margin-top: 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #dfe6ef;
    background: #ffffff;
}

.inventory-status.hidden {
    display: none;
}

.inventory-status.loading {
    background: #f8fbff;
    border-color: #d8e7ff;
    color: #234a91;
}

.inventory-status.error {
    background: #fff7f7;
    border-color: #f1c9c9;
    color: #a33a3a;
}

.inventory-status.success {
    background: #eefaf2;
    border-color: #bfe3c9;
    color: #137333;
}

.inventory-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-status-text {
    flex: 1 1 260px;
    font-size: 14px;
    font-weight: 600;
}

.inventory-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #c7d9fb;
    border-top-color: #2563eb;
    display: inline-block;
    animation: inventory-spin .8s linear infinite;
}

@keyframes inventory-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.diagnostic-warning {
    color: #b45309;
}


.inventory-status.loading {
    border: 1px solid #d8e3f7;
    background: #f3f7ff;
    color: #234a91;
}
.inventory-status.error {
    border: 1px solid #f3c7cd;
    background: #fff5f6;
    color: #a61e2d;
}
.inventory-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.inventory-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #bfd1f7;
    border-top-color: #2563eb;
    animation: spin .8s linear infinite;
    flex: 0 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.diagnostic-help {
    margin-bottom: 10px;
}
.diagnostic-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.diagnostic-item-card {
    border: 1px solid #e7edf4;
}
.diagnostic-warning {
    color: #b06000;
}


.diagnostics-modal-card { width: min(1280px, 100%); }
.diagnostics-summary { margin: 0 0 12px; }
.diagnostics-table-wrap { max-height: calc(90vh - 220px); }
.diagnostics-table td { vertical-align: top; min-width: 120px; }
.diagnostics-table td:last-child { min-width: 320px; }

.detail-filter-checkbox-bottom {
    justify-content: flex-start;
    align-self: end;
    min-height: 48px;
}



.employee-action-row-multi {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.employee-revision-banner {
    margin: 12px 0 16px;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #dbe5f1;
    background: #f8fafc;
    color: #425466;
}

.employee-revision-banner.idle {
    background: #f8fbff;
    border-color: #d7e7ff;
    color: #234a91;
}

.employee-revision-banner.done {
    background: #f4fbf6;
    border-color: #cfe8d5;
    color: #256c3d;
}

.detail-filter-checkbox-inline {
    justify-content: flex-start;
    align-self: end;
    min-height: 48px;
    padding-top: 22px;
}

@media (max-width: 768px) {
    .detail-filter-checkbox-inline {
        width: 100%;
        padding-top: 0;
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .employee-action-row-multi {
        width: 100%;
        justify-content: stretch;
    }

    .employee-action-row-multi .btn,
    .employee-action-row-multi .finish-btn {
        width: 100%;
    }

    .finish-block {
        width: 100%;
        align-items: stretch;
    }

    .finish-hint {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 1200px) {
    .header-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .header-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}


/* location management modal */
.location-modal-card { width: min(980px, 100%); }
.modal-tab-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.modal-tab-btn {
    border: 1px solid #dfe6ef;
    background: #f5f8fc;
    color: #44566c;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.modal-tab-btn.active {
    background: #ffffff;
    color: #1f3552;
    border-color: #cfd9e6;
    box-shadow: 0 8px 20px rgba(31, 42, 55, 0.08);
}
.location-manage-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 18px;
    align-items: start;
}
.location-manage-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #68768a;
    margin-bottom: 10px;
}
.location-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.location-manage-row {
    width: 100%;
    border: 1px solid #e3e8f0;
    background: #f7f9fc;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    text-align: left;
    cursor: pointer;
}
.location-manage-row.active {
    border-color: #c4d4eb;
    background: #eef5ff;
    box-shadow: 0 8px 18px rgba(31, 42, 55, 0.08);
}
.location-manage-row-arrow {
    color: #8091a7;
    font-size: 18px;
    line-height: 1;
}
@media (max-width: 768px) {
    .location-manage-grid { grid-template-columns: 1fr; }
}


.cycle-targets-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr) auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}
.cycle-targets-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cycle-targets-status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cycle-target-card {
    margin-bottom: 12px;
}
.cycle-target-header {
    align-items: center;
}
.cycle-target-checkbox-row,
.cycle-target-subcategory-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.cycle-target-checkbox-row {
    flex: 1;
}
.cycle-target-subcategory-list {
    display: grid;
    gap: 8px;
}
@media (max-width: 900px) {
    .cycle-targets-toolbar {
        grid-template-columns: 1fr;
    }
    .cycle-targets-toolbar-actions {
        justify-content: flex-start;
    }
}


.selected-cycle-card {
    padding: 0;
    overflow: hidden;
}
.selected-cycle-details {
    display: block;
}
.selected-cycle-details summary {
    list-style: none;
}
.selected-cycle-details summary::-webkit-details-marker {
    display: none;
}
.selected-cycle-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
}
.selected-cycle-summary:hover {
    background: #f8fafc;
}
.selected-cycle-title {
    margin: 0 0 8px;
}
.selected-cycle-subtitle {
    margin: 0;
}
.selected-cycle-toggle-text {
    flex-shrink: 0;
    align-self: center;
    color: #2563eb;
    font-weight: 700;
    font-size: 14px;
}


.selected-cycle-details[open] .selected-cycle-toggle-text::before {
    content: 'Свернуть';
}
.selected-cycle-details:not([open]) .selected-cycle-toggle-text::before {
    content: 'Развернуть';
}
.selected-cycle-details[open] .selected-cycle-toggle-text {
    color: #1d4ed8;
}
.selected-cycle-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.65fr) minmax(360px, 1.35fr);
    gap: 20px;
    padding: 0 20px 20px;
    border-top: 1px solid #eef2f7;
}
.selected-cycle-column {
    min-width: 0;
}
.selected-cycle-column-title {
    margin: 16px 0 10px;
}
.selected-cycle-column-categories {
    max-width: 320px;
}
.selected-cycle-column-subcategories {
    min-width: 0;
}

@media (max-width: 840px) {
    .selected-cycle-summary {
        flex-direction: column;
        align-items: stretch;
    }
    .selected-cycle-toggle-text {
        align-self: flex-start;
    }
    .selected-cycle-grid {
        grid-template-columns: 1fr;
    }
    .selected-cycle-column-categories {
        max-width: none;
    }
}

.category-card--success {
    border: 1px solid #bbf7d0 !important;
    background: #f0fdf4;
}

.category-chip--success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.category-chip--warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.success-text {
    color: #166534;
}

#close-cycle-targets-modal-btn {
    background: #dc3545;
    color: #fff;
    border: none;
}

#close-cycle-targets-modal-btn:hover {
    background: #bb2d3b;
}

.actions-col {
    width: 88px;
}

.actions-cell {
    text-align: center;
    vertical-align: middle;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.icon-action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #dbe4f0;
    background: #f8fbff;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.icon-action-btn:hover {
    background: #eef4ff;
    box-shadow: 0 8px 18px rgba(31, 42, 55, 0.10);
    transform: translateY(-1px);
}

.icon-action-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.discrepancy-edit-modal-card {
    width: min(560px, 100%);
}

.discrepancy-edit-summary {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.discrepancy-edit-summary strong {
    display: block;
    margin-bottom: 6px;
}

.message.success-text {
    color: #137333;
}

.payroll-page {
    max-width: 1720px;
}

.payroll-filter-grid,
.payroll-settings-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.payroll-filter-grid > label,
.payroll-settings-grid > label {
    grid-column: span 3;
    margin-bottom: 0;
}

.payroll-settings-rates-card {
    margin-top: 18px;
    border: 1px solid #e7edf4;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #fbfcff 0%, #f8fbff 100%);
    transition: opacity .18s ease, filter .18s ease;
}

.payroll-settings-rates-card.is-disabled {
    opacity: 0.6;
    filter: grayscale(0.12);
}

.payroll-settings-rates-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.payroll-settings-rates-head h3 {
    margin: 0 0 6px;
}

.settings-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.settings-rate-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #dde6f1;
    background: #fff;
    min-height: 116px;
}

.settings-rate-card input {
    margin-top: auto;
}

.settings-bonus-checkbox {
    margin-top: auto;
    align-items: center;
}

.settings-threshold-grid {
    display: grid;
    gap: 12px;
}

.settings-threshold-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #dde6f1;
    border-radius: 16px;
    background: #fff;
}

.settings-rate-name {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.35;
}

.payroll-filter-grid--with-actions {
    grid-template-columns: repeat(15, minmax(0, 1fr));
    align-items: end;
}

.payroll-filter-grid--with-actions > label {
    grid-column: span 3;
}

.payroll-filter-actions-inline {
    grid-column: span 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-self: end;
}

.payroll-filter-actions-inline .btn {
    min-height: 50px;
}

.payroll-toolbar-actions {
    margin-top: 16px;
}

.payroll-kpi-grid {
    margin-top: 20px;
}

.payroll-days-container {
    display: grid;
    gap: 14px;
}

.payroll-view-switcher-card {
    padding-top: 14px;
    padding-bottom: 14px;
}

.payroll-view-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payroll-view-btn {
    min-width: 140px;
    justify-content: center;
}

.save-action-status {
    margin-top: 10px;
}

.payroll-day-card,
.audit-log-card,
.expense-template-card,
.expense-entry-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.payroll-day-card--accordion {
    padding: 0;
    overflow: hidden;
}

.payroll-day-card--accordion[open] {
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.payroll-day-toggle,
.payroll-day-header,
.audit-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.payroll-day-header {
    margin-bottom: 12px;
}

.payroll-day-toggle {
    list-style: none;
    cursor: pointer;
    padding: 16px;
}

.payroll-day-toggle::-webkit-details-marker {
    display: none;
}

.payroll-day-toggle-side,
.payroll-day-header-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.payroll-day-total-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1f4aa8;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.payroll-day-accordion-body {
    padding: 0 16px 16px;
    border-top: 1px solid #e7edf4;
}

.payroll-shift-section-head {
    margin: 16px 0 12px;
}

.payroll-shift-section-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.payroll-shift-categories-wrap {
    margin-top: 10px;
}

.payroll-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.payroll-day-grid--emphasis > div {
    padding: 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #e1ebfb;
}

.payroll-day-grid--emphasis .summary-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #60708c;
}

.payroll-day-grid--emphasis strong {
    font-size: 20px;
    font-weight: 800;
    color: #19345d;
}

.payroll-chip {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.payroll-chip.green {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.payroll-chip.orange {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.payroll-table input,
.payroll-table select {
    width: 100%;
}

.shift-toolbar-grid {
    align-items: end;
}

.shift-toolbar-action {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shift-toolbar-action .btn {
    min-height: 48px;
}

.btn-with-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: payroll-spin .8s linear infinite;
}

.btn.secondary .btn-loader {
    border-color: rgba(38, 50, 56, 0.2);
    border-top-color: #263238;
}

.btn.is-loading {
    opacity: 0.92;
    cursor: wait;
}

.payroll-inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #4b5b70;
    font-size: 13px;
    white-space: nowrap;
}

.payroll-title-with-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.payroll-title-with-loading h2 {
    margin: 0;
}

@keyframes payroll-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.shift-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
    margin-bottom: 10px;
}

.shift-calendar-weekdays span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 12px;
    background: #eef3fb;
    color: #516174;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.shift-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.shift-calendar-cell {
    min-height: 160px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid #dde6f1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-calendar-cell--today {
    border-color: #9ec2ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.shift-calendar-cell--empty {
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.shift-calendar-cell-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.shift-calendar-day-meta {
    min-width: 0;
}

.shift-calendar-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shift-calendar-cell-head strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    margin-bottom: 2px;
}

.shift-calendar-cell-head span {
    font-size: 11px;
    color: #68768a;
}

.shift-calendar-count {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef4ff;
    color: #234a91;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.shift-calendar-cell-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.shift-calendar-entry {
    border-radius: 12px;
    padding: 9px;
    border: 1px solid #e4eaf3;
    background: #fff;
}

.shift-calendar-entry.open {
    background: #fffaf0;
    border-color: #f5ddb1;
}

.shift-calendar-entry.closed {
    background: #f4fbf7;
    border-color: #d8efdf;
}

.shift-calendar-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 6px;
}

.shift-calendar-entry-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shift-calendar-entry-head strong {
    font-size: 13px;
    line-height: 1.25;
}

.shift-calendar-entry-meta,
.shift-calendar-empty-day,
.shift-calendar-empty {
    color: #5d6a7d;
    font-size: 12px;
}

.shift-calendar-entry-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.shift-calendar-entry-actions .btn {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    font-size: 13px;
}

.shift-calendar-add-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.shift-calendar-add-btn:hover {
    background: #1d4ed8;
}

.shift-calendar-mobile-actions {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
}

.shift-calendar-mobile-add-btn,
.shift-calendar-mobile-remove-btn {
    display: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.shift-calendar-mobile-add-btn {
    background: #2563eb;
}

.shift-calendar-mobile-remove-btn {
    background: #dc3545;
}

.shift-calendar-mobile-remove-btn--inline {
    width: 26px;
    height: 26px;
    min-width: 26px;
}

.shift-modal-card {
    width: min(640px, 100%);
}

.shift-modal-grid {
    margin-top: 12px;
}

.shift-modal-grid > label {
    grid-column: span 6;
}

.shift-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.expense-layout {
    display: grid;
    gap: 18px;
}

.expense-create-card,
.expense-section {
    border: 1px solid #e7edf4;
    border-radius: 18px;
    padding: 18px;
    background: #fbfcff;
}

.expense-create-grid > label,
.expense-manual-grid > label {
    grid-column: span 3;
}

.expense-comment-field,
.expense-entry-comment {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-comment-field textarea,
.expense-entry-comment textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
}

.expense-comment-field--full {
    grid-column: 1 / -1;
}

.expense-checkbox-card {
    min-height: 50px;
    border: 1px solid #dfe6ef;
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
}

.expense-checkbox-card--inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.expense-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.expense-section-head h3,
.expense-template-card h4,
.expense-entry-card h4 {
    margin: 0 0 6px;
}

.expense-template-grid,
.expense-entry-grid {
    display: grid;
    gap: 14px;
}

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

.expense-template-card-head,
.expense-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.expense-template-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: #516174;
}

.expense-template-actions,
.expense-entry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.expense-entry-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.expense-entry-comment {
    grid-column: 1 / -1;
}

.expense-entry-card.manual {
    border-color: #dce7fb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.expense-template-actions {
    display: flex;
    justify-content: flex-end;
}

.expense-entry-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.expense-entry-form label {
    margin-bottom: 0;
}

.expense-entry-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.expense-entry-card--accordion {
    padding: 0;
    overflow: hidden;
}

.expense-entry-card--accordion[open] {
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.expense-entry-toggle {
    list-style: none;
    cursor: pointer;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.expense-entry-toggle::-webkit-details-marker {
    display: none;
}

.expense-entry-toggle-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.expense-entry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1f4aa8;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.expense-entry-toggle-meta {
    white-space: nowrap;
}

.expense-entry-accordion-body {
    padding: 0 16px 16px;
    border-top: 1px solid #e7edf4;
}

.checkbox-like {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-like input {
    width: auto;
    margin-top: 0;
}

.audit-filter-bar {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.audit-filter-bar > label {
    grid-column: span 4;
    margin-bottom: 0;
}

.audit-filter-actions {
    grid-column: span 4;
    display: flex;
    justify-content: flex-end;
}

.audit-log-list {
    display: grid;
    gap: 12px;
}

.audit-day-card {
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    background: #fbfcff;
    overflow: hidden;
}

.audit-day-card summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 800;
    color: #1f2937;
}

.audit-day-card summary::-webkit-details-marker {
    display: none;
}

.audit-day-count {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #234a91;
    font-size: 13px;
}

.audit-day-body {
    border-top: 1px solid #e7edf4;
    padding: 8px 18px 16px;
}

.audit-log-row {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

.audit-log-row:last-child {
    border-bottom: none;
}

.audit-log-message {
    color: #425466;
    line-height: 1.5;
}



@media (max-width: 1280px) {
    .payroll-filter-grid > label,
    .payroll-settings-grid > label,
    .shift-toolbar-action,
    .expense-create-grid > label,
    .expense-manual-grid > label,
    .audit-filter-bar > label,
    .audit-filter-actions {
        grid-column: span 4;
    }

    .payroll-filter-actions-inline {
        grid-column: span 4;
    }

    .shift-calendar-grid,
    .shift-calendar-weekdays {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .expense-entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .payroll-filter-grid,
    .payroll-settings-grid,
    .expense-entry-form,
    .shift-calendar-grid,
    .shift-calendar-weekdays,
    .audit-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-filter-grid > label,
    .payroll-settings-grid > label,
    .shift-toolbar-action,
    .expense-create-grid > label,
    .expense-manual-grid > label,
    .audit-filter-bar > label,
    .audit-filter-actions,
    .payroll-filter-actions-inline,
    .shift-modal-grid > label {
        grid-column: span 2;
    }

    .payroll-filter-actions-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shift-calendar-cell {
        min-height: 140px;
    }
}

@media (max-width: 640px) {
    .payroll-filter-grid,
    .payroll-settings-grid,
    .expense-entry-form,
    .shift-calendar-grid,
    .shift-calendar-weekdays,
    .settings-category-grid,
    .expense-template-grid,
    .audit-filter-bar {
        grid-template-columns: 1fr;
    }

    .payroll-filter-grid > label,
    .payroll-settings-grid > label,
    .shift-toolbar-action,
    .expense-create-grid > label,
    .expense-manual-grid > label,
    .audit-filter-bar > label,
    .audit-filter-actions,
    .payroll-filter-actions-inline,
    .shift-modal-grid > label {
        grid-column: span 1;
    }

    .payroll-filter-actions-inline {
        grid-template-columns: 1fr;
    }

    .expense-template-card-head,
    .expense-entry-head,
    .payroll-day-header,
    .shift-calendar-entry-head,
    .expense-section-head,
    .payroll-settings-rates-head,
    .shift-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .expense-entry-actions,
    .expense-template-actions,
    .audit-filter-actions {
        justify-content: stretch;
    }

    .expense-entry-actions .btn,
    .expense-template-actions .btn,
    .shift-toolbar-action .btn,
    .shift-modal-actions .btn,
    .audit-filter-actions .btn {
        width: 100%;
    }

    .expense-entry-toggle,
    .expense-entry-toggle-side {
        flex-direction: column;
        align-items: stretch;
    }

    .expense-entry-toggle-meta {
        white-space: normal;
    }

    .shift-calendar-cell {
        min-height: 120px;
        padding: 8px;
    }
}


.payroll-collapse {
    display: block;
}

.payroll-collapse summary {
    list-style: none;
}

.payroll-collapse summary::-webkit-details-marker {
    display: none;
}

.payroll-collapse-summary {
    align-items: center;
    cursor: pointer;
}

.payroll-collapse-btn {
    pointer-events: none;
}

.payroll-collapse-body {
    margin-top: 14px;
}

.shift-calendar-scroller {
    width: 100%;
}

.employee-shift-calendar-grid .shift-calendar-cell {
    min-height: 180px;
}

.employee-shift-calendar-cell.employee-shift-day--closed {
    background: #f2fbf4;
    border-color: #cfead6;
}

.employee-shift-calendar-cell.employee-shift-day--future {
    background: #fff9e8;
    border-color: #efe0a7;
}

.employee-shift-calendar-cell.employee-shift-day--today-open {
    background: #eef5ff;
    border-color: #cfe0ff;
}

.employee-shift-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}

.employee-shift-status.closed {
    color: #0b6b2b;
    background: #dff4e5;
}

.employee-shift-status.open {
    color: #2356c8;
    background: #dfeaff;
}

.employee-shift-status.planned {
    color: #8a6700;
    background: #fff1bf;
}

.employee-shift-lines {
    display: grid;
    gap: 8px;
}

.employee-shift-lines--highlight {
    margin-top: 14px;
}

.employee-shift-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.employee-shift-line span {
    color: #54657f;
    font-weight: 700;
}

.employee-shift-line strong {
    color: #1d2d44;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 800;
}

.employee-shift-line.total {
    padding-top: 10px;
    border-top: 1px dashed #d7e0ef;
}

.employee-shift-open-btn {
    white-space: nowrap;
}

.employee-shift-calendar-cell .shift-calendar-empty-day {
    font-size: 13px;
}

.employee-shift-calendar-cell .shift-calendar-cell-head span {
    font-size: 11px;
}


@media (max-width: 768px) {
    .employee-shift-calendar-grid .shift-calendar-cell {
        min-height: 150px;
    }

    .employee-shift-line {
        font-size: 14px;
    }

    .employee-shift-line strong {
        font-size: 14px;
    }

    .shift-calendar-scroller .shift-calendar-mobile-remove-btn--inline {
        display: inline-flex;
    }
}


@media (max-width: 640px) {
    .shift-calendar-scroller {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .shift-calendar-scroller .shift-calendar-weekdays,
    .shift-calendar-scroller .shift-calendar-grid {
        grid-template-columns: repeat(7, minmax(92px, 1fr));
        min-width: 720px;
    }

    .shift-calendar-scroller .shift-calendar-cell {
        min-height: 132px;
        padding: 8px;
        gap: 8px;
    }

    .shift-calendar-scroller .shift-calendar-cell-head strong {
        font-size: 18px;
    }

    .shift-calendar-scroller .shift-calendar-entry-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .shift-calendar-scroller .shift-calendar-entry-actions .btn {
        font-size: 12px;
        padding: 7px 8px;
    }

    .shift-calendar-scroller .shift-calendar-count,
    .shift-calendar-scroller .shift-calendar-add-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 16px;
    }

    .shift-calendar-scroller .shift-calendar-cell-head span,
    .shift-calendar-scroller .shift-calendar-entry-meta,
    .shift-calendar-scroller .shift-calendar-empty-day,
    .shift-calendar-scroller .shift-calendar-empty,
    .shift-calendar-scroller .employee-shift-line {
        font-size: 11px;
    }

    .shift-calendar-scroller .employee-shift-open-btn {
        font-size: 11px;
        min-height: 30px;
        padding: 7px 8px;
    }

    .shift-calendar-scroller .shift-calendar-mobile-remove-btn--inline {
        display: inline-flex;
    }
}

.payroll-filter-grid--shifts-top {
    align-items: end;
}

.shift-days-filter-bar {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e1e7f0;
    display: grid;
    gap: 12px;
}

.shift-days-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shift-days-filter-buttons .btn.active {
    background: #2f6ae5;
    color: #fff;
    border-color: #2f6ae5;
}

.shift-date-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.shift-date-picker-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    width: min(360px, 92vw);
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #d7dfed;
    background: #fff;
    box-shadow: 0 18px 48px rgba(17, 31, 60, 0.16);
}

.shift-date-picker-head {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.shift-date-picker-weekdays,
.shift-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.shift-date-picker-weekdays {
    margin-bottom: 8px;
}

.shift-date-picker-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #6f7c91;
}

.shift-date-picker-cell {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid #d7dfed;
    background: #f7f9fd;
    font: inherit;
    font-weight: 700;
    color: #19345d;
    cursor: pointer;
}

.shift-date-picker-cell:hover:not(:disabled) {
    border-color: #2f6ae5;
}

.shift-date-picker-cell.is-active {
    background: #2f6ae5;
    border-color: #2f6ae5;
    color: #fff;
}

.shift-date-picker-cell.is-disabled,
.shift-date-picker-cell:disabled {
    background: #f1f3f7;
    border-color: #e2e7ef;
    color: #a0a9b7;
    cursor: not-allowed;
}

.shift-date-picker-cell--empty {
    visibility: hidden;
}

@media (max-width: 768px) {
    .shift-date-picker-popover {
        width: min(320px, 92vw);
        left: 50%;
        transform: translateX(-50%);
    }
}

.payroll-category-filters {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.payroll-category-filters label {
    grid-column: span 3;
    margin-bottom: 0;
}

.payroll-category-filter-meta {
    grid-column: span 3;
    align-self: center;
    padding-top: 12px;
}

.payroll-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.payroll-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.payroll-table th,
.payroll-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e7edf4;
    text-align: left;
    vertical-align: top;
}

.payroll-table th {
    background: #f7faff;
    color: #425466;
    font-size: 13px;
    font-weight: 800;
}

.payroll-table td strong {
    color: #19345d;
}

.shift-detail-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shift-calendar-mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.shift-calendar-mini-chip,
.shift-calendar-mini-more {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.shift-calendar-mini-chip.open {
    background: #fff3d7;
    color: #a15c00;
}

.shift-calendar-mini-chip.closed {
    background: #dff4e5;
    color: #0b6b2b;
}

.shift-calendar-mini-more {
    background: #eef4ff;
    color: #234a91;
}

.employee-shift-status--compact {
    width: 100%;
    justify-content: center;
    padding: 5px 6px;
    font-size: 10px;
    margin-bottom: 6px;
}

.employee-shift-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-flex;
    align-self: center;
    margin: 2px auto 4px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.employee-shift-status-dot.closed {
    background: #16a34a;
}

.employee-shift-status-dot.open,
.employee-shift-status-dot.planned {
    background: #f59e0b;
}

.employee-shift-compact-total {
    font-size: 11px;
    font-weight: 800;
    color: #1d2d44;
    text-align: center;
}

@media (max-width: 900px) {
    .payroll-category-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-category-filters label,
    .payroll-category-filter-meta {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .header-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-view-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-view-btn {
        min-width: 0;
        width: 100%;
    }

    .payroll-page .category-card,
    .payroll-page .auth-card {
        padding: 16px;
    }

    .payroll-category-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .payroll-category-filters label,
    .payroll-category-filter-meta {
        grid-column: span 1;
    }

    .payroll-category-filter-meta {
        padding-top: 0;
    }

    .payroll-table-wrap {
        overflow: visible;
    }

    .payroll-category-table,
    .payroll-category-table thead,
    .payroll-category-table tbody,
    .payroll-category-table tr,
    .payroll-category-table th,
    .payroll-category-table td {
        display: block;
        width: 100%;
    }

    .payroll-category-table {
        min-width: 0;
    }

    .payroll-category-table thead {
        display: none;
    }

    .payroll-category-table tbody {
        display: grid;
        gap: 12px;
    }

    .payroll-category-table tr {
        border: 1px solid #e1e8f2;
        border-radius: 16px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(31, 42, 55, 0.04);
    }

    .payroll-category-table td {
        border: none;
        padding: 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        font-size: 14px;
    }

    .payroll-category-table td + td {
        margin-top: 8px;
    }

    .payroll-category-table td::before {
        content: attr(data-label);
        color: #6b7a96;
        font-weight: 700;
        flex: 0 0 auto;
    }

    .payroll-day-toggle,
    .payroll-day-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .payroll-day-toggle-side,
    .payroll-day-header-side {
        width: 100%;
        justify-content: space-between;
    }

    .payroll-day-grid--emphasis {
        grid-template-columns: 1fr 1fr;
    }

    .payroll-day-grid--emphasis strong {
        font-size: 17px;
    }

    .employee-shift-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .employee-shift-line strong {
        font-size: 16px;
    }

    .shift-detail-actions {
        flex-direction: column;
    }

    .shift-detail-actions .btn {
        width: 100%;
    }

    .shift-calendar-scroller {
        overflow: visible;
        padding-bottom: 0;
    }

    .shift-calendar-scroller .shift-calendar-weekdays,
    .shift-calendar-scroller .shift-calendar-grid {
        min-width: 0;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
    }

    .shift-calendar-scroller .shift-calendar-weekdays span {
        min-height: 24px;
        border-radius: 8px;
        font-size: 10px;
        padding: 2px 0;
    }

    .shift-calendar-scroller .shift-calendar-cell {
        min-height: 92px;
        padding: 5px;
        gap: 6px;
        border-radius: 12px;
    }

    .shift-calendar-scroller .shift-calendar-cell--compact {
        min-height: 76px;
        cursor: pointer;
    }

    .shift-calendar-scroller .shift-calendar-cell-head {
        gap: 4px;
    }

    .shift-calendar-scroller .shift-calendar-cell-head strong {
        font-size: 15px;
        margin-bottom: 0;
    }

    .shift-calendar-scroller .shift-calendar-cell-head span {
        display: none;
    }

    .shift-calendar-scroller .shift-calendar-head-actions {
        gap: 4px;
    }

    .shift-calendar-scroller .shift-calendar-count,
    .shift-calendar-scroller .shift-calendar-add-btn {
        width: 20px;
        height: 20px;
        min-width: 20px;
        font-size: 12px;
        box-shadow: none;
    }

    .shift-calendar-scroller .shift-calendar-cell-body {
        gap: 4px;
    }

    .shift-calendar-scroller .shift-calendar-entry,
    .shift-calendar-scroller .shift-calendar-entry-actions,
    .shift-calendar-scroller .shift-calendar-entry-meta,
    .shift-calendar-scroller .shift-calendar-empty,
    .shift-calendar-scroller .shift-calendar-empty-day {
        display: none;
    }

    .shift-calendar-scroller .shift-calendar-mini-list,
    .shift-calendar-scroller .shift-calendar-empty-day {
        display: flex;
    }

    .shift-calendar-scroller .shift-calendar-mobile-actions {
        display: flex;
    }

    .shift-calendar-scroller .shift-calendar-mini-chip,
    .shift-calendar-scroller .shift-calendar-mini-more {
        min-width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .shift-calendar-scroller .shift-calendar-add-btn {
        display: none;
    }

    .shift-calendar-scroller .shift-calendar-mobile-add-btn,
    .shift-calendar-scroller .shift-calendar-mobile-remove-btn {
        display: inline-flex;
        width: 18px;
        height: 18px;
        min-width: 18px;
        font-size: 13px;
        box-shadow: none;
    }

    .shift-calendar-scroller .shift-calendar-mobile-add-btn {
        order: -1;
        font-size: 14px;
    }

    .shift-calendar-scroller .shift-calendar-mobile-remove-btn--inline {
        display: none;
    }

    .shift-calendar-scroller .employee-shift-calendar-cell {
        min-height: 74px;
        padding: 4px;
    }

    .shift-calendar-scroller .employee-shift-calendar-cell .shift-calendar-day-meta {
        width: 100%;
        text-align: left;
    }

    .shift-calendar-scroller .employee-shift-calendar-cell .shift-calendar-cell-body {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .shift-calendar-scroller .employee-shift-status {
        margin-bottom: 0;
    }

    .shift-calendar-scroller .employee-shift-calendar-cell .shift-calendar-empty-day {
        width: 100%;
        font-size: 10px;
        line-height: 1.15;
        text-align: center;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .shift-calendar-scroller .employee-shift-status {
        font-size: 10px;
        padding: 4px 7px;
    }

    .shift-calendar-scroller .employee-shift-line {
        font-size: 12px;
    }

    .shift-calendar-scroller .employee-shift-status-dot {
        width: 10px;
        height: 10px;
        margin-bottom: 2px;
    }

    .shift-calendar-scroller .employee-shift-compact-total {
        width: 100%;
        font-size: 10px;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-align: center;
    }

    .shift-calendar-scroller .employee-shift-lines,
    .shift-calendar-scroller .employee-shift-line {
        display: none;
    }

    .shift-calendar-scroller .employee-shift-open-btn {
        font-size: 10px;
        min-height: 24px;
        padding: 5px 6px;
    }
}

.payroll-collapse--nested {
    border: 1px solid #e7edf4;
    border-radius: 16px;
    background: #fbfcff;
}

.payroll-collapse--nested .payroll-collapse-summary {
    padding: 16px 18px;
}

.payroll-collapse--nested .payroll-collapse-body {
    padding-top: 0;
}



.shift-add-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.shift-floating-add-btn {
    position: fixed;
    right: 18px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
    z-index: 60;
}

.shift-floating-add-btn:hover {
    background: #1d4ed8;
}

@media (max-width: 768px) {
    .settings-threshold-row {
        grid-template-columns: 1fr;
    }

    
.shift-add-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.shift-floating-add-btn {
        right: 10px;
        bottom: max(6px, env(safe-area-inset-bottom));
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 520px) {
    .auth-actions {
        flex-direction: column;
        gap: 10px;
    }
    .auth-actions .btn,
    .auth-secondary-action {
        width: 100%;
    }
    .auth-submit-btn {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .app-brand-mark {
        width: 48px;
        height: 44px;
    }
    .app-brand-name {
        font-size: 24px;
    }
    .app-brand-tagline {
        font-size: 9px;
    }
    .auth-brand-logo {
        width: min(240px, 78%);
        max-height: 130px;
    }
}

/* sales motivations catalog */
.sales-motivation-toggle-side {
    margin-left: auto;
    flex-shrink: 0;
}

.sales-motivation-select-card {
    margin-top: 0;
    min-height: 0;
    white-space: nowrap;
}

button.loading,
button:disabled.loading {
    cursor: wait;
}

@media (max-width: 720px) {
    .sales-motivation-toggle-side {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

.payroll-loading-status {
    overflow: hidden;
}

.payroll-loading-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.payroll-loading-steps {
    display: grid;
    gap: 8px;
}

.payroll-loading-step {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(31, 92, 168, 0.10);
}

.payroll-loading-step strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.payroll-loading-step span:not(.payroll-loading-dot) {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.78;
}

.payroll-loading-dot {
    width: 10px;
    height: 10px;
    margin-top: 3px;
    border-radius: 999px;
    border: 2px solid currentColor;
    opacity: 0.35;
}

.payroll-loading-step.active .payroll-loading-dot {
    opacity: 1;
    animation: payroll-loading-pulse 0.9s ease-in-out infinite;
}

.payroll-loading-step.done .payroll-loading-dot {
    opacity: 1;
    border-width: 5px;
}

.payroll-loading-step.error .payroll-loading-dot {
    opacity: 1;
}

.payroll-loading-note {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.76;
}

@keyframes payroll-loading-pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* Interactive onboarding */
.tutorial-launcher {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 990;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tutorial-launcher:hover,
.tutorial-launcher:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 13px 30px rgba(37, 99, 235, 0.38);
    outline: none;
}
.tutorial-start-modal {
    z-index: 10060;
}
.tutorial-start-card {
    width: min(620px, 100%);
}
.tutorial-start-actions,
.tutorial-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.tutorial-spotlight {
    position: fixed;
    z-index: 10001;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.66), 0 0 0 6px rgba(37, 99, 235, 0.28), 0 18px 48px rgba(15, 23, 42, 0.28);
    pointer-events: none;
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.tutorial-popover {
    position: fixed;
    z-index: 10050;
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #263238;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3);
}
.tutorial-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.tutorial-step-counter {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}
.tutorial-close-btn,
.tutorial-modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #eef2f7;
    color: #263238;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.tutorial-title {
    margin: 0 0 8px;
}
.tutorial-text {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
}
.tutorial-start-note,
.tutorial-demo-notice {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}
.tutorial-start-note,
.tutorial-demo-notice {
    background: #eefbf3;
    color: #166534;
}
.tutorial-placeholder {
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}
.tutorial-fake-record {
    border: 2px dashed #60a5fa;
    background: #eff6ff;
}
.tutorial-current-target {
    border-radius: 14px;
}
.tutorial-click-feedback {
    transform: scale(0.98);
    transition: transform 0.12s ease;
}
body.tutorial-active .tutorial-launcher {
    display: none;
}
body.tutorial-active {
    overflow-x: hidden;
}

.modal-overlay.tutorial-modal-open {
    z-index: 10003;
}
body.tutorial-active .modal-overlay.tutorial-modal-open {
    overscroll-behavior: contain;
}
body.tutorial-active .modal-overlay.tutorial-modal-open .modal-card {
    position: relative;
    z-index: 10012;
    outline: 2px solid rgba(255, 255, 255, 0.96);
}

@media (max-width: 640px) {
    .tutorial-launcher {
        top: 9px;
        right: 9px;
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .tutorial-popover {
        left: 10px !important;
        right: 10px;
        width: auto;
        max-height: 46vh;
        padding: 14px;
    }
    .tutorial-actions,
    .tutorial-start-actions {
        justify-content: stretch;
    }
    .tutorial-actions .btn,
    .tutorial-start-actions .btn {
        flex: 1 1 100%;
    }
}
.tutorial-launcher::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    background: #111827;
    color: #fff;
    border-radius: 10px;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.tutorial-launcher:hover::after,
.tutorial-launcher:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(-2px);
}
@media (max-width: 640px) {
    .tutorial-launcher::after {
        display: none;
    }
}

.registration-request-row {
    align-items: stretch;
}
.registration-request-row .user-row-actions {
    min-width: 180px;
    justify-content: flex-end;
}
@media (max-width: 720px) {
    .registration-request-row { flex-direction: column; }
    .registration-request-row .user-row-actions { justify-content: stretch; min-width: 0; }
    .registration-request-row .user-row-actions .btn { width: 100%; }
}
