/* V257: QR, dark mode, and granular permission polish */
.twofa-qr-img.xds-local-qr{width:220px;height:220px;margin:0 auto;display:grid!important;place-items:center;background:#fff!important;border:1px solid #dbe5df!important;border-radius:16px!important;padding:10px!important;box-shadow:0 14px 35px rgba(15,23,42,.08)!important;overflow:hidden!important;color:#0f172a!important}
.twofa-qr-img.xds-local-qr canvas{width:200px!important;height:200px!important;image-rendering:pixelated;display:block!important;background:#fff!important}
.twofa-qr-img.xds-local-qr img{display:none!important}
.qr-fallback-v257{display:grid;place-items:center;width:200px;height:200px;background:#fff;color:#b91c1c;font-size:12px;font-weight:900;text-align:center;border-radius:12px;padding:10px}

body.dark-mode .topbar-system-title,
body.dark-mode .brand-name,
body.dark-mode .sidebar-header .brand-name{color:#f8fafc!important;text-shadow:none!important;opacity:1!important}
body.dark-mode .module-only-title,
body.dark-mode .page-title,
body.dark-mode h1,body.dark-mode h2,body.dark-mode h3,body.dark-mode h4,
body.dark-mode .fw-bold,body.dark-mode .fw-semibold{color:#f8fafc!important}
body.dark-mode .text-muted,body.dark-mode small,body.dark-mode .small{color:#a7b6cc!important}
body.dark-mode input,body.dark-mode select,body.dark-mode textarea,
body.dark-mode .form-control,body.dark-mode .form-select,
body.dark-mode .compact-control{background:#0f172a!important;color:#e5e7eb!important;border-color:#334155!important}
body.dark-mode input::placeholder,body.dark-mode textarea::placeholder{color:#94a3b8!important}
body.dark-mode .clean-card,body.dark-mode .card,body.dark-mode .settings-card,body.dark-mode .settings-block,
body.dark-mode .p222-toolbar-card,body.dark-mode .p222-table-card,body.dark-mode .p221-card,
body.dark-mode .v224-panel,body.dark-mode .v224-kpi,body.dark-mode .v224-cat-card,
body.dark-mode .proc-hero,body.dark-mode .proc-modal .proc-dialog,
body.dark-mode .perm-modal-card,body.dark-mode .perm-card{background:#111827!important;color:#e5e7eb!important;border-color:rgba(148,163,184,.22)!important;box-shadow:0 18px 45px rgba(0,0,0,.24)!important}
body.dark-mode .stat-pro,body.dark-mode .stat-card,body.dark-mode .fr-card,
body.dark-mode .v224-mini-stats div,body.dark-mode .finance-card,
body.dark-mode .category-card,body.dark-mode .summary-card{background:#0f172a!important;color:#e5e7eb!important;border-color:rgba(148,163,184,.22)!important}
body.dark-mode .table,body.dark-mode table{--bs-table-bg:transparent!important;background:transparent!important;color:#e5e7eb!important}
body.dark-mode table thead th,body.dark-mode .table thead th{background:#1e293b!important;color:#e5e7eb!important;border-color:#334155!important}
body.dark-mode table tbody td,body.dark-mode .table tbody td{background:#0f172a!important;color:#e5e7eb!important;border-color:#233047!important}
body.dark-mode table tbody tr:nth-child(even) td{background:#111827!important}
body.dark-mode table tbody tr:hover td{background:#172033!important}
body.dark-mode .btn-light,body.dark-mode .btn-outline-secondary,body.dark-mode .btn-outline-primary,
body.dark-mode .p223-secondary{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.dark-mode .white-box,body.dark-mode .bg-white,body.dark-mode .alert-light{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.dark-mode .v224-cat-card strong,body.dark-mode .v224-cat-title,body.dark-mode .v224-kpi strong,
body.dark-mode .p222-hero h2,body.dark-mode .p221-card h4{color:#f8fafc!important}

.perm-toolbar-v257{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;padding:12px 14px!important;background:linear-gradient(135deg,#f8fafc,#f0fdf4)!important;border-bottom:1px solid #e5edf5!important}
.perm-toolbar-v257 .perm-search{max-width:340px;height:44px;border-radius:14px;font-weight:750}
.perm-help-v257{margin:0 14px 12px;padding:10px 12px;border:1px solid #d8efe1;background:#f0fdf4;color:#0f5132;border-radius:14px;font-size:12px;font-weight:750}
.perm-grid{padding:12px 14px!important;gap:12px!important}
.perm-card{border-radius:16px!important;border:1px solid #e5edf5!important;background:#fff!important;box-shadow:0 10px 26px rgba(15,23,42,.035)!important;padding:14px!important}
.perm-card .perm-title{font-weight:950;color:#102033!important}
.perm-card .perm-key{font-size:12px;color:#64748b!important;font-weight:750;margin-top:2px}
.perm-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important;margin-top:12px!important}
.perm-option{height:38px;border:1px solid #e5edf5;border-radius:12px;display:flex;align-items:center;gap:8px;padding:0 10px;font-size:12px;font-weight:900;color:#334155;background:#fff;cursor:pointer}
.perm-option.allow:has(input:checked){background:#ecfdf5;border-color:#16a064;color:#047857;box-shadow:0 0 0 3px rgba(22,160,100,.12)}
.perm-option.deny:has(input:checked){background:#fef2f2;border-color:#ef4444;color:#b91c1c;box-shadow:0 0 0 3px rgba(239,68,68,.10)}
.perm-group-title{margin-top:8px;padding:9px 2px 5px!important;font-size:12px!important;color:#64748b!important;letter-spacing:.08em;text-transform:uppercase;font-weight:950!important;border-top:1px solid #edf2f7}
body.dark-mode .perm-toolbar-v257{background:#0f172a!important;border-color:#334155!important}
body.dark-mode .perm-help-v257{background:#0f2a1f!important;border-color:#14532d!important;color:#bbf7d0!important}
body.dark-mode .perm-option{background:#0f172a!important;border-color:#334155!important;color:#e5e7eb!important}
body.dark-mode .perm-card .perm-title{color:#f8fafc!important}body.dark-mode .perm-card .perm-key{color:#a7b6cc!important}

@media(max-width:900px){.perm-grid{grid-template-columns:1fr!important}.perm-toolbar-v257 .perm-search{max-width:100%;width:100%}.perm-toolbar-v257 .btn{flex:1}.perm-modal-dialog{width:calc(100vw - 16px)!important}}
