


html, body { background: var(--theme-page); color: var(--theme-text); }
body, .content-page, .content { background-color: var(--theme-page) !important; }
a { color: var(--theme-primary); }
a:hover { color: var(--theme-primary-hover); }


.card,
.modal-content,
.dropdown-menu,
.offcanvas,
.accordion-item,
.list-group-item,
.table-responsive,
.bootstrap-table .fixed-table-container {
  border-color: var(--theme-border) !important;
  box-shadow: none !important;
}
.card { border-radius: 12px !important; background: var(--theme-surface); }
.card-header, .card-footer { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
.page-title-box h4, h1, h2, h3, h4, h5, h6 { color: var(--theme-ink); }
.text-muted { color: var(--theme-text-muted) !important; }


.navbar-custom, .bg-color-3 { background: var(--theme-ink) !important; }
.app-menu { background: var(--theme-surface) !important; border-right: 1px solid var(--theme-border); }
.app-menu .logo-box { background: var(--theme-surface) !important; }
.menu .menu-title { color: var(--theme-text-muted) !important; letter-spacing: .055em; }
.menu .menu-item .menu-link,
.menu .menu-item .menu-link:visited,
.menu .menu-item .menu-link .menu-text,
.menu .menu-item .menu-link .menu-icon { color: var(--theme-text-muted) !important; }
.menu .menu-item .menu-link:hover,
.menu .menu-item .menu-link:hover .menu-text,
.menu .menu-item .menu-link:hover .menu-icon { color: var(--theme-ink) !important; }
.menu .menu-item .menu-link.active,
.menu .menu-item.active > .menu-link,
.menu .menu-item .menu-link[aria-current="page"] {
  background: var(--theme-primary-soft) !important;
  color: var(--theme-primary-hover) !important;
}
.menu .menu-item .menu-link.active .menu-text,
.menu .menu-item .menu-link.active .menu-icon,
.menu .menu-item.active > .menu-link .menu-text,
.menu .menu-item.active > .menu-link .menu-icon { color: var(--theme-primary-hover) !important; }


.btn-primary,
.btn-save,
.btn-color-4,
.btn-color-gray,
.bg-primary,
.bg-color-1,
.bg-color-2,
.bg-color-4 {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-surface) !important;
}
.btn-primary:hover, .btn-primary:focus,
.btn-save:hover, .btn-save:focus,
.btn-color-4:hover, .btn-color-4:focus,
.btn-color-gray:hover, .btn-color-gray:focus {
  background-color: var(--theme-primary-hover) !important;
  border-color: var(--theme-primary-hover) !important;
  color: var(--theme-surface) !important;
}
.btn-outline-primary,
.btn-save-outline,
.btn-color-4-outline {
  background: var(--theme-surface) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-primary) !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus,
.btn-save-outline:hover, .btn-color-4-outline:hover {
  background: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-surface) !important;
}


.btn-secondary, .btn-cancel {
  background: var(--theme-ink) !important;
  border-color: var(--theme-ink) !important;
  color: var(--theme-surface) !important;
}
.btn-secondary:hover, .btn-cancel:hover { background: var(--theme-text-muted) !important; border-color: var(--theme-text-muted) !important; }
.btn-outline-secondary, .btn-cancel-outline {
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  border-color: var(--theme-border) !important;
}
.btn-outline-secondary:hover, .btn-cancel-outline:hover { background: var(--theme-surface-muted) !important; color: var(--theme-ink) !important; }


.btn-danger { background: var(--theme-danger) !important; border-color: var(--theme-danger) !important; color:var(--theme-surface) !important; }
.btn-danger:hover, .btn-danger:focus { background: var(--theme-danger) !important; border-color: var(--theme-danger) !important; }
.btn-outline-danger { color: var(--theme-danger) !important; border-color: var(--theme-danger-soft) !important; background:var(--theme-surface) !important; }
.btn-outline-danger:hover { background: var(--theme-danger-soft) !important; color: var(--theme-danger) !important; border-color:var(--theme-danger-soft) !important; }


.btn-info, .btn-purple, .btn-blue, .btn-light-primary { background: var(--theme-primary) !important; border-color: var(--theme-primary) !important; color:var(--theme-surface) !important; }
.btn-outline-info, .btn-outline-purple { color: var(--theme-primary) !important; border-color: var(--theme-primary) !important; background:var(--theme-surface) !important; }
.text-primary, .text-info, .text-purple, .color-1, .color-2, .color-4, .color-5 { color: var(--theme-primary) !important; }


.form-control, .form-select, .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border-color: var(--theme-border) !important;
  background-color: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}
.form-control:focus, .form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--single:focus {
  border-color: var(--theme-primary) !important;
  box-shadow: 0 0 0 .2rem var(--theme-focus) !important;
}
.form-check-input:checked { background-color: var(--theme-primary) !important; border-color: var(--theme-primary) !important; }
.form-check-input:focus { border-color: var(--theme-primary) !important; box-shadow: 0 0 0 .2rem var(--theme-focus) !important; }


