:root {
    --app-navy-950: #071126;
    --app-navy-900: #0b1739;
    --app-navy-800: #12234c;
    --app-indigo-700: #4338ca;
    --app-indigo-600: #4f46e5;
    --app-indigo-500: #6366f1;
    --app-cyan-500: #06b6d4;
    --app-slate-900: #172033;
    --app-slate-700: #45516a;
    --app-slate-600: #657089;
    --app-slate-500: #8590a5;
    --app-slate-300: #d8deea;
    --app-slate-200: #e8ecf3;
    --app-slate-100: #f2f5f9;
    --app-slate-50: #f7f9fc;
    --app-white: #ffffff;
    --app-success: #059669;
    --app-success-soft: #e8f8f2;
    --app-warning: #c47b08;
    --app-warning-soft: #fff7df;
    --app-danger: #dc3545;
    --app-danger-soft: #fff0f1;
    --app-info: #2563eb;
    --app-sidebar-width: 272px;
    --app-topbar-height: 76px;
    --app-radius-sm: 9px;
    --app-radius: 14px;
    --app-radius-lg: 20px;
    --app-shadow-sm: 0 4px 16px rgba(16, 32, 70, .06);
    --app-shadow: 0 14px 38px rgba(16, 32, 70, .09);
    --bs-primary: var(--app-indigo-600);
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-color: var(--app-slate-900);
    --bs-body-bg: var(--app-slate-50);
    --bs-border-color: var(--app-slate-200);
    --bs-border-radius: var(--app-radius-sm);
    --bs-font-sans-serif: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-slate-900);
    background: var(--app-slate-50);
    font-family: var(--bs-font-sans-serif);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--app-indigo-600);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--app-indigo-700);
}

button,
input,
select,
textarea {
    font: inherit;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 16px;
    color: var(--app-white);
    background: var(--app-navy-950);
    border-radius: var(--app-radius-sm);
    transform: translateY(-150%);
    transition: transform .2s ease;
}

.skip-link:focus {
    color: var(--app-white);
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(6, 182, 212, .4);
    outline-offset: 2px;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--app-radius-sm);
    padding: .58rem 1rem;
    font-weight: 650;
    letter-spacing: -.01em;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    min-height: 34px;
    padding: .36rem .72rem;
    font-size: .8rem;
}

.btn-lg {
    min-height: 52px;
    padding: .75rem 1.2rem;
    font-size: .96rem;
}

.btn-primary {
    --bs-btn-bg: var(--app-indigo-600);
    --bs-btn-border-color: var(--app-indigo-600);
    --bs-btn-hover-bg: var(--app-indigo-700);
    --bs-btn-hover-border-color: var(--app-indigo-700);
    --bs-btn-active-bg: var(--app-indigo-700);
    --bs-btn-active-border-color: var(--app-indigo-700);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .2);
}

.btn-dark {
    --bs-btn-bg: var(--app-navy-900);
    --bs-btn-border-color: var(--app-navy-900);
    --bs-btn-hover-bg: var(--app-navy-800);
    --bs-btn-hover-border-color: var(--app-navy-800);
}

.btn-light {
    --bs-btn-bg: var(--app-white);
    --bs-btn-border-color: var(--app-slate-200);
    --bs-btn-hover-bg: var(--app-slate-100);
    --bs-btn-hover-border-color: var(--app-slate-300);
    --bs-btn-color: var(--app-slate-700);
    --bs-btn-hover-color: var(--app-slate-900);
}

.form-control,
.form-select {
    min-height: 44px;
    color: var(--app-slate-900);
    background-color: var(--app-white);
    border-color: var(--app-slate-300);
    border-radius: var(--app-radius-sm);
    box-shadow: none;
    font-size: .9rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control-lg {
    min-height: 52px;
    padding: .75rem .95rem;
    font-size: .95rem;
}

.form-control::placeholder {
    color: #9aa4b7;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-indigo-500);
    box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .12);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--app-danger);
}

.form-label {
    margin-bottom: .45rem;
    color: #354158;
    font-size: .84rem;
    font-weight: 680;
}

.form-label span {
    color: var(--app-danger);
}

.form-hint {
    display: block;
    margin-top: .45rem;
    color: var(--app-slate-600);
    font-size: .76rem;
    line-height: 1.45;
}

.invalid-feedback,
.field-error {
    color: #c92a3b;
    font-size: .77rem;
    font-weight: 550;
}

.dropdown-menu {
    padding: .45rem;
    border-color: var(--app-slate-200);
    border-radius: 12px;
    box-shadow: var(--app-shadow);
}

.dropdown-item {
    padding: .57rem .7rem;
    color: var(--app-slate-700);
    border-radius: 7px;
    font-size: .84rem;
    font-weight: 550;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--app-slate-900);
    background: var(--app-slate-100);
}

.dropdown-menu form {
    margin: 0;
}

.dropdown-menu form .dropdown-item {
    width: 100%;
    text-align: left;
    background-color: transparent;
    border: 0;
}

.dropdown-menu form .dropdown-item:hover,
.dropdown-menu form .dropdown-item:focus {
    background: var(--app-slate-100);
}

.app-body {
    overflow-x: hidden;
}

.app-sidebar {
    --bs-offcanvas-width: var(--app-sidebar-width);
    width: var(--app-sidebar-width) !important;
    color: rgba(255, 255, 255, .78);
    background:
        radial-gradient(circle at -20% 15%, rgba(99, 102, 241, .35), transparent 36%),
        linear-gradient(160deg, var(--app-navy-900) 0%, var(--app-navy-950) 100%);
    border: 0;
}

.sidebar-inner {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    overflow: hidden;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--app-white);
    text-decoration: none;
}

.brand:hover {
    color: var(--app-white);
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    color: var(--app-white);
    background: linear-gradient(145deg, var(--app-indigo-500), var(--app-cyan-500));
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(6, 182, 212, .16);
    font-size: 1.05rem;
    font-weight: 800;
}

.brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--app-white);
    font-size: .96rem;
    font-weight: 730;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    color: rgba(255, 255, 255, .48);
    font-size: .68rem;
    letter-spacing: .025em;
}

.sidebar-mobile-header {
    padding: 20px 18px 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 42px;
    margin-right: -8px;
    padding-right: 8px;
    padding-bottom: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: rgba(129, 140, 248, .42) rgba(255, 255, 255, .05);
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .045);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, .38);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, .58);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 45px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, .68);
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 560;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease;
}

.sidebar-link:hover {
    color: var(--app-white);
    background: rgba(255, 255, 255, .07);
}

.sidebar-link.active {
    color: var(--app-white);
    background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(6, 182, 212, .1));
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .15);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -18px;
    width: 3px;
    height: 24px;
    background: var(--app-cyan-500);
    border-radius: 0 4px 4px 0;
}

.nav-symbol {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .05em;
}

.sidebar-link.active .nav-symbol {
    color: #dffbff;
    background: rgba(6, 182, 212, .14);
    border-color: rgba(6, 182, 212, .2);
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
    margin: 2px 0 8px 52px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-subnav a {
    display: block;
    padding: 5px 8px;
    color: rgba(255, 255, 255, .62);
    border-radius: 8px;
    font-size: .76rem;
    font-weight: 650;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease;
}

.sidebar-subnav a:hover {
    color: var(--app-white);
    background: rgba(255, 255, 255, .06);
}

.sidebar-subnav a.active {
    color: var(--app-white);
    background: rgba(99, 102, 241, .24);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .18);
}

