/* ==============================================================
   ADMIN-G4S — Modo Oscuro (Dark Theme)
   Soporta [data-theme="dark"], [data-bs-theme="dark"] y .dark-mode
   ============================================================== */
[data-theme="dark"],
.dark-mode,
:root[data-theme="dark"],
:root[data-bs-theme="dark"] {
    --g4s-bg-surface: #222e3c;
    --g4s-bg-subtle: #1c2633;
    --g4s-bg-muted: #2b3947;
    --g4s-text-main: #e9ecef;
    --g4s-text-secondary: #cbd5e1;
    --g4s-text-muted: #94a3b8;
    --g4s-border-card: #313d4f;
    --g4s-border-card-subtle: #2b3543;
    --g4s-hairline-strong: #3e4c60;
    --g4s-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 6px 16px -8px rgba(0, 0, 0, 0.4);
    --g4s-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 28px -12px rgba(0, 0, 0, 0.6);
    --g4s-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}
/* General y Layout */
html[data-theme="dark"],
html.dark-mode,
body.dark-mode,
[data-theme="dark"] body {
    background-color: #1c2633 !important;
    color: #e9ecef;
}
[data-theme="dark"] .main,
[data-theme="dark"] .content,
.dark-mode .main,
.dark-mode .content {
    background-color: #1c2633 !important;
}
[data-theme="dark"] .wrapper:before,
.dark-mode .wrapper:before {
    background: #1c2633 !important;
}
/* Encabezado G4S */
[data-theme="dark"] .page-header-g4s,
.dark-mode .page-header-g4s {
    border-bottom-color: rgba(233, 236, 239, 0.12) !important;
}
[data-theme="dark"] .page-header-g4s-title,
.dark-mode .page-header-g4s-title {
    color: #e9ecef !important;
}
[data-theme="dark"] .page-header-g4s-subtitle,
.dark-mode .page-header-g4s-subtitle {
    color: #94a3b8 !important;
}
[data-theme="dark"] .page-header-g4s-meta,
.dark-mode .page-header-g4s-meta {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .page-header-g4s-action-alt,
.dark-mode .page-header-g4s-action-alt {
    border-color: rgba(233, 236, 239, 0.22) !important;
    background-color: rgba(233, 236, 239, 0.05) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .page-header-g4s-action-alt:hover,
.dark-mode .page-header-g4s-action-alt:hover {
    background-color: rgba(233, 236, 239, 0.12) !important;
    border-color: rgba(233, 236, 239, 0.4) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .page-header-g4s-badge,
.dark-mode .page-header-g4s-badge {
    border-color: rgba(227, 6, 19, 0.5) !important;
    background-color: rgba(227, 6, 19, 0.15) !important;
    color: #ff6b7a !important;
}
/* Tarjetas AdminKit */
[data-theme="dark"] .card,
.dark-mode .card {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    box-shadow: 0 0 .875rem 0 rgba(0,0,0,.25);
    color: #e9ecef;
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer,
.dark-mode .card-header,
.dark-mode .card-footer {
    background-color: transparent !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
/* Tarjetas Credencial G4S */
[data-theme="dark"] .card-g4s,
.dark-mode .card-g4s {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .card-g4s::before,
.dark-mode .card-g4s::before {
    background-color: #313d4f !important;
}
[data-theme="dark"] .card-g4s.card-g4s-hover:hover,
[data-theme="dark"] .card-g4s.card-g4s-interactive:hover,
.dark-mode .card-g4s.card-g4s-hover:hover,
.dark-mode .card-g4s.card-g4s-interactive:hover {
    border-color: #3e4c60 !important;
}
[data-theme="dark"] .card-g4s-title,
.dark-mode .card-g4s-title {
    color: #e9ecef !important;
}
[data-theme="dark"] .card-g4s-subtitle,
.dark-mode .card-g4s-subtitle {
    color: #94a3b8 !important;
}
[data-theme="dark"] .card-g4s-header,
[data-theme="dark"] .card-g4s-footer,
.dark-mode .card-g4s-header,
.dark-mode .card-g4s-footer {
    border-color: #313d4f !important;
    background-color: transparent !important;
}
[data-theme="dark"] .card-g4s-action,
.dark-mode .card-g4s-action {
    border-top-color: #313d4f !important;
}
[data-theme="dark"] .card-g4s-action .btn,
[data-theme="dark"] .card-g4s-action .btn-ingresar,
.dark-mode .card-g4s-action .btn,
.dark-mode .card-g4s-action .btn-ingresar {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .card-g4s.card-g4s-hover:hover .card-g4s-action .btn,
[data-theme="dark"] .card-g4s.card-g4s-interactive:hover .card-g4s-action .btn,
.dark-mode .card-g4s.card-g4s-hover:hover .card-g4s-action .btn,
.dark-mode .card-g4s.card-g4s-interactive:hover .card-g4s-action .btn {
    background-color: #e30613 !important;
    border-color: #e30613 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .card-g4s-divider,
.dark-mode .card-g4s-divider {
    background: #313d4f !important;
}
[data-theme="dark"] .card-g4s-icon-box.icon-box-dark,
.dark-mode .card-g4s-icon-box.icon-box-dark {
    background-color: rgba(233, 236, 239, 0.08) !important;
    border-color: rgba(233, 236, 239, 0.15) !important;
    color: #e9ecef !important;
}
/* Colores de texto y títulos */
[data-theme="dark"] .text-dark,
.dark-mode .text-dark {
    color: #e9ecef !important;
}
[data-theme="dark"] .card-title,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
.dark-mode .card-title,
.dark-mode h1, .dark-mode h2, .dark-mode h3,
.dark-mode h4, .dark-mode h5, .dark-mode h6 {
    color: #e9ecef !important;
}
[data-theme="dark"] .text-muted,
.dark-mode .text-muted {
    color: #94a3b8 !important;
}
/* Colores contextuales legibles en fondo oscuro */
[data-theme="dark"] .text-danger,
.dark-mode .text-danger { color: #f87171 !important; }
[data-theme="dark"] .text-success,
.dark-mode .text-success { color: #4ade80 !important; }
[data-theme="dark"] .text-warning,
.dark-mode .text-warning { color: #fbbf24 !important; }
[data-theme="dark"] .text-info,
.dark-mode .text-info { color: #38bdf8 !important; }
[data-theme="dark"] .text-primary,
.dark-mode .text-primary { color: #60a5fa !important; }
/* Navbar */
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-bg,
[data-theme="dark"] .navbar-light,
.dark-mode .navbar,
.dark-mode .navbar-bg,
.dark-mode .navbar-light {
    background-color: #222e3c !important;
    border-bottom: 1px solid #313d4f !important;
}
[data-theme="dark"] .nav-icon,
[data-theme="dark"] .nav-link,
.dark-mode .nav-icon,
.dark-mode .nav-link {
    color: #e9ecef !important;
}
[data-theme="dark"] .navbar-nav .nav-link span.text-dark,
.dark-mode .navbar-nav .nav-link span.text-dark {
    color: #e9ecef !important;
}
[data-theme="dark"] .dropdown-toggle::after,
.dark-mode .dropdown-toggle::after {
    color: #e9ecef !important;
}
[data-theme="dark"] .input-group-navbar .form-control,
.dark-mode .input-group-navbar .form-control {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .input-group-navbar .btn,
.dark-mode .input-group-navbar .btn {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #adb5bd !important;
}
/* Sidebar */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-nav,
.dark-mode .sidebar,
.dark-mode .sidebar-nav {
    background: #1c2633 !important;
}
[data-theme="dark"] .sidebar-link,
[data-theme="dark"] a.sidebar-link,
.dark-mode .sidebar-link,
.dark-mode a.sidebar-link {
    background: #1c2633 !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .sidebar-link:hover,
.dark-mode .sidebar-link:hover {
    color: #ffffff !important;
    background: #222e3c !important;
}
[data-theme="dark"] .sidebar-item.active > .sidebar-link,
[data-theme="dark"] .sidebar-item.active .sidebar-link:hover,
.dark-mode .sidebar-item.active > .sidebar-link,
.dark-mode .sidebar-item.active .sidebar-link:hover {
    background: #222e3c !important;
    border-left-color: #e30613 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .sidebar-header,
.dark-mode .sidebar-header {
    color: #94a3b8 !important;
}
/* Dropdowns y Listas */
[data-theme="dark"] .dropdown-menu,
.dark-mode .dropdown-menu {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .dropdown-item,
.dark-mode .dropdown-item {
    color: #e9ecef !important;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus,
.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
    background-color: #313d4f !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dropdown-divider,
.dark-mode .dropdown-divider {
    border-color: #313d4f !important;
}
[data-theme="dark"] .dropdown-menu-header,
[data-theme="dark"] .dropdown-menu-footer,
.dark-mode .dropdown-menu-header,
.dark-mode .dropdown-menu-footer {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .list-group-item,
.dark-mode .list-group-item {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
}
/* Modales */
[data-theme="dark"] .modal-content,
.dark-mode .modal-content {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-body,
.dark-mode .modal-header,
.dark-mode .modal-footer,
.dark-mode .modal-body {
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .btn-close,
.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
/* Formularios */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode textarea.form-control {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
    color-scheme: dark;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] textarea.form-control:focus,
.dark-mode .form-control:focus,
.dark-mode .form-select:focus,
.dark-mode textarea.form-control:focus {
    background-color: #1c2633 !important;
    border-color: #e30613 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.25) !important;
}
[data-theme="dark"] .input-group-text,
.dark-mode .input-group-text {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] textarea.form-control::placeholder,
.dark-mode .form-control::placeholder,
.dark-mode textarea.form-control::placeholder {
    color: #64748b !important;
}
[data-theme="dark"] .form-check-input,
.dark-mode .form-check-input {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .form-check-input:checked,
.dark-mode .form-check-input:checked {
    background-color: #e30613 !important;
    border-color: #e30613 !important;
}
[data-theme="dark"] .form-check-label,
[data-theme="dark"] .form-label,
.dark-mode .form-check-label,
.dark-mode .form-label {
    color: #e9ecef !important;
}
/* Tablas estándar y variantes Bootstrap */
[data-theme="dark"] .table,
[data-theme="dark"] .table-hover,
.dark-mode .table,
.dark-mode .table-hover {
    --bs-table-color: #e9ecef;
    --bs-table-bg: #222e3c;
    --bs-table-border-color: #313d4f;
    --bs-table-striped-bg: #1a2430;
    --bs-table-hover-bg: #2c3a4b;
    color: #e9ecef;
    border-color: #313d4f !important;
}
[data-theme="dark"] .table > :not(caption) > * > *,
.dark-mode .table > :not(caption) > * > * {
    background-color: #222e3c;
    border-bottom-color: #313d4f !important;
    color: #e9ecef;
}
[data-theme="dark"] thead th,
[data-theme="dark"] .table thead th,
.dark-mode thead th,
.dark-mode .table thead th {
    background-color: #1c2633 !important;
    color: #e9ecef !important;
    border-bottom: 2px solid #313d4f !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #1a2430 !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > *,
.dark-mode .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #222e3c !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .table-hover > tbody > tr:hover > *,
.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: #2c3a4b !important;
    color: #ffffff !important;
}
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light > th,
[data-theme="dark"] .table-light > td,
.dark-mode .table-light,
.dark-mode .table-light > th,
.dark-mode .table-light > td {
    --bs-table-bg: #1a232f !important;
    --bs-table-color: #e9ecef !important;
    background-color: #1a232f !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .table-secondary,
[data-theme="dark"] .table-secondary > th,
[data-theme="dark"] .table-secondary > td,
[data-theme="dark"] .table-active,
[data-theme="dark"] .table-active > th,
[data-theme="dark"] .table-active > td,
.dark-mode .table-secondary,
.dark-mode .table-secondary > th,
.dark-mode .table-secondary > td,
.dark-mode .table-active,
.dark-mode .table-active > th,
.dark-mode .table-active > td {
    --bs-table-bg: #263342 !important;
    --bs-table-color: #e9ecef !important;
    background-color: #263342 !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered > :not(caption) > * > *,
.dark-mode .table-bordered,
.dark-mode .table-bordered > :not(caption) > * > * {
    border-color: #313d4f !important;
}
/* DevExtreme Grid y Componentes */
[data-theme="dark"] .dx-widget,
.dark-mode .dx-widget {
    color: #e9ecef;
}
[data-theme="dark"] .dx-datagrid,
.dark-mode .dx-datagrid,
[data-theme="dark"] .dx-datagrid-container,
.dark-mode .dx-datagrid-container {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .dx-datagrid-header-panel,
[data-theme="dark"] .dx-datagrid-borders > .dx-datagrid-header-panel,
[data-theme="dark"] .dx-datagrid-header-panel .dx-toolbar,
[data-theme="dark"] .dx-datagrid-header-panel .dx-toolbar-items-container,
[data-theme="dark"] .dx-datagrid-header-panel .dx-toolbar-after,
[data-theme="dark"] .dx-datagrid-header-panel .dx-toolbar-before,
.dark-mode .dx-datagrid-header-panel,
.dark-mode .dx-datagrid-borders > .dx-datagrid-header-panel,
.dark-mode .dx-datagrid-header-panel .dx-toolbar,
.dark-mode .dx-datagrid-header-panel .dx-toolbar-items-container,
.dark-mode .dx-datagrid-header-panel .dx-toolbar-after,
.dark-mode .dx-datagrid-header-panel .dx-toolbar-before {
    background-color: #222e3c !important;
    border-bottom: 1px solid #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-datagrid-header-panel .dx-toolbar-button .dx-button,
.dark-mode .dx-datagrid-header-panel .dx-toolbar-button .dx-button {
    background-color: #1c2633 !important;
    border: 1px solid #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-datagrid-header-panel .dx-icon,
.dark-mode .dx-datagrid-header-panel .dx-icon {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .dx-datagrid-search-panel,
[data-theme="dark"] .dx-datagrid-search-panel.dx-texteditor,
[data-theme="dark"] .dx-datagrid-search-panel.dx-editor-outlined,
.dark-mode .dx-datagrid-search-panel,
.dark-mode .dx-datagrid-search-panel.dx-texteditor,
.dark-mode .dx-datagrid-search-panel.dx-editor-outlined {
    background-color: #1c2633 !important;
    border: 1px solid #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-datagrid-search-panel .dx-texteditor-input,
.dark-mode .dx-datagrid-search-panel .dx-texteditor-input {
    color: #e9ecef !important;
    background-color: transparent !important;
}
[data-theme="dark"] .dx-datagrid-search-panel .dx-placeholder,
.dark-mode .dx-datagrid-search-panel .dx-placeholder {
    color: #64748b !important;
}
[data-theme="dark"] .dx-datagrid-headers,
[data-theme="dark"] .dx-datagrid-headers .dx-header-row > td,
[data-theme="dark"] .dx-datagrid-headers .dx-datagrid-table .dx-row > td,
.dark-mode .dx-datagrid-headers,
.dark-mode .dx-datagrid-headers .dx-header-row > td,
.dark-mode .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    background-color: #1c2633 !important;
    color: #e9ecef !important;
    border-bottom: 1px solid #313d4f !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .dx-datagrid-headers .dx-datagrid-text-content,
.dark-mode .dx-datagrid-headers .dx-datagrid-text-content {
    color: #e9ecef !important;
    font-weight: 600;
}
[data-theme="dark"] .dx-header-filter,
[data-theme="dark"] .dx-sort-up,
[data-theme="dark"] .dx-sort-down,
.dark-mode .dx-header-filter,
.dark-mode .dx-sort-up,
.dark-mode .dx-sort-down {
    color: #adb5bd !important;
}
[data-theme="dark"] .dx-datagrid-filter-row,
[data-theme="dark"] .dx-datagrid-filter-row > td,
[data-theme="dark"] .dx-datagrid .dx-datagrid-table .dx-datagrid-filter-row > td,
.dark-mode .dx-datagrid-filter-row,
.dark-mode .dx-datagrid-filter-row > td,
.dark-mode .dx-datagrid .dx-datagrid-table .dx-datagrid-filter-row > td {
    background-color: #1a232f !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-datagrid-filter-row .dx-editor-cell .dx-texteditor,
[data-theme="dark"] .dx-datagrid-filter-row .dx-editor-container,
[data-theme="dark"] .dx-datagrid-filter-row .dx-editor-cell,
.dark-mode .dx-datagrid-filter-row .dx-editor-cell .dx-texteditor,
.dark-mode .dx-datagrid-filter-row .dx-editor-container,
.dark-mode .dx-datagrid-filter-row .dx-editor-cell {
    background-color: #161e28 !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-datagrid-filter-row .dx-texteditor-input,
.dark-mode .dx-datagrid-filter-row .dx-texteditor-input {
    color: #e9ecef !important;
    background-color: transparent !important;
}
[data-theme="dark"] .dx-datagrid-filter-row .dx-icon,
[data-theme="dark"] .dx-datagrid-filter-row .dx-filter-range-content,
.dark-mode .dx-datagrid-filter-row .dx-icon,
.dark-mode .dx-datagrid-filter-row .dx-filter-range-content {
    color: #94a3b8 !important;
}
[data-theme="dark"] .dx-datagrid-rowsview .dx-data-row > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-row > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-datagrid-table .dx-data-row > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-datagrid-table .dx-row > td,
.dark-mode .dx-datagrid-rowsview .dx-data-row > td,
.dark-mode .dx-datagrid-rowsview .dx-row > td,
.dark-mode .dx-datagrid-rowsview .dx-datagrid-table .dx-data-row > td,
.dark-mode .dx-datagrid-rowsview .dx-datagrid-table .dx-row > td {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border-bottom: 1px solid #2d3846 !important;
    border-color: #2d3846 !important;
}
[data-theme="dark"] .dx-datagrid .dx-row-alt > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-data-row.dx-row-alt > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-row-alt > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-datagrid-table .dx-data-row.dx-row-alt > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-datagrid-table .dx-row-alt > td,
.dark-mode .dx-datagrid .dx-row-alt > td,
.dark-mode .dx-datagrid-rowsview .dx-data-row.dx-row-alt > td,
.dark-mode .dx-datagrid-rowsview .dx-row-alt > td,
.dark-mode .dx-datagrid-rowsview .dx-datagrid-table .dx-data-row.dx-row-alt > td,
.dark-mode .dx-datagrid-rowsview .dx-datagrid-table .dx-row-alt > td {
    background-color: #1a2430 !important;
    color: #e9ecef !important;
    border-bottom: 1px solid #2d3846 !important;
    border-color: #2d3846 !important;
}
[data-theme="dark"] .dx-datagrid-rowsview .dx-data-row:hover > td,
[data-theme="dark"] .dx-datagrid-rowsview .dx-row:hover > td,
.dark-mode .dx-datagrid-rowsview .dx-data-row:hover > td,
.dark-mode .dx-datagrid-rowsview .dx-row:hover > td {
    background-color: #2c3a4b !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-datagrid-rowsview .dx-selection.dx-row > td,
.dark-mode .dx-datagrid-rowsview .dx-selection.dx-row > td {
    background-color: rgba(227, 6, 19, 0.25) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-datagrid-content-fixed .dx-row > td,
.dark-mode .dx-datagrid-content-fixed .dx-row > td {
    background-color: #222e3c !important;
    border-color: #2d3846 !important;
}
[data-theme="dark"] .dx-datagrid-content-fixed .dx-row-alt > td,
.dark-mode .dx-datagrid-content-fixed .dx-row-alt > td {
    background-color: #1a2430 !important;
    border-color: #2d3846 !important;
}
[data-theme="dark"] .dx-datagrid-total-footer,
[data-theme="dark"] .dx-datagrid-summary-item,
.dark-mode .dx-datagrid-total-footer,
.dark-mode .dx-datagrid-summary-item {
    background-color: #1c2633 !important;
    color: #e9ecef !important;
    border-top: 1px solid #313d4f !important;
}
[data-theme="dark"] .dx-datagrid-pager,
[data-theme="dark"] .dx-pager,
.dark-mode .dx-datagrid-pager,
.dark-mode .dx-pager {
    background-color: #1c2633 !important;
    color: #e9ecef !important;
    border-top: 1px solid #313d4f !important;
}
[data-theme="dark"] .dx-pager .dx-page,
[data-theme="dark"] .dx-pager .dx-prev-button,
[data-theme="dark"] .dx-pager .dx-next-button,
.dark-mode .dx-pager .dx-page,
.dark-mode .dx-pager .dx-prev-button,
.dark-mode .dx-pager .dx-next-button {
    color: #94a3b8 !important;
}
[data-theme="dark"] .dx-pager .dx-selection,
.dark-mode .dx-pager .dx-selection {
    background-color: #e30613 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-pager .dx-page-size,
.dark-mode .dx-pager .dx-page-size {
    color: #94a3b8 !important;
}
[data-theme="dark"] .dx-pager .dx-page-size.dx-selection,
.dark-mode .dx-pager .dx-page-size.dx-selection {
    background-color: #e30613 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-datagrid-borders > .dx-datagrid-rowsview,
[data-theme="dark"] .dx-datagrid-borders > .dx-datagrid-headers,
[data-theme="dark"] .dx-datagrid-borders > .dx-datagrid-pager,
.dark-mode .dx-datagrid-borders > .dx-datagrid-rowsview,
.dark-mode .dx-datagrid-borders > .dx-datagrid-headers,
.dark-mode .dx-datagrid-borders > .dx-datagrid-pager {
    border-color: #313d4f !important;
}
[data-theme="dark"] .dx-texteditor.dx-editor-outlined,
.dark-mode .dx-texteditor.dx-editor-outlined {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-texteditor.dx-editor-outlined .dx-texteditor-input,
.dark-mode .dx-texteditor.dx-editor-outlined .dx-texteditor-input {
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-popup-normal,
[data-theme="dark"] .dx-overlay-content,
[data-theme="dark"] .dx-dropdowneditor-overlay,
.dark-mode .dx-popup-normal,
.dark-mode .dx-overlay-content,
.dark-mode .dx-dropdowneditor-overlay {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .dx-list-item,
[data-theme="dark"] .dx-menu-item,
.dark-mode .dx-list-item,
.dark-mode .dx-menu-item {
    color: #e9ecef !important;
}
[data-theme="dark"] .dx-list-item:hover,
[data-theme="dark"] .dx-list-item.dx-state-hover,
[data-theme="dark"] .dx-menu-item:hover,
.dark-mode .dx-list-item:hover,
.dark-mode .dx-list-item.dx-state-hover,
.dark-mode .dx-menu-item:hover {
    background-color: #313d4f !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-list-item.dx-list-item-selected,
.dark-mode .dx-list-item.dx-list-item-selected {
    background-color: #2b3947 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .dx-header-filter-menu,
.dark-mode .dx-header-filter-menu {
    background-color: #222e3c !important;
}
/* Select2 */
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection,
.dark-mode .select2-container--bootstrap-5 .select2-selection {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.dark-mode .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #e9ecef !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown,
.dark-mode .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field,
.dark-mode .select2-container--bootstrap-5 .select2-search__field {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option,
.dark-mode .select2-container--bootstrap-5 .select2-results__option {
    color: #e9ecef !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted,
.dark-mode .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #313d4f !important;
    color: #ffffff !important;
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected,
.dark-mode .select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #2b3947 !important;
    color: #ffffff !important;
}
/* SweetAlert2 y Alertify */
[data-theme="dark"] .swal2-popup,
.dark-mode .swal2-popup {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border: 1px solid #313d4f !important;
}
[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container,
.dark-mode .swal2-title,
.dark-mode .swal2-html-container {
    color: #e9ecef !important;
}
[data-theme="dark"] .alertify .ajs-dialog,
.dark-mode .alertify .ajs-dialog {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border: 1px solid #313d4f !important;
}
[data-theme="dark"] .alertify .ajs-header,
[data-theme="dark"] .alertify .ajs-footer,
.dark-mode .alertify .ajs-header,
.dark-mode .alertify .ajs-footer {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .alertify .ajs-body,
.dark-mode .alertify .ajs-body {
    color: #e9ecef !important;
}
/* Alertas y Cajas de Estado */
[data-theme="dark"] .alert-light,
.dark-mode .alert-light {
    background-color: #1a232f !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
[data-theme="dark"] .alert-light .text-dark,
.dark-mode .alert-light .text-dark {
    color: #e9ecef !important;
}
[data-theme="dark"] .alert-info,
.dark-mode .alert-info {
    background-color: rgba(13, 202, 240, 0.15) !important;
    border-color: rgba(13, 202, 240, 0.35) !important;
    color: #6edff6 !important;
}
[data-theme="dark"] .alert-warning,
.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.35) !important;
    color: #ffda6a !important;
}
[data-theme="dark"] .alert-success,
.dark-mode .alert-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
    border-color: rgba(25, 135, 84, 0.35) !important;
    color: #75b798 !important;
}
[data-theme="dark"] .alert-danger,
.dark-mode .alert-danger {
    background-color: rgba(220, 53, 69, 0.15) !important;
    border-color: rgba(220, 53, 69, 0.35) !important;
    color: #ea868f !important;
}
[data-theme="dark"] .alert-primary,
.dark-mode .alert-primary {
    background-color: rgba(13, 110, 253, 0.15) !important;
    border-color: rgba(13, 110, 253, 0.35) !important;
    color: #8bb9fe !important;
}
[data-theme="dark"] .alert-secondary,
.dark-mode .alert-secondary {
    background-color: #2b3947 !important;
    border-color: #313d4f !important;
    color: #cbd5e1 !important;
}
/* Detalle de Usuario y Asignaciones */
[data-theme="dark"] .bg-danger-light,
.dark-mode .bg-danger-light {
    background-color: rgba(220, 53, 69, 0.18) !important;
    border: 1px solid rgba(220, 53, 69, 0.25) !important;
}
[data-theme="dark"] .border-dashed,
.dark-mode .border-dashed {
    border-color: #313d4f !important;
}
[data-theme="dark"] .scrollbar::-webkit-scrollbar-thumb,
.dark-mode .scrollbar::-webkit-scrollbar-thumb {
    background: #475569 !important;
    border-radius: 10px;
}
[data-theme="dark"] .scrollbar::-webkit-scrollbar-track,
.dark-mode .scrollbar::-webkit-scrollbar-track {
    background: #1c2633 !important;
}
[data-theme="dark"] .bg-light .bg-white,
.dark-mode .bg-light .bg-white,
[data-theme="dark"] .alert-light .bg-white,
.dark-mode .alert-light .bg-white {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .nav-tabs .nav-link,
.dark-mode .nav-tabs .nav-link {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .nav-tabs .nav-link:hover:not(.active),
.dark-mode .nav-tabs .nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active,
.dark-mode .nav-tabs .nav-link.active {
    border-bottom: 3px solid #dc3545 !important;
    color: #f87171 !important;
    background-color: transparent !important;
}
[data-theme="dark"] .btn-light,
.dark-mode .btn-light {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .btn-light:hover,
.dark-mode .btn-light:hover {
    background-color: #263342 !important;
    border-color: #3d4c60 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .btn-outline-dark,
.dark-mode .btn-outline-dark {
    border-color: #4a5a70 !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .btn-outline-dark:hover,
.dark-mode .btn-outline-dark:hover {
    background-color: #313d4f !important;
    color: #ffffff !important;
}
[data-theme="dark"] .progress,
.dark-mode .progress {
    background-color: #1c2633 !important;
    border: 1px solid #313d4f !important;
}
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-warning.text-dark,
.dark-mode .badge.bg-warning,
.dark-mode .badge.bg-warning.text-dark {
    color: #10182a !important;
}
/* Utilidades de fondo y borde */
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white,
.dark-mode .bg-light,
.dark-mode .bg-white {
    background-color: #1c2633 !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border,
[data-theme="dark"] .border-end,
[data-theme="dark"] .border-start,
.dark-mode .border-bottom,
.dark-mode .border-top,
.dark-mode .border,
.dark-mode .border-end,
.dark-mode .border-start {
    border-color: #313d4f !important;
}
/* Badges con fondo sutil */
[data-theme="dark"] .bg-primary-subtle,
.dark-mode .bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.2) !important;
    color: #8bb9fe !important;
}
[data-theme="dark"] .bg-danger-subtle,
.dark-mode .bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ea868f !important;
}
[data-theme="dark"] .bg-success-subtle,
.dark-mode .bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #75b798 !important;
}
[data-theme="dark"] .bg-warning-subtle,
.dark-mode .bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffda6a !important;
}
[data-theme="dark"] .bg-info-subtle,
.dark-mode .bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.2) !important;
    color: #6edff6 !important;
}
/* Accordion */
[data-theme="dark"] .accordion-item,
.dark-mode .accordion-item {
    background-color: #222e3c !important;
    border-color: #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .accordion-button,
.dark-mode .accordion-button {
    background-color: #222e3c !important;
    color: #e9ecef !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .accordion-button:not(.collapsed),
.dark-mode .accordion-button:not(.collapsed) {
    background-color: #1c2633 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .accordion-button::after,
.dark-mode .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}
[data-theme="dark"] .accordion-body,
.dark-mode .accordion-body {
    background-color: #222e3c !important;
    color: #e9ecef !important;
}
/* Footer */
[data-theme="dark"] .footer,
.dark-mode .footer {
    background-color: #222e3c !important;
    border-top: 1px solid #313d4f !important;
    color: #e9ecef !important;
}
/* Stats e Iconos */
[data-theme="dark"] .stat,
.dark-mode .stat {
    background-color: #1c2633 !important;
    color: #8bb9fe !important;
}
[data-theme="dark"] .stat .text-primary,
.dark-mode .stat .text-primary {
    color: #8bb9fe !important;
}
/* Tarjetas Hover */
.hover-card {
    border-radius: 12px !important;
    background: #ffffff;
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    text-decoration: none !important;
    overflow: hidden;
    position: relative;
    display: block;
}
.hover-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(220, 53, 69, 0.35) !important;
}
.hover-card .card-body {
    padding: 1.1rem 1.25rem;
    position: relative;
    z-index: 1;
}
.hover-card .icon-wrapper {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
    transition: all 0.25s ease;
    margin: 0;
}
.hover-card:hover .icon-wrapper {
    background-color: #dc3545;
    color: #ffffff;
    transform: scale(1.05);
}
.hover-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.3;
    transition: color 0.2s ease;
}
.hover-card:hover .card-title {
    color: #dc3545;
}
.hover-card .card-desc {
    font-size: 0.78rem;
    color: #6c757d;
    line-height: 1.25;
    margin-top: 3px;
    margin-bottom: 0;
}
.hover-card .arrow-indicator {
    color: #adb5bd;
    font-size: 0.9rem;
    transition: transform 0.25s ease, color 0.25s ease;
}
.hover-card:hover .arrow-indicator {
    transform: translateX(4px);
    color: #dc3545;
}
[data-theme="dark"] .hover-card,
.dark-mode .hover-card {
    background: #222e3c !important;
    border-color: #313d4f !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}
[data-theme="dark"] .hover-card:hover,
.dark-mode .hover-card:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(220, 53, 69, 0.5) !important;
}
[data-theme="dark"] .hover-card .icon-wrapper,
.dark-mode .hover-card .icon-wrapper {
    background-color: rgba(220, 53, 69, 0.18);
    color: #ff6b7a;
}
[data-theme="dark"] .hover-card:hover .icon-wrapper,
.dark-mode .hover-card:hover .icon-wrapper {
    background-color: #dc3545;
    color: #ffffff;
}
[data-theme="dark"] .hover-card .card-title,
.dark-mode .hover-card .card-title {
    color: #e9ecef !important;
}
[data-theme="dark"] .hover-card:hover .card-title,
.dark-mode .hover-card:hover .card-title {
    color: #ff6b7a !important;
}
[data-theme="dark"] .hover-card .card-desc,
.dark-mode .hover-card .card-desc {
    color: #adb5bd !important;
}
[data-theme="dark"] .hover-card .arrow-indicator,
.dark-mode .hover-card .arrow-indicator {
    color: #6c757d;
}
[data-theme="dark"] .hover-card:hover .arrow-indicator,
.dark-mode .hover-card:hover .arrow-indicator {
    color: #ff6b7a;
}
/* Chat e Historial (SAM-MI) */
[data-theme="dark"] #chat-history,
.dark-mode #chat-history {
    background-color: #1c2633 !important;
    border-color: #313d4f !important;
}
[data-theme="dark"] .chat-message,
.dark-mode .chat-message {
    background-color: #222e3c !important;
    border: 1px solid #313d4f !important;
    color: #e9ecef !important;
}
[data-theme="dark"] .chat-message.user-message,
.dark-mode .chat-message.user-message {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border-color: #0a58ca !important;
}
[data-theme="dark"] .chat-message .message-body,
.dark-mode .chat-message .message-body {
    color: #e9ecef !important;
}
[data-theme="dark"] .login-theme-toggle-wrapper,
.dark-mode .login-theme-toggle-wrapper {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1050;
}
[data-theme="dark"] .btn-login-theme-toggle,
.dark-mode .btn-login-theme-toggle {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #fbbf24 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .btn-login-theme-toggle:hover,
.dark-mode .btn-login-theme-toggle:hover {
    background: rgba(40, 53, 72, 0.95) !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
    color: #fef08a !important;
}
[data-theme="dark"] .login-container,
.dark-mode .login-container {
    background: rgba(30, 41, 59, 0.88) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-top: 4px solid var(--g4s-red) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}
[data-theme="dark"] .system-status-badge,
.dark-mode .system-status-badge {
    background: rgba(227, 6, 19, 0.16) !important;
    border: 1px solid rgba(227, 6, 19, 0.35) !important;
    color: #ff6b7a !important;
}
[data-theme="dark"] .login-title,
[data-theme="dark"] .login-container h1,
.dark-mode .login-title,
.dark-mode .login-container h1 {
    color: #ffffff !important;
}
[data-theme="dark"] .login-subtitle,
.dark-mode .login-subtitle {
    color: #94a3b8 !important;
}
[data-theme="dark"] .btn-google,
.dark-mode .btn-google {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .btn-google:hover,
.dark-mode .btn-google:hover {
    background: #283548 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] footer.login-footer,
.dark-mode footer.login-footer {
    background: rgba(15, 23, 42, 0.88) !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] footer.login-footer p,
.dark-mode footer.login-footer p {
    color: #94a3b8 !important;
}
[data-theme="dark"] footer.login-footer .social-icons a,
.dark-mode footer.login-footer .social-icons a {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] footer.login-footer .social-icons a:hover,
.dark-mode footer.login-footer .social-icons a:hover {
    background: var(--g4s-red) !important;
    border-color: var(--g4s-red) !important;
    color: #ffffff !important;
}