.nav-pills .nav-link.active,
.nav-tabs .nav-link.active,
.pagination .page-item.active .page-link {
  background: var(--theme-primary-soft) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-primary-hover) !important;
}
.pagination .page-link { color: var(--theme-text-muted) !important; border-color: var(--theme-border) !important; }
.pagination .page-link:hover { background: var(--theme-surface-muted) !important; color: var(--theme-ink) !important; }


.alert-success, .badge.bg-success, .bg-success-subtle, .badge-active {
  background: var(--theme-primary-soft) !important;
  color: var(--theme-primary-hover) !important;
  border-color: var(--theme-border) !important;
}
.alert-warning, .badge.bg-warning, .bg-warning-subtle {
  background: var(--theme-warning-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-primary-soft) !important;
}
.alert-danger, .badge.bg-danger, .bg-danger-subtle {
  background: var(--theme-danger-soft) !important;
  color: var(--theme-danger) !important;
  border-color: var(--theme-surface-muted) !important;
}
.alert-info, .badge.bg-info, .bg-info-subtle {
  background: var(--theme-surface-muted) !important;
  color: var(--theme-text-muted) !important;
  border-color: var(--theme-border) !important;
}
.text-success { color: var(--theme-primary-hover) !important; }
.text-danger { color: var(--theme-danger) !important; }
.text-warning { color: var(--theme-text) !important; }
.bg-success:not(.badge), .bg-danger:not(.badge), .bg-warning:not(.badge), .bg-info:not(.badge) { color: inherit; }


.badge-level-1, .badge-level-2, .badge-level-3, .badge-level-4, .badge-level-5 {
  background: var(--theme-surface-muted) !important;
  color: var(--theme-text-muted) !important;
  border: 1px solid var(--theme-border) !important;
}


.table { --bs-table-bg: transparent; --bs-table-striped-bg: var(--theme-page); --bs-table-hover-bg: var(--theme-page); color: var(--theme-text); }
.table > :not(caption) > * > * { border-bottom-color: var(--theme-border) !important; }
.table thead th, .bootstrap-table .fixed-table-container .table thead th { color: var(--theme-text-muted) !important; background:var(--theme-page) !important; }


.dropdown-item.active, .dropdown-item:active { background: var(--theme-primary-soft) !important; color: var(--theme-primary-hover) !important; }
.swal2-confirm { background: var(--theme-primary) !important; }
.swal2-cancel { background: var(--theme-ink) !important; }
.swal2-deny { background: var(--theme-danger) !important; }


.dash-kpi, .dash-section, .rpt-summary-card, .rpt-chart-box, .rpt-table-section {
  border: 1px solid var(--theme-border) !important;
  border-left-width: 1px !important;
  box-shadow: none !important;
  background: var(--theme-surface) !important;
}
.dash-kpi-income, .rpt-card-income { border-top: 3px solid var(--theme-primary) !important; }
.dash-kpi-outflow{ border-top: 3px solid var(--theme-danger) !important; }
.dash-value.text-purple, .rpt-value.text-purple, .rpt-value.text-info { color: var(--theme-ink) !important; }
.dash-value.text-success, .rpt-value.text-success { color: var(--theme-primary-hover) !important; }
.dash-value.text-danger, .rpt-value.text-danger { color: var(--theme-danger) !important; }
.dash-value.text-warning, .dash-value.text-yellow, .rpt-value.text-warning { color: var(--theme-text) !important; }
.dash-shortcut-card {
  color: var(--theme-primary) !important;
  border-color: var(--theme-border) !important;
  box-shadow: none !important;
  background: var(--theme-surface) !important;
}
.dash-shortcut-card:hover { transform: translateY(-2px) !important; border-color: var(--theme-border) !important; box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-text) 6%, transparent) !important; }
.dash-shortcut-card--primary,
.dash-shortcut-card--info,
.dash-shortcut-card--secondary,
.dash-shortcut-card--warning,
.dash-shortcut-card--dark { color: var(--theme-primary) !important; }
.dash-shortcut-icon { background: var(--theme-primary-soft) !important; }
.dash-shortcut-icon .mdi, .dash-shortcut-icon .mdi::before { color: var(--theme-primary-hover) !important; }


.text-blue, .text-info, .text-purple, .text-pink, .text-cyan { color: var(--theme-primary) !important; }
.bg-blue, .bg-purple, .bg-pink, .bg-info { background-color: var(--theme-surface-muted) !important; color: var(--theme-text) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}