.sidebar-subnav a.active::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    vertical-align: 1px;
    background: var(--app-cyan-500);
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .1);
}

.sidebar-section {
    margin: 27px 12px 7px;
    color: rgba(255, 255, 255, .34);
    font-size: .61rem;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sidebar-account {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
}

.sidebar-account .status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    background: #34d399;
    border: 2px solid rgba(52, 211, 153, .25);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .08);
}

.sidebar-account div {
    display: flex;
    flex-direction: column;
}

.sidebar-account strong {
    color: rgba(255, 255, 255, .78);
    font-size: .7rem;
    font-weight: 650;
}

.sidebar-account small {
    color: rgba(255, 255, 255, .38);
    font-size: .62rem;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--app-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--app-slate-200);
    backdrop-filter: blur(14px);
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-context {
    display: flex;
    flex-direction: column;
}

.topbar-context small {
    color: var(--app-slate-500);
    font-size: .64rem;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.topbar-context strong {
    color: var(--app-slate-900);
    font-size: .86rem;
    font-weight: 680;
}

.menu-toggle {
    width: 42px;
    min-height: 42px;
    padding: 10px;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--app-slate-200);
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    background: var(--app-slate-700);
    border-radius: 2px;
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    color: var(--app-slate-900);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    text-align: left;
    transition: background-color .18s ease, border-color .18s ease;
}

.account-menu:hover,
.account-menu[aria-expanded="true"] {
    background: var(--app-slate-100);
    border-color: var(--app-slate-200);
}

.account-avatar,
.table-avatar {
    display: grid;
    place-items: center;
    color: var(--app-indigo-700);
    background: #eeefff;
    border: 1px solid #dddefe;
    border-radius: 10px;
    font-weight: 750;
}

.account-avatar {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    font-size: .83rem;
}

.account-copy {
    max-width: 180px;
    flex-direction: column;
}

.account-copy strong {
    overflow: hidden;
    font-size: .78rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    overflow: hidden;
    color: var(--app-slate-500);
    font-size: .65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chevron {
    color: var(--app-slate-500);
}

.account-dropdown {
    min-width: 235px;
}

.account-dropdown-head {
    display: flex;
    flex-direction: column;
    padding: .55rem .7rem;
}

.account-dropdown-head strong {
    font-size: .8rem;
}

.account-dropdown-head small {
    overflow: hidden;
    color: var(--app-slate-500);
    font-size: .7rem;
    text-overflow: ellipsis;
}

.app-main {
    width: 100%;
    max-width: 1580px;
    flex: 1;
    margin: 0 auto;
    padding: 12px 30px 44px !important;
    align-content: flex-start;
}

.app-main:focus {
    outline: none;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 30px;
    color: var(--app-slate-500);
    border-top: 1px solid var(--app-slate-200);
    font-size: .68rem;
}

.flash-stack {
    display: none;
    gap: 10px;
    margin-bottom: 0;
}

.flash-stack.has-visible-alert,
.flash-stack:has(.app-alert.show) {
    display: grid;
    margin-bottom: 22px;
}

.app-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 0;
    padding: .85rem 2.7rem .85rem .9rem;
    border-radius: 11px;
    font-size: .82rem;
}

.alert-symbol {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .7rem;
    font-weight: 800;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-top: 0;
    margin-bottom: 18px;
}

.page-heading h1 {
    margin: 5px 0 7px;
    color: var(--app-slate-900);
    font-size: clamp(1.65rem, 3vw, 2.05rem);
    font-weight: 760;
    letter-spacing: -.04em;
}

.page-heading p {
    max-width: 700px;
    margin: 0;
    color: var(--app-slate-600);
    font-size: .88rem;
    line-height: 1.65;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.eyebrow,
.panel-kicker {
    color: var(--app-indigo-600);
    font-size: .65rem;
    font-weight: 780;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.panel {
    background: var(--app-white);
    border: 1px solid var(--app-slate-200);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.panel-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 21px;
    border-bottom: 1px solid var(--app-slate-200);
}

.panel-header h2,
.filter-head h2 {
    margin: 2px 0 0;
    color: var(--app-slate-900);
    font-size: 1rem;
    font-weight: 710;
    letter-spacing: -.02em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--app-white);
    border: 1px solid var(--app-slate-200);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.stat-icon,
.quick-symbol,
.access-intro-icon {
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .05em;
}

.stat-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
}

.tone-indigo {
    color: var(--app-indigo-700);
    background: #edecff;
}

.tone-cyan {
    color: #087c91;
    background: #e1f8fc;
}

.tone-violet {
    color: #7c3aed;
    background: #f3eaff;
}

.tone-slate {
    color: var(--app-slate-700);
    background: var(--app-slate-100);
}

.stat-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stat-content span {
    overflow: hidden;
    color: var(--app-slate-600);
    font-size: .72rem;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-content strong {
    margin-top: 3px;
    color: var(--app-slate-900);
    font-size: 1.55rem;
    font-weight: 760;
    letter-spacing: -.04em;
}

.content-grid {
    display: grid;
    gap: 20px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr);
}

.quick-list {
    display: grid;
    padding: 8px 13px 14px;
}

.quick-list a {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 8px;
    color: var(--app-slate-700);
    border-bottom: 1px solid var(--app-slate-100);
    text-decoration: none;
}

.quick-list a:last-child {
    border-bottom: 0;
}

.quick-list a:hover strong {
    color: var(--app-indigo-600);
}

.quick-symbol {
    width: 39px;
    height: 39px;
    color: var(--app-indigo-600);
    background: #f0efff;
}

.quick-list a > span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.quick-list strong {
    font-size: .78rem;
    font-weight: 650;
}

.quick-list small {
    overflow: hidden;
    color: var(--app-slate-500);
    font-size: .67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-panel {
    margin-bottom: 20px;
    padding: 20px;
}

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.clear-filter {
    font-size: .75rem;
    font-weight: 650;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(145px, .7fr)) auto;
    gap: 10px;
}

.results-count {
    padding: 5px 9px;
    color: var(--app-slate-600);
    background: var(--app-slate-100);
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 650;
}

.app-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-slate-700);
    min-width: 760px;
}

