.role-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.role-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1rem;
}

.role-toolbar-eyebrow,
.role-modal-eyebrow {
    display: block;
    margin-bottom: 0.25rem;
    color: #b42318;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.role-toolbar-copy h2 {
    margin: 0;
    color: #172033;
    font-size: 1.25rem;
    font-weight: 700;
}

.role-toolbar-copy p,
.role-modal-subtitle {
    margin: 0.3rem 0 0;
    color: #667085;
    font-size: 0.8rem;
}

.role-toolbar-actions {
    display: flex;
    align-items: end;
    gap: 0.6rem;
}

.role-filter-field label {
    display: block;
    margin-bottom: 0.3rem;
    color: #475467;
    font-size: 0.7rem;
    font-weight: 650;
}

.role-filter-field select {
    min-width: 8.5rem;
}

.role-search-field {
    width: 14rem;
}

.role-add-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding-inline: 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.76rem;
    font-weight: 650;
}

.role-table-wrap {
    border: 1px solid #eaecf0;
    border-radius: 0.75rem;
}

#roleTable thead th {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    color: #667085;
    background: #f8fafc;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#roleTable tbody td {
    padding: 0.72rem 0.9rem;
    border-bottom-color: #f1f3f5;
}

.role-code {
    padding: 0.26rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    color: #334155;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
}

.role-name,
.role-description {
    display: block;
}

.role-name {
    color: #1d2939;
    font-size: 0.84rem;
}

.role-description {
    max-width: 30rem;
    margin-top: 0.18rem;
    overflow: hidden;
    color: #98a2b3;
    font-size: 0.72rem;
    text-overflow: ellipsis;
}

.role-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.role-status-pill i {
    font-size: 0.4rem;
}

.role-status-active {
    color: #067647;
    background: #ecfdf3;
}

.role-status-inactive {
    color: #b42318;
    background: #fef3f2;
}

.role-action-btn {
    width: 1.9rem;
    height: 1.9rem;
    margin: 0 0.08rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
}

.role-action-view {
    border-color: #dbeafe;
    color: #175cd3;
    background: #eff6ff;
}

.role-action-edit {
    border-color: #fde68a;
    color: #a15c07;
    background: #fffbeb;
}

.role-action-delete {
    border-color: #fecaca;
    color: #b42318;
    background: #fef2f2;
}

.role-datatable-top,
.role-datatable-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
}

.role-form-section {
    padding: 1.15rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #fff;
}

.role-form-section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.role-access-heading {
    justify-content: space-between;
}

.role-form-section-heading h6 {
    margin: 0;
    color: #1d2939;
    font-size: 0.9rem;
    font-weight: 700;
}

.role-form-section-heading p {
    margin: 0.15rem 0 0;
    color: #667085;
    font-size: 0.74rem;
}

.role-section-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    color: #b42318;
    background: #fef3f2;
    font-size: 1.15rem;
    place-items: center;
}

.role-section-icon-blue {
    color: #175cd3;
    background: #eff6ff;
}

.role-required {
    margin-left: 0.15rem;
    color: #d92d20;
}

.role-form-section .form-label {
    margin-bottom: 0.4rem;
    color: #344054;
    font-size: 0.76rem;
    font-weight: 650;
}

.role-form-section .form-text {
    display: block;
    margin-top: 0.35rem;
    color: #98a2b3;
    font-size: 0.68rem;
}

.role-selection-count {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    color: #475467;
    background: #f2f4f7;
    font-size: 0.68rem;
    font-weight: 650;
}

.role-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.role-permission-card {
    padding: 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    background: #fafbfc;
}

.role-permission-card-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.role-permission-card-heading strong,
.role-permission-card-heading small {
    display: block;
}

.role-permission-card-heading strong {
    color: #1d2939;
    font-size: 0.8rem;
}

.role-permission-card-heading small,
.role-permission-card-heading > span {
    color: #98a2b3;
    font-size: 0.65rem;
}

.role-permission-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.role-permission-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-permission-option span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.52rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.45rem;
    color: #475467;
    background: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.role-permission-option span i {
    display: none;
}

.role-permission-option input:checked + span {
    border-color: #f3a49a;
    color: #9f1f13;
    background: #fff1ee;
}

.role-permission-option input:checked + span i {
    display: inline-block;
}

.role-permission-option input:focus-visible + span {
    outline: 2px solid #84adff;
    outline-offset: 2px;
}

.role-permission-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px dashed #d0d5dd;
    border-radius: 0.7rem;
    color: #98a2b3;
    text-align: center;
}

.role-permission-empty i {
    margin-bottom: 0.4rem;
    font-size: 1.45rem;
}

.role-permission-empty strong,
.role-permission-empty span {
    font-size: 0.72rem;
}

@media (max-width: 991.98px) {
    .role-toolbar,
    .role-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .role-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
    }

    .role-search-field {
        width: auto;
    }
}

@media (max-width: 767.98px) {
    .role-toolbar-actions,
    .role-permission-grid {
        grid-template-columns: 1fr;
    }

    .role-add-button,
    .role-filter-field select {
        width: 100%;
    }

    .role-access-heading {
        align-items: start;
        flex-direction: column;
    }

    .role-datatable-footer {
        align-items: start;
        flex-direction: column;
        gap: 0.75rem;
    }
}