.bootstrap-table .fixed-table-container .table thead th .th-inner.sortable { position:relative; background-image:none!important; padding-right:24px; }
.bootstrap-table .fixed-table-container .table thead th .th-inner.sortable::before,
.bootstrap-table .fixed-table-container .table thead th .th-inner.sortable::after { content:"";position:absolute;right:8px;border-left:4px solid transparent;border-right:4px solid transparent; }
.bootstrap-table .fixed-table-container .table thead th .th-inner.sortable::before { top:calc(50% - 6px);border-bottom:5px solid var(--color-gray-dark,var(--theme-text-muted));opacity:.35; }
.bootstrap-table .fixed-table-container .table thead th .th-inner.sortable::after { top:calc(50% + 1px);border-top:5px solid var(--color-gray-dark,var(--theme-text-muted));opacity:.35; }
.bootstrap-table .fixed-table-container .table thead th .th-inner.asc::before { border-bottom-color:var(--color-primary,var(--theme-primary));opacity:1; }
.bootstrap-table .fixed-table-container .table thead th .th-inner.desc::after { border-top-color:var(--color-primary,var(--theme-primary));opacity:1; }

.badge.rpt-payment-status{background:var(--theme-page)!important;color:var(--theme-danger)!important}
.rpt-operation-date summary{cursor:pointer;list-style:none}
.rpt-operation-date summary::-webkit-details-marker{display:none}
.rpt-operation-date[open] summary i{display:inline-block;transform:rotate(180deg)}

.mdi-information-outline,.mdi-information-outline::before,.swal2-icon.swal2-info{color:var(--theme-primary)!important}

.alert-warning .mdi-information-outline,
.alert-warning .mdi-information-outline::before { color: inherit !important; }
.swal2-icon.swal2-info{border-color:var(--theme-primary)!important}.badge.rpt-payment-status--completed{background:var(--theme-success-soft)!important;color:var(--theme-primary)!important}


.pagination .page-link:focus,
.pagination .page-link:focus-visible {
  background: var(--theme-primary-soft) !important;
  color: var(--theme-primary-hover) !important;
  border-color: var(--theme-primary) !important;
  box-shadow: 0 0 0 .2rem var(--theme-focus) !important;
  outline: 2px solid transparent;
}


.permission-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 150px;
  align-items: center;
  gap: 24px;
  padding: 20px;
}
@media (max-width: 767.98px) {
  #user-permissions-container .accordion-body { padding: 12px; }
  .permission-assignment-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 12px; padding: 16px; align-items: start; }
  .permission-assignment-row > div { min-width: 0; }
  .permission-assignment-row > :first-child { overflow-wrap: anywhere; }
  .permission-role-access > span { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; }
  .permission-role-access > span .mdi { flex-shrink: 0; margin-right: 0 !important; }
  .permission-user-selection { justify-self: end; }
  .permission-user-selection > label { line-height: 1.4; }
  .permission-user-selection > div { min-height: 24px; }
  .permission-assignment-row > :first-child { grid-column: 1 / -1; }
}


.device-validation-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.device-validation-field > label { margin: 0; cursor: pointer; }
.device-validation-field > small { flex-basis: 100%; }
input.device-validation-toggle {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block !important;
  position: relative !important;
  flex: 0 0 66px;
  width: 66px !important;
  min-width: 66px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: 999px !important;
  background-color: var(--theme-surface-muted) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='16' fill='white'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 32px 32px !important;
  background-position: left 3px center !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-position .15s ease, background-color .15s ease;
}
input.device-validation-toggle:checked {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  background-position: right 3px center !important;
}
input.device-validation-toggle:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 3px;
}
input.device-validation-toggle:disabled { opacity: .55; cursor: not-allowed; }
.device-authorization-history { margin-bottom: 0; padding-left: 1.25rem; }
.device-authorization-history > li { line-height: 1.5; padding-block: .3rem; }


.swal2-popup.aegis-dialog-compact .swal2-html-container{margin-top:.75rem;padding-top:0}
.swal2-popup.aegis-dialog-compact .swal2-html-container>p:first-child,
.swal2-popup.aegis-dialog-compact .swal2-html-container>div>p:first-child{margin-top:0}


#receipt-include-payments{width:1.2rem;height:1.2rem;flex-shrink:0;border:2px solid var(--theme-text-muted);background-color:var(--theme-surface);cursor:pointer;opacity:1}
#receipt-include-payments:hover{border-color:var(--theme-primary)}
.swal2-html-container label:has(#receipt-include-payments){cursor:pointer;min-height:2.5rem}


.finance-page-heading{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px}
.finance-page-heading .page-title{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;min-width:0}
.finance-connection-status{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}
@media(max-width:767.98px){
 .finance-page-heading{grid-template-columns:minmax(0,1fr);padding:16px 0}
 .finance-page-heading .page-title{line-height:1.4!important;padding:0!important;margin:0!important}
 .finance-page-heading .finance-connection-status{justify-content:flex-start}
}