.app-table thead th {
    padding: 11px 18px;
    color: var(--app-slate-500);
    background: #fafbfc;
    border-color: var(--app-slate-200);
    font-size: .62rem;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table tbody td {
    padding: 14px 18px;
    border-color: var(--app-slate-100);
    font-size: .78rem;
    vertical-align: middle;
}

.app-table tbody tr {
    transition: background-color .18s ease;
}

.app-table tbody tr:hover {
    background: #fbfcff;
}

.app-table .row-muted {
    background: #fafbfc;
}

.app-table .row-muted > td:not(:last-child) {
    opacity: .75;
}

.user-cell {
    min-width: 195px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    font-size: .72rem;
}

.user-cell > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-cell strong {
    overflow: hidden;
    max-width: 230px;
    color: var(--app-slate-900);
    font-size: .79rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-cell small {
    overflow: hidden;
    max-width: 230px;
    color: var(--app-slate-500);
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-badge,
.system-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: .65rem;
    font-weight: 650;
    white-space: nowrap;
}

.role-badge {
    color: #4c42bd;
    background: #f0efff;
}

.cell-primary {
    color: var(--app-slate-700);
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: .65rem;
    font-weight: 680;
    white-space: nowrap;
}

.status-badge > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.is-active {
    color: #047857;
    background: var(--app-success-soft);
}

.status-badge.is-active > span {
    background: #10b981;
}

.status-badge.is-inactive {
    color: #8a5a08;
    background: var(--app-warning-soft);
}

.status-badge.is-inactive > span {
    background: #f59e0b;
}

.status-badge.is-archived {
    color: var(--app-slate-600);
    background: var(--app-slate-100);
}

.status-badge.is-archived > span {
    background: var(--app-slate-500);
}

.btn-action {
    width: 35px;
    min-height: 34px;
    padding: 0;
    color: var(--app-slate-600);
    background: transparent;
    border: 1px solid transparent;
    letter-spacing: 1px;
}

.btn-action:hover,
.btn-action[aria-expanded="true"] {
    color: var(--app-slate-900);
    background: var(--app-slate-100);
    border-color: var(--app-slate-200);
}

.table-actions .dropdown-menu {
    min-width: 195px;
}
.table-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 360px;
}

.table-inline-actions form {
    display: inline-flex;
    margin: 0;
}

.btn-row-action {
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid var(--app-slate-200);
    border-radius: 12px;
    color: var(--app-slate-700);
    background: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.btn-row-action:hover,
.btn-row-action:focus {
    color: var(--app-primary);
    border-color: rgba(79, 70, 229, .35);
    background: var(--app-primary-soft);
}

.btn-row-action.is-success {
    color: #047857;
    border-color: rgba(16, 185, 129, .25);
    background: #ecfdf5;
}

.btn-row-action.is-warning {
    color: #92400e;
    border-color: rgba(245, 158, 11, .28);
    background: #fffbeb;
}

.btn-row-action.is-neutral {
    color: var(--app-slate-600);
    background: var(--app-slate-50);
}

.btn-row-action.is-danger {
    color: #dc2626;
    border-color: rgba(239, 68, 68, .25);
    background: #fff5f5;
}

.table-pagination {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 18px;
    border-top: 1px solid var(--app-slate-200);
}

.table-pagination p {
    margin: 0;
    color: var(--app-slate-500);
    font-size: .7rem;
}

.table-pagination p strong {
    color: var(--app-slate-700);
}

.page-link {
    min-width: 32px;
    color: var(--app-slate-700);
    border-color: var(--app-slate-200);
    text-align: center;
}

.active > .page-link,
.page-link.active {
    background: var(--app-indigo-600);
    border-color: var(--app-indigo-600);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 22px;
    text-align: center;
}

.empty-state.compact {
    padding: 42px 22px;
}

.empty-symbol {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    color: var(--app-indigo-600);
    background: #f0efff;
    border: 1px solid #e2e0ff;
    border-radius: 15px;
    font-size: .7rem;
    font-weight: 800;
}

.empty-state h2,
.empty-state h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
}

.empty-state p {
    max-width: 430px;
    margin: 0 0 17px;
    color: var(--app-slate-600);
    font-size: .8rem;
    line-height: 1.55;
}

.app-modal {
    padding: 7px;
    border: 0;
    border-radius: 17px;
    box-shadow: 0 24px 80px rgba(7, 17, 38, .2);
}

.app-modal .modal-header {
    align-items: flex-start;
    padding-bottom: 0;
}

.modal-symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--app-danger);
    background: var(--app-danger-soft);
    border-radius: 12px;
    font-weight: 800;
}

.app-modal .modal-body {
    padding-top: 12px;
}

.app-modal .modal-title {
    margin-bottom: 8px;
    font-weight: 720;
    letter-spacing: -.02em;
}

.app-modal .modal-body p {
    margin: 0;
    color: var(--app-slate-600);
    font-size: .84rem;
    line-height: 1.6;
}

.form-page-heading {
    align-items: flex-start;
    min-height: 0;
}

.app-main > .form-page-heading {
    margin-top: 0 !important;
    margin-bottom: 22px !important;
}

.app-main > .role-page-heading {
    margin-bottom: 18px !important;
}

.app-main > .dashboard-page-heading,
.app-main > .list-page-heading {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
}

.flash-stack + .page-heading {
    margin-top: 0 !important;
}

.flash-stack + .form-page-heading {
    margin-bottom: 22px !important;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 18px;
    color: var(--app-slate-600);
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link span {
    font-size: 1.2rem;
    line-height: .5;
}

.validation-summary {
    margin: 0 0 12px;
    padding: .72rem .9rem;
    min-height: 0;
}

.validation-summary:not(:has(li)),
.validation-summary:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.validation-summary strong {
    display: block;
    margin-bottom: 3px;
    font-size: .78rem;
}

.validation-summary ul {
    margin: 0;
    padding-left: 16px;
    font-size: .74rem;
    line-height: 1.45;
}

.form-validation-summary {
    margin: 0 0 18px;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 20px;
}

.form-main,
.form-aside {
    display: grid;
    gap: 20px;
}

.form-section {
    padding: 16px 20px;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--app-slate-200);
}

.section-number {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    color: var(--app-indigo-600);
    background: #f0efff;
    border-radius: 9px;
    font-size: .62rem;
    font-weight: 800;
}

.form-section-head h2,
.form-side-card h2 {
    margin: 0 0 3px;
    color: var(--app-slate-900);
    font-size: .98rem;
    font-weight: 710;
    letter-spacing: -.02em;
}

.form-section-head p,
.form-side-card p {
    margin: 0;
    color: var(--app-slate-600);
    font-size: .75rem;
    line-height: 1.5;
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
    margin: -6px 0 10px 44px;
}

.sidebar-subnav a {
    color: rgba(226, 232, 240, .74);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.35;
    padding: 4px 0;
}

.sidebar-subnav a:hover,
.sidebar-subnav a:focus {
    color: #fff;
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field .form-control {
    padding-right: 72px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 3;
    padding: 5px 7px;
    color: var(--app-indigo-600);
    background: var(--app-white);
    border: 0;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
    transform: translateY(-50%);
}

.form-side-card {
    padding: 21px;
}

.form-side-card .panel-kicker {
    display: block;
    margin-bottom: 6px;
}

.form-side-card p {
    margin-bottom: 18px;
}

.status-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    background: var(--app-slate-50);
    border: 1px solid var(--app-slate-200);
    border-radius: 10px;
}

.status-switch .form-check-input {
    width: 2.25em;
    margin: 0;
}

.status-switch .form-check-label {
    display: flex;
    flex-direction: column;
}

.status-switch strong {
    font-size: .76rem;
}

.status-switch small {
    color: var(--app-slate-500);
    font-size: .65rem;
}

.role-status-switch {
    max-width: 330px;
}

.role-color {
    width: 100%;
    min-width: 64px;
    padding: 5px;
}

.security-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 17px;
    color: #185c68;
    background: #effbfc;
    border: 1px solid #d5f3f6;
    border-radius: var(--app-radius);
}

.security-card > span {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    border: 1px solid #7dd3dc;
    border-radius: 50%;
    font-size: .67rem;
    font-weight: 800;
}

.security-card strong {
    display: block;
    margin-bottom: 3px;
    font-size: .75rem;
}

.security-card p {
    margin: 0;
    color: #48737b;
    font-size: .67rem;
    line-height: 1.5;
}

.module-groups {
    display: grid;
    gap: 1.35rem;
}

