/* Settings pages (Permission / Role / Role Permission / Worker Service) - new design, same backend
   calls/business logic as the old Pages/SystemAdmin/*.razor screens (see each page's own header
   comment for the exact old-page reference). Scoped under .settings-page so the toolbar/table/
   pagination rules below don't leak onto other pages - same scoping pattern transactions.css uses
   under .transaction-page. */

/* =========================================================
   TOOLBAR (search + Clear Filters + page size + filter + Add button, all in one row)
   ========================================================= */

.settings-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.settings-search {
    flex: 1;
    min-width: 220px;
}

.settings-search .mud-input-outlined-border {
    border-color: #bdbdbd;
    border-radius: 12px !important;
}

.settings-search .mud-input:hover .mud-input-outlined-border {
    border-color: #98a2b3;
}

.settings-search .mud-input-slot {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

/* Clear Filters / outlined icon-only filter button - same shell as .transaction-page's own
   .filter-btn/.export-btn (12px radius, #bdbdbd border, blue hover). */
.settings-page .filter-btn.mud-button-outlined,
.settings-page .filter-icon-btn.mud-icon-button {
    color: #475467 !important;
    border-color: #bdbdbd !important;
}

.settings-page .filter-btn.mud-button-outlined:hover,
.settings-page .filter-icon-btn.mud-icon-button:hover {
    color: #2563eb !important;
    border-color: #98a2b3 !important;
    background-color: #f2f5fa !important;
}

.settings-page .filter-btn.mud-button-root {
    height: 40px !important;
    min-width: auto;
    padding-left: 14px !important;
    padding-right: 14px !important;
    border-radius: 12px !important;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
}

.filter-icon-btn.mud-icon-button {
    border: 1px solid #bdbdbd;
    border-radius: 12px;
    width: 40px;
    height: 40px;
}

.settings-add-btn.mud-button-root {
    height: 40px !important;
    border-radius: 12px !important;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

/* Page-size select - identical pill shell to .transaction-page's own .page-size-select. */
.settings-page .page-size-select {
    width: auto;
    min-width: 92px;
    flex-shrink: 0;
}

.settings-page .page-size-select .mud-input-outlined-border {
    border-color: #e4e7ec;
    border-radius: 999px !important;
}

.settings-page .page-size-select .mud-input-slot {
    padding: 5px 12px !important;
    font-size: 13px;
}

/* =========================================================
   TABLE - sortable headers, colored module/role badges
   ========================================================= */

.settings-table {
    width: 100%;
    margin-top: 16px;
}

.settings-table .mud-table-head {
    background: #fafbfc;
}

.settings-table .mud-table-head .mud-table-cell {
    color: #475467;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 8px;
    white-space: nowrap;
}

.settings-table .mud-table-body .mud-table-cell {
    color: #344054;
    font-size: 13px;
    padding: 10px 8px;
    border-bottom: 1px solid #eef0f2;
}

.settings-sort-head {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.settings-sort-head:hover {
    color: #2563eb;
}

.settings-sort-head .mud-icon-root {
    font-size: 14px !important;
    opacity: 0.6;
}

/* Badges (Module / Role Description) - same compact filled-chip palette as
   .transaction-table .mud-chip-filled.mud-chip-color-* (transactions.css), reused rather than
   inventing new hex values. */
.settings-table .mud-chip {
    height: 22px;
    min-height: 22px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.settings-table .mud-chip-filled.mud-chip-color-primary {
    background: #eff6ff;
    color: #2563eb;
}

.settings-table .mud-chip-filled.mud-chip-color-success {
    background: #ecfdf3;
    color: #039855;
}

.settings-table .mud-chip-filled.mud-chip-color-secondary {
    background: #fff7ed;
    color: #ea580c;
}

.settings-table .mud-chip-filled.mud-chip-color-warning {
    background: #fffaeb;
    color: #b54708;
}

.settings-table .mud-chip-filled.mud-chip-color-error {
    background: #fef3f2;
    color: #d92d20;
}

.settings-table .mud-chip-filled.mud-chip-color-default {
    background: #f2f4f7;
    color: #475467;
}

.settings-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.settings-row-actions .mud-icon-button {
    width: 30px;
    height: 30px;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    padding: 32px 0;
}

.empty-state i {
    font-size: 32px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* =========================================================
   PAGINATION - identical shell to .transaction-page's own pagination rules
   ========================================================= */

.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 12px;
    color: #667085;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-page .mud-pagination {
    margin-top: 2px;
    gap: 2px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.settings-page .mud-pagination-item {
    margin: 0;
    flex: 0 0 auto;
}

.settings-page .mud-pagination-item .mud-button-root {
    min-width: 26px !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;

    border-radius: 8px !important;
    border: 1px solid #d0d5dd !important;
    background: #ffffff !important;

    color: #475467 !important;
}

.settings-page .mud-pagination-item .mud-button-root:hover {
    border-color: #2563eb !important;
    background: #f5f8ff !important;
    color: #2563eb !important;
}

.settings-page .mud-pagination-item-selected .mud-button-root,
.settings-page .mud-pagination-item .mud-button-outlined-primary {
    border-color: #2563eb !important;
    background: #2563eb !important;
    color: #ffffff !important;
}

.settings-page .mud-pagination-item > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #98a2b3;
    font-size: 12px;
}

/* =========================================================
   ROLE PERMISSION MAPPING - two-pane layout
   ========================================================= */

.rp-roles-panel {
    max-height: 640px;
    overflow-y: auto;
}

.rp-role-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.rp-role-row:hover {
    background: #f5f8ff;
}

.rp-role-row--selected {
    background: #edf3ff;
}

.rp-role-row-id {
    font-size: 13px;
    font-weight: 700;
    color: #172033;
}

.rp-role-row-desc {
    font-size: 12px;
    color: #667085;
}

.rp-permissions-panel {
    max-height: 640px;
    overflow-y: auto;
}

.rp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #9ca3af;
    min-height: 260px;
}

.rp-module-group {
    margin-bottom: 20px;
}

.rp-module-title {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    border-bottom: 1px solid #eef0f2;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

/* =========================================================
   WORKER SERVICE
   ========================================================= */

.worker-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #172033;
}

.worker-row-desc {
    color: #667085;
}