.module-group h3 {
    margin-bottom: .85rem;
    color: var(--app-slate-500);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.module-option {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
    min-height: 96px;
    padding: 1rem;
    background: #f8fbff;
    border: 1px solid var(--app-slate-200);
    border-radius: 18px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.module-option:hover {
    border-color: rgba(79, 70, 229, .28);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.module-option.is-core {
    background: linear-gradient(135deg, #f8fbff 0%, #eefeff 100%);
}

.module-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--app-indigo-600);
    background: #eeecff;
    border: 1px solid #dfdbff;
    border-radius: 14px;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.module-option-content {
    display: grid;
    gap: .25rem;
}

.module-option-content strong {
    color: var(--app-slate-900);
    font-size: .98rem;
}

.module-option-content small,
.module-option-content em {
    color: var(--app-slate-600);
    font-size: .82rem;
    font-style: normal;
    line-height: 1.45;
}

.module-option-content em {
    color: var(--app-indigo-600);
    font-weight: 800;
}

.form-actions-bar {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding: 13px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--app-slate-200);
    border-radius: 13px;
    box-shadow: 0 10px 28px rgba(16, 32, 70, .1);
    backdrop-filter: blur(12px);
}

.access-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 17px 20px;
    color: #1e3a5f;
    background: linear-gradient(100deg, #eef4ff, #f1fbfd);
    border: 1px solid #dce9f7;
    border-radius: var(--app-radius);
}

.access-intro-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    color: var(--app-indigo-600);
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(99, 102, 241, .12);
}

.access-intro > div:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.access-intro strong {
    font-size: .82rem;
}

.access-intro p {
    margin: 2px 0 0;
    color: #58708d;
    font-size: .72rem;
}

.access-count {
    margin-left: auto;
    padding: 6px 10px;
    color: var(--app-indigo-700);
    background: rgba(255, 255, 255, .7);
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 650;
    white-space: nowrap;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.role-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: var(--app-white);
    border: 1px solid var(--app-slate-200);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.role-card:hover {
    border-color: #d7d8f8;
    box-shadow: var(--app-shadow);
    transform: translateY(-2px);
}

.role-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.role-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.role-inline-actions form {
    display: inline-flex;
    margin: 0;
}

.role-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.role-avatar.tone-1 {
    color: #4338ca;
    background: #eeefff;
}

.role-avatar.tone-2 {
    color: #087c91;
    background: #e4f8fb;
}

.role-avatar.tone-3 {
    color: #7c3aed;
    background: #f3eaff;
}

.role-avatar.tone-4 {
    color: #b45309;
    background: #fff4dc;
}

.role-card-body {
    min-height: 105px;
    padding: 17px 1px 12px;
}

.role-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.role-title-row h2 {
    margin: 0;
    color: var(--app-slate-900);
    font-size: .96rem;
    font-weight: 710;
    letter-spacing: -.02em;
}

.system-badge {
    color: #58708d;
    background: var(--app-slate-100);
    font-size: .58rem;
}

.role-card-body p {
    display: -webkit-box;
    overflow: hidden;
    margin: 7px 0 0;
    color: var(--app-slate-600);
    font-size: .72rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.role-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-top: auto;
    padding: 13px 0;
    border-top: 1px solid var(--app-slate-100);
    border-bottom: 1px solid var(--app-slate-100);
}

.role-metrics div {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
}

.role-metrics div:first-child {
    padding-left: 1px;
    border-right: 1px solid var(--app-slate-200);
}

.role-metrics strong {
    font-size: .95rem;
    font-weight: 720;
}

.role-metrics span {
    color: var(--app-slate-500);
    font-size: .63rem;
}

.role-edit-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 13px;
    font-size: .72rem;
    font-weight: 650;
    text-decoration: none;
}

.role-form {
    display: grid;
    gap: 20px;
}

.role-form .form-actions-bar {
    margin-top: 0;
}

.permission-head {
    align-items: center;
}

.permission-head > div:nth-child(2) {
    flex: 1;
}

.permission-global-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.permission-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.permission-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    background: #fbfcfe;
    border: 1px solid var(--app-slate-200);
    border-radius: 12px;
}

.permission-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 15px;
    border-bottom: 1px solid var(--app-slate-200);
}

.permission-group-head > span:first-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.permission-group-head strong {
    color: var(--app-slate-900);
    font-size: .76rem;
    font-weight: 680;
}

.permission-group-head small {
    overflow: hidden;
    max-width: 270px;
    color: var(--app-slate-500);
    font-size: .61rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--app-indigo-600);
    font-size: .62rem;
    font-weight: 650;
    white-space: nowrap;
}

.permission-list {
    display: grid;
    padding: 8px;
}

.permission-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 10px 9px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .16s ease;
}

.permission-item:hover {
    background: var(--app-white);
}

.permission-item .form-check-input {
    margin: 2px 0 0;
}

.permission-item > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.permission-item strong {
    color: var(--app-slate-700);
    font-size: .72rem;
    font-weight: 620;
}

.permission-item small {
    color: var(--app-slate-500);
    font-size: .62rem;
    line-height: 1.45;
}

.selection-summary {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-right: auto;
    color: var(--app-slate-500);
    font-size: .7rem;
}

.selection-summary strong {
    color: var(--app-indigo-600);
    font-size: .9rem;
}

.error-page {
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: clamp(30px, 8vh, 100px) auto;
    padding: 20px;
    text-align: center;
}

.error-code {
    margin-bottom: 12px;
    color: transparent;
    background: linear-gradient(110deg, var(--app-indigo-600), var(--app-cyan-500));
    -webkit-background-clip: text;
    background-clip: text;
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 850;
    letter-spacing: -.08em;
    line-height: .9;
    opacity: .22;
}

.error-page h1 {
    max-width: 650px;
    margin: 9px 0 10px;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 750;
    letter-spacing: -.04em;
}

.error-page > p {
    max-width: 560px;
    margin: 0;
    color: var(--app-slate-600);
    font-size: .87rem;
    line-height: 1.7;
}

.error-page .request-id {
    margin-top: 12px;
    padding: 6px 10px;
    background: var(--app-slate-100);
    border-radius: 7px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .68rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
}

.auth-body {
    color: var(--app-slate-900);
    background: var(--app-white);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, .92fr) minmax(480px, 1.08fr);
}

.auth-panel {
    min-width: 0;
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    color: var(--app-white);
    background:
        radial-gradient(circle at 12% 18%, rgba(99, 102, 241, .45), transparent 30%),
        radial-gradient(circle at 90% 85%, rgba(6, 182, 212, .17), transparent 30%),
        linear-gradient(150deg, var(--app-navy-800), var(--app-navy-950));
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
}

.auth-brand-panel::before {
    right: -160px;
    bottom: -160px;
    width: 420px;
    height: 420px;
}

.auth-brand-panel::after {
    right: -65px;
    bottom: -65px;
    width: 230px;
    height: 230px;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(32px, 5vw, 68px);
}

.brand-auth {
    align-self: flex-start;
}

.auth-message {
    max-width: 530px;
    margin: auto 0;
    padding: 80px 0;
}

.eyebrow.light {
    color: #66d9ea;
}

.auth-message h1 {
    margin: 14px 0 17px;
    color: var(--app-white);
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 780;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.auth-message p {
    max-width: 480px;
    margin: 0;
    color: rgba(255, 255, 255, .59);
    font-size: clamp(.9rem, 1.5vw, 1.03rem);
    line-height: 1.75;
}

.auth-trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-trust > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 11px;
}

.auth-trust > div > span {
    color: #62d9e9;
    font-size: .65rem;
    font-weight: 800;
}

.auth-trust p {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.auth-trust strong {
    color: rgba(255, 255, 255, .82);
    font-size: .68rem;
}

.auth-trust small {
    color: rgba(255, 255, 255, .36);
    font-size: .57rem;
}

.auth-form-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 90% 5%, rgba(99, 102, 241, .055), transparent 22%),
        var(--app-white);
}

.auth-form-wrap {
    width: min(100%, 430px);
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h2 {
    margin: 7px 0 7px;
    color: var(--app-slate-900);
    font-size: 1.8rem;
    font-weight: 760;
    letter-spacing: -.04em;
}

.auth-heading p {
    margin: 0;
    color: var(--app-slate-600);
    font-size: .85rem;
}

.auth-form {
    display: grid;
    gap: 19px;
}

.form-field {
    min-width: 0;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-check {
    color: var(--app-slate-600);
    font-size: .75rem;
}

.auth-check .form-check-input {
    margin-top: .12em;
}

.form-check-input:checked {
    background-color: var(--app-indigo-600);
    border-color: var(--app-indigo-600);
}

.auth-submit {
    margin-top: 2px;
}

.auth-security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    padding: 12px 13px;
    color: #2f5f67;
    background: #f1fbfc;
    border: 1px solid #d9f2f5;
    border-radius: 10px;
}

.auth-security-note > span {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    color: #087c91;
    border: 1px solid #8edce6;
    border-radius: 50%;
    font-size: .68rem;
    font-weight: 800;
}

.auth-security-note p {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.auth-security-note strong {
    font-size: .71rem;
}

.auth-security-note small {
    color: #65838a;
    font-size: .62rem;
}

.auth-copyright {
    margin: 28px 0 0;
    color: var(--app-slate-500);
    font-size: .63rem;
    text-align: center;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1030;
        transform: none !important;
        visibility: visible !important;
    }

    .app-shell {
        margin-left: var(--app-sidebar-width);
    }
}

@media (max-width: 1199.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sidebar-inner {
        height: 100vh;
        min-height: 0;
        padding-top: 8px;
    }

    .sidebar-nav {
        margin-top: 25px;
    }

    .app-main {
        padding: 26px 22px 38px;
    }

    .app-topbar {
        padding: 0 22px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-layout {
        grid-template-columns: 1fr;
    }

    .form-aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-shell {
        grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr);
    }

    .auth-brand-content {
        padding: 35px;
    }

    .auth-trust {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .auth-shell {
        display: block;
    }

    .auth-brand-panel {
        min-height: 205px;
    }

    .auth-brand-content {
        min-height: 205px;
        padding: 26px;
    }

    .auth-message {
        margin: auto 0 0;
        padding: 32px 0 0;
    }

    .auth-message h1 {
        margin: 8px 0 5px;
        font-size: 1.75rem;
    }

    .auth-message p,
    .auth-trust {
        display: none;
    }

    .auth-form-panel {
        min-height: calc(100vh - 205px);
        place-items: start center;
        padding: 34px 22px;
    }

    .app-topbar {
        min-height: 66px;
        padding: 0 15px;
    }

    .app-main {
        padding: 23px 15px 34px;
    }

    .app-footer {
        padding: 16px 15px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 22px;
    }

    .page-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
        padding: 16px;
    }

    .stat-icon {
        width: 37px;
        height: 37px;
        flex-basis: 37px;
    }

    .stat-content span {
        white-space: normal;
    }

    .stat-content strong {
        font-size: 1.35rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }

    .filter-panel {
        padding: 16px;
    }

    .table-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .role-grid,
    .permission-groups {
        grid-template-columns: 1fr;
    }

    .access-intro {
        align-items: flex-start;
    }

    .access-count {
        display: none;
    }

    .form-aside {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 18px;
    }

    .permission-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .permission-global-actions {
        width: 100%;
        padding-left: 47px;
    }

    .form-actions-bar {
        flex-wrap: wrap;
    }

    .selection-summary {
        width: 100%;
        order: -1;
    }
}

@media (max-width: 479.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        align-items: center;
        flex-direction: row;
    }

    .app-footer {
        flex-direction: column;
        gap: 3px;
    }

    .panel-header {
        align-items: flex-start;
        min-height: auto;
    }

    .form-actions-bar .btn {
        flex: 1;
    }

    .permission-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .error-actions {
        width: 100%;
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }
}

.versioning-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 16px;
    padding: 14px 18px;
    border: 1px solid rgba(79, 70, 229, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
    backdrop-filter: blur(16px);
}

.versioning-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--text);
}

.versioning-copy strong {
    font-size: .92rem;
}

.versioning-copy span {
    color: var(--muted);
    font-size: .78rem;
}

.versioning-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.deploy-progress {
    height: 16px;
    border-radius: 999px;
    background: #eef2ff;
}

.deploy-progress .progress-bar {
    font-size: .72rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
}

.deploy-log {
    overflow: auto;
    max-height: 280px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #071229;
    color: #dbeafe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .78rem;
}

.deploy-log-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.deploy-log-line.success {
    color: #86efac;
}

.deploy-log-line.danger {
    color: #fca5a5;
}

.maintenance-heading {
    align-items: flex-start;
}

.maintenance-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.maintenance-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: 18px;
    margin-bottom: 20px;
}

.maintenance-hero-card {
    position: relative;
    overflow: hidden;
    min-height: 265px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--app-white);
    border: 1px solid var(--app-slate-200);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
}

.maintenance-hero-card::after {
    content: "";
    position: absolute;
    inset: auto -70px -100px auto;
    width: 230px;
    height: 230px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(79, 70, 229, .14), rgba(79, 70, 229, 0) 66%);
    pointer-events: none;
}

.deploy-card {
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, .28), transparent 36%),
        linear-gradient(135deg, #0b1739 0%, #17235d 52%, #4f46e5 100%);
    border-color: rgba(255, 255, 255, .16);
}

.deploy-card .eyebrow,
.deploy-card p {
    color: rgba(255, 255, 255, .72);
}

.maintenance-hero-card h2 {
    max-width: 620px;
    margin: 0;
    color: inherit;
    font-size: clamp(1.55rem, 2.5vw, 2.25rem);
    font-weight: 780;
    letter-spacing: -.05em;
}

.maintenance-hero-card p {
    max-width: 680px;
    margin: 0;
    color: var(--app-slate-600);
    font-size: .88rem;
    line-height: 1.6;
}

.maintenance-hero-lead {
    margin-top: auto;
    font-size: .98rem !important;
}

.maintenance-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.maintenance-icon,
.maintenance-file-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 13px;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.maintenance-icon.is-primary,
.maintenance-icon.is-indigo {
    color: #4338ca;
    background: #eeefff;
}

.maintenance-icon.is-cyan {
    color: #087c91;
    background: #e4f8fb;
}

.maintenance-icon.is-purple {
    color: #7c3aed;
    background: #f3eaff;
}

.maintenance-icon.is-amber {
    color: #b45309;
    background: #fff4dc;
}

.deploy-card .maintenance-icon.is-primary {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .18);
}

.maintenance-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.maintenance-steps span {
    padding: 9px 10px;
    color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 750;
    text-align: center;
}

.maintenance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: auto;
}

.backup-summary-card {
    min-height: 0;
    gap: 14px;
}

.backup-summary-card .maintenance-summary-grid {
    margin-top: 0;
}

.maintenance-summary-grid div {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--app-slate-200);
    border-radius: 15px;
}

.maintenance-summary-grid small,
.maintenance-cleanup-count span {
    display: block;
    color: var(--app-slate-500);
    font-size: .66rem;
    font-weight: 680;
}

.maintenance-summary-grid strong {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    color: var(--app-slate-900);
    font-size: .86rem;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.maintenance-section-title {
    align-items: flex-start;
    margin-bottom: 18px;
}

.maintenance-table {
    min-width: 900px;
}

.maintenance-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.maintenance-file-icon {
    width: 36px;
    height: 36px;
    color: #4338ca;
    background: #eeefff;
    font-size: .58rem;
}

.maintenance-name-cell strong {
    overflow: hidden;
    color: var(--app-slate-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.maintenance-actions-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.maintenance-cleanup-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.maintenance-cleanup-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--app-slate-200);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .035);
}

.maintenance-cleanup-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.maintenance-cleanup-copy strong {
    color: var(--app-slate-900);
    font-size: .88rem;
    font-weight: 780;
}

.maintenance-cleanup-copy small {
    overflow: hidden;
    color: var(--app-slate-500);
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.maintenance-cleanup-count {
    grid-column: 1 / -1;
    padding: 8px 12px;
    min-width: 86px;
    background: #f8fafc;
    border: 1px solid var(--app-slate-200);
    border-radius: 13px;
    text-align: center;
}

.maintenance-cleanup-count strong {
    display: block;
    color: var(--app-slate-900);
    font-size: 1rem;
    font-weight: 820;
}
.maintenance-cleanup-item form,
.maintenance-cleanup-item .btn {
    grid-column: 1 / -1;
    width: 100%;
}

.diagnostic-box {
    display: grid;
    gap: 16px;
    padding: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid var(--app-slate-200);
    border-radius: 18px;
}

.diagnostic-box h3 {
    margin: 4px 0 4px;
    color: var(--app-slate-900);
    font-size: 1rem;
    font-weight: 800;
}

.diagnostic-box p {
    margin: 0;
    color: var(--app-slate-600);
    font-size: .82rem;
    line-height: 1.55;
}

.readonly-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.database-config-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #ecfeff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    color: var(--app-slate-700);
    font-size: .82rem;
    line-height: 1.5;
}

.database-config-note strong {
    flex: 0 0 auto;
    color: var(--app-slate-900);
    font-weight: 850;
}

.database-config-note code,
.database-access-split code {
    color: #4338ca;
    font-weight: 800;
}

.database-config-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
    gap: 16px;
}

.database-config-card h3 {
    margin: 10px 0 6px;
    color: var(--app-slate-900);
    font-size: 1.08rem;
    font-weight: 850;
    letter-spacing: -.02em;
}

.database-config-card p {
    margin: 0;
    color: var(--app-slate-600);
    font-size: .82rem;
    line-height: 1.5;
}

.database-config-card-featured {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.database-access-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.database-access-split > div {
    padding: 12px;
    background: #fff;
    border: 1px solid var(--app-slate-200);
    border-radius: 14px;
}

.database-access-split strong,
.database-access-split small {
    display: block;
}

.database-access-split strong {
    color: var(--app-slate-900);
    font-size: .78rem;
    font-weight: 850;
}

.database-access-split small {
    margin-top: 5px;
    color: var(--app-slate-600);
    font-size: .74rem;
}

.database-same-target {
    margin-top: 12px;
    padding: 10px 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    color: #047857;
    font-size: .76rem;
    font-weight: 800;
}

.readonly-config-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--app-slate-200);
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.readonly-config-card dl {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.readonly-config-card dl div {
    display: grid;
    grid-template-columns: minmax(90px, .42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.readonly-config-card dt {
    color: var(--app-slate-500);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.readonly-config-card dd {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--app-slate-900);
    font-size: .78rem;
    font-weight: 650;
}

.readonly-config-file {
    overflow-wrap: anywhere;
    margin: 10px 0 0;
    color: var(--app-slate-500);
    font-size: .73rem;
}

.readonly-file-list {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--app-slate-200);
    border-radius: 16px;
}

.readonly-file-list div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 10px;
}

.readonly-file-list strong {
    color: var(--app-slate-700);
    font-size: .76rem;
}

.readonly-file-list code {
    overflow-wrap: anywhere;
    color: #4338ca;
    font-size: .76rem;
}

@media (max-width: 767.98px) {
    .database-config-note,
    .database-config-grid,
    .database-access-split {
        grid-template-columns: 1fr;
    }

    .database-config-note {
        flex-direction: column;
    }

    .versioning-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .versioning-actions,
    .versioning-actions form,
    .versioning-actions .btn {
        width: 100%;
    }

    .maintenance-heading-actions,
    .maintenance-heading-actions form,
    .maintenance-heading-actions .btn {
        width: 100%;
    }

    .maintenance-hero {
        grid-template-columns: 1fr;
    }

    .maintenance-steps,
    .maintenance-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .maintenance-cleanup-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .maintenance-cleanup-count,
    .maintenance-cleanup-item form,
    .maintenance-cleanup-item .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .maintenance-actions-inline {
        width: 100%;
        flex-direction: column;
    }

    .maintenance-actions-inline form,
    .maintenance-actions-inline .btn {
        width: 100%;
    }

    .readonly-config-grid {
        grid-template-columns: 1fr;
    }

    .readonly-config-card dl div,
    .readonly-file-list div {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Submenus administrativos: espa?amento e destaque final */
.sidebar-nav .sidebar-subnav {
    position: relative;
    display: grid;
    gap: 6px;
    margin: 6px 0 14px 8px;
    padding: 4px 0 4px 18px;
    border-left: 1px solid rgba(148, 163, 184, .18);
}

.sidebar-nav .sidebar-subnav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 7px 10px 7px 14px;
    color: rgba(226, 232, 240, .76);
    border-radius: 10px;
    font-size: .79rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.sidebar-nav .sidebar-subnav a:hover,
.sidebar-nav .sidebar-subnav a:focus {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    transform: translateX(1px);
}

.sidebar-nav .sidebar-subnav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(79, 70, 229, .38), rgba(79, 70, 229, .18));
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .24), 0 8px 20px rgba(15, 23, 42, .14);
}

.sidebar-nav .sidebar-subnav a.active::before {
    content: "";
    position: absolute;
    left: -23px;
    width: 8px;
    height: 8px;
    margin: 0;
    background: var(--app-cyan-500);
    border: 2px solid rgba(11, 23, 57, .95);
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .14), 0 0 16px rgba(6, 182, 212, .45);
}


/* ?cones internos do sistema */
.app-icon {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}

.nav-symbol .app-icon {
    width: 15px;
    height: 15px;
}

.stat-icon .app-icon,
.quick-symbol .app-icon,
.access-intro-icon .app-icon {
    width: 21px;
    height: 21px;
}

.section-number .app-icon,
.step-badge .app-icon {
    width: 16px;
    height: 16px;
}

.maintenance-icon .app-icon,
.maintenance-file-icon .app-icon {
    width: 20px;
    height: 20px;
}

.empty-symbol .app-icon {
    width: 24px;
    height: 24px;
}

.sidebar-link.active .nav-symbol .app-icon {
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, .35));
}


.quick-icon .app-icon,
.empty-state-icon .app-icon,
.role-avatar .app-icon {
    width: 20px;
    height: 20px;
}

.role-avatar .app-icon {
    color: currentColor;
}


/* Espa?amento global padr?o do sistema */
:root {
    --space-page-x: clamp(18px, 2.1vw, 34px);
    --space-page-y: clamp(18px, 2vw, 30px);
    --space-section: clamp(18px, 1.8vw, 28px);
    --space-card: clamp(18px, 1.55vw, 24px);
    --space-card-sm: clamp(14px, 1.2vw, 18px);
    --space-grid: clamp(16px, 1.5vw, 24px);
    --space-stack: clamp(14px, 1.25vw, 20px);
}

.app-main {
    padding: var(--space-page-y) var(--space-page-x) 48px !important;
}

.app-main > * + * {
    margin-top: var(--space-section);
}

.page-heading {
    margin-bottom: var(--space-section) !important;
}

.page-heading + *,
.form-page-heading + *,
.list-page-heading + *,
.dashboard-page-heading + *,
.role-page-heading + * {
    margin-top: 0 !important;
}

.content-grid,
.dashboard-grid,
.form-layout,
.form-main,
.form-aside,
.role-grid,
.stats-grid,
.dashboard-stats,
.database-config-grid,
.readonly-config-grid,
.maintenance-grid,
.maintenance-hero,
.permission-groups,
.account-grid,
.integration-grid {
    gap: var(--space-grid) !important;
}

.stats-grid,
.dashboard-stats,
.filter-panel,
.access-intro,
.card-panel,
.panel,
.form-section,
.form-side-card,
.readonly-config-card,
.diagnostic-box,
.database-config-note,
.maintenance-hero-card,
.maintenance-card,
.role-card,
.stat-card,
.empty-state,
.auth-form-card,
.quick-panel {
    margin-block-start: 0;
}

.panel:not(.panel-table):not(.quick-panel):not(.empty-state),
.card-panel,
.form-section,
.form-side-card,
.role-card,
.stat-card,
.readonly-config-card,
.diagnostic-box,
.maintenance-hero-card,
.maintenance-card,
.access-intro,
.filter-panel,
.database-config-note,
.empty-state {
    padding: var(--space-card) !important;
}

.panel-table,
.quick-panel {
    overflow: hidden;
}

.panel-table .table-responsive,
.panel-table .empty-state,
.quick-panel .quick-list {
    margin: 0;
}

.panel-header,
.form-section-head,
.section-title,
.maintenance-card-head,
.role-card-top,
.filter-head,
.permission-head,
.account-card-head,
.diagnostic-box {
    gap: var(--space-stack) !important;
}

.panel-header {
    padding: var(--space-card-sm) var(--space-card) !important;
}

.form-section-head,
.section-title,
.maintenance-section-title {
    margin-bottom: var(--space-card-sm) !important;
    padding-bottom: var(--space-card-sm) !important;
}

.row.g-4 {
    --bs-gutter-x: var(--space-grid);
    --bs-gutter-y: var(--space-stack);
}

.form-label {
    margin-bottom: 8px;
}

.form-control,
.form-select,
.input-group,
.status-switch,
.permission-option,
.readonly-file-list,
.database-access-split,
.quick-item {
    margin-block-start: 0;
}

.form-control,
.form-select {
    min-height: 44px;
}

.form-text,
.invalid-feedback,
.valid-feedback {
    margin-top: 7px;
}

.quick-list {
    gap: 0;
    padding: var(--space-card-sm) !important;
}

.quick-list a,
.quick-item {
    gap: var(--space-card-sm) !important;
    padding: 13px 10px !important;
}

.app-table thead th {
    padding: 13px var(--space-card-sm) !important;
}

.app-table tbody td {
    padding: 16px var(--space-card-sm) !important;
}

.table-responsive {
    border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.modal-content,
.app-modal {
    border-radius: var(--app-radius-lg);
}

.app-modal .modal-header,
.app-modal .modal-body,
.app-modal .modal-footer,
.modal-body,
.modal-footer {
    padding-inline: var(--space-card) !important;
}

.app-modal .modal-header,
.modal-header {
    padding-top: var(--space-card) !important;
    padding-bottom: var(--space-card-sm) !important;
}

.app-modal .modal-body,
.modal-body {
    padding-top: var(--space-card-sm) !important;
    padding-bottom: var(--space-card-sm) !important;
}

.app-modal .modal-footer,
.modal-footer {
    gap: 10px;
    padding-top: var(--space-card-sm) !important;
    padding-bottom: var(--space-card) !important;
}

.form-actions-bar {
    gap: var(--space-stack) !important;
    padding: var(--space-card-sm) var(--space-card) !important;
}

.sidebar-nav {
    gap: 6px;
}

.sidebar-section {
    margin-top: 18px;
    margin-bottom: 8px;
}

.sidebar-link {
    margin-bottom: 2px;
}

.sidebar-nav .sidebar-subnav {
    margin-top: 8px;
    margin-bottom: 16px;
}

@media (max-width: 991.98px) {
    :root {
        --space-page-x: 22px;
        --space-page-y: 22px;
        --space-card: 18px;
        --space-grid: 18px;
    }

    .app-main {
        padding: var(--space-page-y) var(--space-page-x) 40px !important;
    }
}

@media (max-width: 767.98px) {
    :root {
        --space-page-x: 15px;
        --space-page-y: 18px;
        --space-card: 16px;
        --space-grid: 14px;
        --space-stack: 12px;
    }

    .page-heading {
        gap: 14px;
    }

    .panel-header,
    .filter-head,
    .section-title,
    .form-section-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}


/* Corre??o de respiro para cards de resumo e listagens */
.dashboard-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    align-items: stretch;
    gap: var(--space-grid) !important;
}

.dashboard-stats + .dashboard-stats,
.dashboard-stats + .panel,
.dashboard-stats + .content-grid,
.panel + .panel,
.filter-panel + .panel,
.access-intro + .role-grid,
.card-panel + .card-panel,
.form-section + .form-section {
    margin-top: var(--space-grid) !important;
}

.dashboard-stats .stat-card {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    row-gap: 8px;
}

.dashboard-stats .stat-card > div,
.stat-card .stat-content {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.dashboard-stats .stat-card small,
.stat-card .stat-content span,
.stat-card small {
    display: block;
    min-width: 0;
    margin: 0;
    color: var(--app-slate-600);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-stats .stat-card strong,
.stat-card .stat-content strong,
.stat-card strong {
    display: block;
    margin: 0;
    color: var(--app-slate-900);
    font-size: 1rem;
    font-weight: 760;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.stats-grid .stat-card .stat-content strong {
    font-size: 1.55rem;
}

.dashboard-stats a.stat-card strong {
    color: var(--app-indigo-600);
}

.dashboard-stats .stat-card .text-muted,
.dashboard-stats .stat-card span.d-block,
.dashboard-stats .stat-card p {
    display: block;
    margin-top: 2px !important;
    color: var(--app-slate-600) !important;
    font-size: .84rem !important;
    line-height: 1.55;
    white-space: normal;
}

.panel,
.filter-panel,
.panel-table,
.card-panel,
.form-section,
.access-intro,
.role-card,
.stat-card,
.readonly-config-card,
.maintenance-card,
.maintenance-hero-card,
.empty-state {
    max-width: 100%;
}

.page-heading,
.panel-header,
.filter-head,
.section-title {
    min-width: 0;
}

.page-heading > div,
.panel-header > div,
.filter-head > div,
.section-title > div {
    min-width: 0;
}

.page-heading p,
.panel-header p,
.filter-head p,
.section-title p {
    overflow-wrap: anywhere;
}

.user-cell > span,
.user-cell > div,
.account-cell > span,
.account-cell > div {
    min-width: 0;
}

.user-cell small,
.account-cell small,
.app-table small {
    display: block;
    margin-top: 4px;
    color: var(--app-slate-500);
    font-size: .72rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.app-table strong {
    display: inline-block;
    max-width: 100%;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.filter-panel .form-control,
.filter-panel .form-select {
    width: 100%;
}

@media (max-width: 767.98px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-stats .stat-card {
        grid-template-columns: 42px minmax(0, 1fr);
        column-gap: 14px;
    }

    .dashboard-stats .stat-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .page-heading p {
        max-width: 100%;
    }
}


/* Padr?o visual unificado para todas as telas */
.app-main {
    display: block;
}

.app-main > .page-heading:first-child,
.app-main > .form-page-heading:first-child,
.app-main > .dashboard-page-heading:first-child,
.app-main > .list-page-heading:first-child,
.app-main > .role-page-heading:first-child {
    padding-top: 0 !important;
}

.page-heading,
.form-page-heading,
.dashboard-page-heading,
.list-page-heading,
.role-page-heading {
    width: 100%;
    max-width: 100%;
    min-height: 0 !important;
    padding: 0 !important;
}

.page-heading > div:first-child,
.form-page-heading > div:first-child,
.dashboard-page-heading > div:first-child,
.list-page-heading > div:first-child,
.role-page-heading > div:first-child {
    display: grid;
    gap: 8px;
}

.page-heading h1,
.form-page-heading h1,
.dashboard-page-heading h1,
.list-page-heading h1,
.role-page-heading h1 {
    margin: 0 !important;
    line-height: 1.08;
}

.page-heading .eyebrow,
.form-page-heading .eyebrow,
.dashboard-page-heading .eyebrow,
.list-page-heading .eyebrow,
.role-page-heading .eyebrow {
    margin-bottom: 2px;
}

.page-heading p,
.form-page-heading p,
.dashboard-page-heading p,
.list-page-heading p,
.role-page-heading p {
    max-width: 820px;
    margin: 0 !important;
}

.panel,
.card-panel,
.filter-panel,
.form-section,
.form-side-card,
.stat-card,
.role-card,
.access-intro,
.readonly-config-card,
.diagnostic-box,
.maintenance-card,
.maintenance-hero-card,
.empty-state,
.error-page {
    border: 1px solid var(--app-slate-200);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.error-page {
    width: min(100%, 820px);
    margin: 0 auto;
    background: var(--app-white);
    text-align: left;
}

.error-code {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: var(--app-indigo-600);
    background: #f0efff;
    border-radius: 15px;
    font-size: 1.35rem;
}

.error-code .app-icon {
    width: 26px;
    height: 26px;
}

.error-actions,
.page-actions,
.permission-global-actions,
.form-actions-bar,
.table-pagination {
    gap: 10px !important;
}

.empty-state {
    align-items: flex-start;
    text-align: left;
}

.empty-state.compact {
    padding: var(--space-card) !important;
}

.empty-symbol,
.empty-state-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: var(--app-indigo-600);
    background: #f0efff;
    border-radius: 14px;
    flex: 0 0 auto;
}

.card-panel > .empty-state,
.panel > .empty-state {
    margin-top: var(--space-card-sm) !important;
}

.section-title {
    display: flex;
    align-items: flex-start;
}

.step-badge,
.section-number {
    flex: 0 0 auto;
}

.auth-heading {
    display: grid;
    gap: 8px;
    margin-bottom: var(--space-section) !important;
}

.auth-heading h2,
.auth-heading p {
    margin: 0 !important;
}

.auth-form {
    gap: var(--space-stack) !important;
}

.form-field {
    display: grid;
    gap: 8px;
}

.auth-security-note {
    margin-top: var(--space-section) !important;
}

@media (max-width: 767.98px) {
    .page-heading,
    .form-page-heading,
    .dashboard-page-heading,
    .list-page-heading,
    .role-page-heading {
        gap: 16px !important;
    }

    .error-page {
        width: 100%;
    }
}

/* Imagens de usuário e perfil */
.account-avatar,
.table-avatar,
.profile-avatar-preview {
    overflow: hidden;
}

.account-avatar img,
.table-avatar img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.account-dropdown .dropdown-item {
    border-radius: 12px;
    font-weight: 800;
    padding: 10px 14px;
}

.account-dropdown .dropdown-item:hover,
.account-dropdown .dropdown-item:focus {
    background: rgba(79, 70, 229, .09);
    color: var(--primary);
}

.profile-image-section {
    background: linear-gradient(135deg, rgba(79, 70, 229, .055), rgba(6, 182, 212, .045)), #fff;
}

.profile-image-control {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.profile-avatar-preview {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(79, 70, 229, .18), rgba(6, 182, 212, .15));
    color: var(--primary);
    font-size: 2.1rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .14), 0 18px 44px rgba(15, 23, 42, .08);
}

.profile-avatar-fields {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .profile-image-control {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* Controles pequenos não devem ocupar cards grandes. */
.compact-control-panel {
    padding: 10px 12px !important;
}

.backup-retention-panel {
    max-width: 820px;
}

.compact-control-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 76px auto;
    gap: 8px 10px;
    align-items: center;
}

.compact-control-copy {
    display: grid;
    gap: 2px;
}

.compact-control-copy strong {
    color: var(--app-slate-950);
    font-size: .9rem;
}

.compact-control-copy small,
.compact-control-path {
    color: var(--app-slate-500);
    font-size: .78rem;
    line-height: 1.35;
}

.compact-control-field .form-control {
    min-height: 36px;
    padding-block: 6px;
    text-align: center;
}

.compact-control-form .btn {
    min-height: 36px;
    padding: 7px 16px;
}

.compact-control-path {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .compact-control-form {
        grid-template-columns: 1fr 90px auto;
    }

    .compact-control-path {
        grid-column: 1 / -1;
        justify-self: start;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .compact-control-form {
        grid-template-columns: 1fr;
    }

    .compact-control-field .form-control,
    .compact-control-form .btn {
        width: 100%;
    }
}

.master-prompt-copy {
    width: 100%;
    min-height: 680px;
    padding: 22px;
    color: var(--app-slate-900);
    background: rgba(248, 250, 252, .96);
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 16px;
    line-height: 1.65;
    resize: none;
    white-space: pre-wrap;
    overflow-x: hidden;
    overflow-y: hidden;
    overflow-wrap: break-word;
}

.master-document .panel-header .btn {
    white-space: nowrap;
}
.integration-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-grid, 22px);
}

.integration-type-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.integration-type-card:hover,
.integration-type-card:focus {
    color: inherit;
    border-color: rgba(79, 70, 229, .28);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}

.integration-type-card h2 {
    margin: 3px 0 8px;
    font-size: 1.08rem;
}

.integration-type-card p {
    margin: 0 0 12px;
    color: var(--app-slate-600);
}

.integration-type-card strong {
    color: var(--app-indigo-600);
    font-size: .82rem;
}

@media (max-width: 991.98px) {
    .integration-card-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 1180px) {
    .maintenance-cleanup-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .maintenance-cleanup-list {
        grid-template-columns: 1fr;
    }
}
.admin-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-control-color-wide {
    width: 100%;
    min-height: 44px;
    padding: 6px;
}

.toggle-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    color: var(--app-slate-800);
    background: var(--app-slate-50);
    border: 1px solid var(--app-slate-200);
    border-radius: 12px;
    cursor: pointer;
}

.toggle-card span {
    display: grid;
    gap: 2px;
}

.toggle-card small {
    color: var(--app-slate-500);
    font-size: .73rem;
}

@media (max-width: 991.98px) {
    .admin-settings-grid {
        grid-template-columns: 1fr;
    }
}
