/* ================================================================
   IntegraliX Modern UI — Override layer
   Mantiene violeta pero moderniza todo el UI
   ================================================================ */

/* ---- Variables (simuladas con valores fijos, PHP 5.6 / sin CSS vars) ---- */

/* Paleta violeta moderna:
   Primary:      #6D28D9  (violet-700)
   Primary dark: #4C1D95  (violet-900)
   Primary mid:  #7C3AED  (violet-600)
   Primary soft: #EDE9FE  (violet-100)
   Accent:       #A78BFA  (violet-400)
   Sidebar bg:   #1E1B4B  (indigo muy oscuro)
   Sidebar text: #C4B5FD  (violet-300)
*/

/* ================================================================
   TIPOGRAFÍA GLOBAL
   ================================================================ */
html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Roboto', 'Open Sans', sans-serif;
    font-size: 13px;
    color: #374151 !important;
    background: #F3F4F6 !important;
}

/* Wrapper cubre toda la altura del documento */
#wrapper {
    min-height: 100%;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #1F2937;
}

/* ================================================================
   SIDEBAR / MENÚ LATERAL
   Color unificado — un solo tono, sin saltos de contraste
   Base: #2E2860  (púrpura oscuro suave)
   Header: #382E72 (5% más claro, misma familia)
   ================================================================ */
.navbar-default {
    background-color: transparent;
    border-color: transparent;
}

/* Sidebar siempre fijo — cubre toda la altura aunque el contenido sea largo */
.navbar-static-side,
nav.navbar-static-side,
.navbar-default.navbar-static-side {
    background: #2E2860 !important;
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100% !important;
    width: 220px;
    z-index: 2001;
    overflow-y: auto;
    overflow-x: hidden;
}

.navbar-static-side .sidebar-collapse,
#side-menu {
    background: #2E2860;
}

/* Page wrapper siempre con margen izquierdo correcto */
#page-wrapper {
    margin-left: 220px !important;
}

/* Mini-navbar: sidebar de 70px, page-wrapper ajustado */
body.mini-navbar .navbar-static-side,
body.mini-navbar nav.navbar-static-side {
    width: 70px !important;
}

body.mini-navbar #page-wrapper {
    margin-left: 70px !important;
}

/* ---- HEADER: mismo tono, solo un poco más oscuro + borde sutil ---- */
li.nav-header {
    padding: 18px 18px 12px 18px !important;
    background: #241E52 !important;
    border-bottom: 1px solid rgba(167, 139, 250, 0.12);
    margin-bottom: 0;
}

/* Eliminar márgenes Bootstrap del h2 */
li.nav-header h2,
li.nav-header .logo-name {
    margin: 0 0 4px 0 !important;
    line-height: 1.2;
}

li.nav-header .profile-element,
li.nav-header .dropdown {
    padding: 0;
    margin: 0;
    display: block;
}

/* Logo-element: solo visible en mini-navbar */
.logo-element {
    display: none !important;
}

/* ---- MINI-NAVBAR: logo iX centrado y elegante ---- */
body.mini-navbar li.nav-header {
    padding: 0 !important;
    background: #241E52 !important;
    border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}

body.mini-navbar .logo-element {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 54px;
    width: 100%;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #EDE9FE;
    background: transparent;
    text-decoration: none;
}

body.mini-navbar .logo-element a {
    color: #EDE9FE;
    text-decoration: none;
    font-weight: 800;
}

.pace-done .nav-header {
    transition: all 0.3s ease;
}

/* ---- Logo nombre y textos ---- */
.logo-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #EDE9FE !important;
    margin-bottom: 4px;
}

.logo-name a,
.logo-name a:hover {
    color: #EDE9FE !important;
    text-decoration: none;
}

li.nav-header .text-muted {
    color: rgba(196, 181, 253, 0.75) !important;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ---- Items de menú — primer nivel ---- */
.navbar-static-side .nav > li > a {
    color: #C4B5FD;
    font-weight: 500;
    padding: 11px 20px 11px 20px;
    font-size: 12.5px;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-static-side .nav > li > a:hover,
.navbar-default.navbar-static-side .nav > li > a:hover,
.navbar-default.navbar-static-side .nav > li > a:focus {
    background-color: rgba(255, 255, 255, 0.07);
    color: #EDE9FE;
    border-left-color: rgba(167, 139, 250, 0.6);
}

.navbar-static-side .nav > li > a i {
    margin-right: 8px;
    font-size: 13px;
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.navbar-static-side .nav > li > a:hover i {
    opacity: 1;
}

/* Item activo: borde izquierdo + fondo muy sutil */
.navbar-static-side .nav > li.active > a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-left: 3px solid #A78BFA;
    font-weight: 600;
}

.navbar-static-side .nav > li.active > a i {
    opacity: 1;
}

.navbar-static-side .nav > li.active {
    border-left: none;
    background: transparent;
}

/* ---- Sub-menús abiertos: ligeramente más oscuros ---- */
.navbar-static-side .nav > li.open > .nav-second-level,
.navbar-static-side .nav-second-level {
    background: rgba(0, 0, 0, 0.15);
}

/* ---- Segundo y tercer nivel ---- */
.navbar-static-side .nav-second-level li a,
.navbar-static-side .nav-third-level li a {
    color: rgba(196, 181, 253, 0.8);
    font-size: 12px;
    padding: 8px 10px 8px 34px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-static-side .nav-second-level li a:hover,
.navbar-static-side .nav-third-level li a:hover {
    color: #EDE9FE;
    background-color: rgba(255, 255, 255, 0.07);
    border-left-color: rgba(167, 139, 250, 0.5);
}

.navbar-static-side .nav-second-level li.active a,
.navbar-static-side .nav-third-level li.active a {
    color: #EDE9FE;
    font-weight: 600;
    border-left-color: #A78BFA;
}

/* ---- Scrollbar del sidebar ---- */
.navbar-static-side .sidebar-collapse {
    overflow-y: auto;
    overflow-x: hidden;
}

.navbar-static-side .sidebar-collapse::-webkit-scrollbar {
    width: 3px;
}
.navbar-static-side .sidebar-collapse::-webkit-scrollbar-track {
    background: transparent;
}
.navbar-static-side .sidebar-collapse::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.25);
    border-radius: 3px;
}
.navbar-static-side .sidebar-collapse::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.45);
}

/* ================================================================
   TOPBAR / NAVBAR SUPERIOR
   ================================================================ */
#page-wrapper {
    background: #F3F4F6;
}

.navbar-static-top {
    background: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.navbar-top-links li a {
    color: #6B7280;
    transition: color 0.2s;
}

.navbar-top-links li a:hover {
    color: #6D28D9;
    background-color: transparent;
}

.minimalize-styl-2 {
    color: #6B7280;
    transition: color 0.2s;
}

.minimalize-styl-2:hover {
    color: #6D28D9;
}

/* ================================================================
   PÁGINA / WRAPPER PRINCIPAL
   ================================================================ */
.wrapper-content {
    padding: 20px 20px 40px;
}

/* ================================================================
   CARDS / IBOX PANELS
   ================================================================ */
.ibox {
    clear: both;
    margin-bottom: 20px;
    margin-top: 0;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    transition: box-shadow 0.2s ease;
}

.ibox:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
}

.ibox-title {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 20px;
    min-height: 48px;
    border-radius: 10px 10px 0 0;
}

.ibox-title h5 {
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    letter-spacing: 0.2px;
    margin-bottom: 0;
}

.ibox-title h5 i {
    color: #7C3AED;
    margin-right: 6px;
}

.ibox-title .ibox-tools {
    float: right;
    margin-top: -2px;
}

.ibox-tools a {
    color: #9CA3AF;
    transition: color 0.2s;
    margin-left: 4px;
}

.ibox-tools a:hover {
    color: #6D28D9;
}

.ibox-content {
    padding: 18px 20px;
    background: #FFFFFF;
    border-color: #E5E7EB;
}

/* Panel / panel-heading Bootstrap */
.panel {
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.panel-heading {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    padding: 12px 18px;
    font-weight: 600;
    color: #1F2937;
    font-size: 13px;
}

.panel-body {
    padding: 18px;
}

/* ================================================================
   BOTONES
   ================================================================ */
.btn {
    border-radius: 7px;
    font-weight: 500;
    font-size: 12.5px;
    padding: 6px 14px;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    border-width: 1px;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}

/* Primary — violeta */
.btn-primary {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    border-color: #6D28D9;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
    background: linear-gradient(135deg, #6D28D9 0%, #5B21B6 100%);
    border-color: #5B21B6;
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(109, 40, 217, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary {
    background: #8B5CF6;
    border-color: #8B5CF6;
    opacity: 0.65;
}

/* Success — verde esmeralda */
.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: #059669;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* Warning — ámbar */
.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-color: #D97706;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    border-color: #B45309;
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* Danger — rojo */
.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border-color: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    border-color: #B91C1C;
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* Info — azul */
.btn-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    border-color: #1D4ED8;
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Default */
.btn-default {
    background: #FFFFFF;
    border-color: #D1D5DB;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-default:hover,
.btn-default:focus {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #1F2937;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Outline primary */
.btn-primary.btn-outline {
    color: #6D28D9;
    background: transparent;
    border-color: #7C3AED;
}

.btn-primary.btn-outline:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    color: #FFFFFF;
}

/* Botón redondeado */
.btn-rounded {
    border-radius: 50px;
    padding: 6px 18px;
}

/* Small */
.btn-sm {
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 6px;
}

/* XSmall */
.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 5px;
}

/* ================================================================
   FORMULARIOS / INPUTS
   ================================================================ */
.form-control {
    border-radius: 7px;
    border: 1px solid #D1D5DB;
    font-size: 13px;
    color: #374151;
    padding: 7px 12px;
    height: 36px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #FFFFFF;
}

.form-control:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    outline: none;
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    background: #F9FAFB;
    color: #6B7280;
    border-color: #E5E7EB;
    opacity: 1;
}

.form-group label {
    font-weight: 600;
    font-size: 12px;
    color: #374151;
    margin-bottom: 5px;
    display: block;
}

/* Select2 / bootstrap-select */
.bootstrap-select .btn {
    border-radius: 7px;
    border: 1px solid #D1D5DB;
    font-size: 13px;
    height: 36px;
    color: #374151;
    padding: 6px 12px;
    box-shadow: none;
    background: #FFFFFF;
}

.bootstrap-select .btn:focus {
    border-color: #7C3AED !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
    outline: none !important;
}

.bootstrap-select .dropdown-menu > li > a:hover,
.bootstrap-select .dropdown-menu > li > a:focus {
    background-color: #EDE9FE;
    color: #6D28D9;
}

.bootstrap-select .dropdown-menu > .selected > a,
.bootstrap-select .dropdown-menu > .active > a {
    background-color: #6D28D9;
    color: #FFFFFF;
}

/* Input groups */
.input-group-addon {
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    color: #6B7280;
    border-radius: 7px 0 0 7px;
    font-size: 13px;
}

.input-group-btn .btn {
    border-radius: 0 7px 7px 0;
}

/* Checkbox y radio modernos */
.checkbox label,
.radio label {
    font-weight: 400;
    color: #374151;
    padding-left: 24px;
    font-size: 13px;
    cursor: pointer;
}

/* ================================================================
   TABLAS
   ================================================================ */
.table {
    font-size: 12.5px;
    color: #374151;
}

.table > thead > tr > th {
    background: #F5F3FF;
    color: #5B21B6;
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 2px solid #DDD6FE;
    border-top: none;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 9px 14px;
    vertical-align: middle;
    border-top: 1px solid #F3F4F6;
    background: #FFFFFF;
    transition: background 0.15s;
}

.table > tbody > tr:hover > td,
table.table tr:hover td {
    background: #F5F3FF !important;
    cursor: pointer;
}

/* Filas alternas muy sutiles */
.table-striped > tbody > tr:nth-child(odd) > td {
    background: #FAFAFA;
}

.table-striped > tbody > tr:nth-child(odd):hover > td {
    background: #F5F3FF !important;
}

/* Bordes de tabla */
.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border: 1px solid #E5E7EB;
}

/* DataTables header sort */
table.dataTable thead th,
table.dataTable thead td {
    background: #F5F3FF;
    color: #5B21B6;
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #DDD6FE !important;
    padding: 10px 14px !important;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    color: #7C3AED;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #6D28D9 !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #EDE9FE !important;
    color: #6D28D9 !important;
    border: 1px solid #DDD6FE !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 7px;
    border: 1px solid #D1D5DB;
    padding: 4px 8px;
    font-size: 12.5px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    outline: none;
}

/* ================================================================
   LABELS / BADGES
   ================================================================ */
.label {
    border-radius: 20px;
    font-weight: 600;
    font-size: 10.5px;
    padding: 3px 9px;
    letter-spacing: 0.3px;
}

.label-primary,
.badge-primary {
    background: #EDE9FE;
    color: #5B21B6;
}

.label-success,
.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.label-warning,
.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.label-danger,
.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.label-info,
.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.label-default,
.badge-default {
    background: #F3F4F6;
    color: #6B7280;
}

.badge {
    border-radius: 20px;
    font-weight: 600;
    font-size: 10px;
    padding: 3px 8px;
    background: #7C3AED;
    color: #FFFFFF;
}

/* ================================================================
   ALERTS
   ================================================================ */

/* Flash message container: fixed at top, starts after the fixed sidebar */
#flash-container {
    position: fixed;
    top: 12px;
    right: 16px;
    left: auto;
    width: auto;
    max-width: 340px;
    z-index: 10000;
}
body.mini-navbar #flash-container {
    left: auto;
}
#flash-container .message,
#flash-container .alert {
    margin: 0 0 8px 0;
    border-radius: 8px;
    padding: 10px 32px 10px 14px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    cursor: pointer;
}

.alert {
    border-radius: 8px;
    border-width: 1px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
}

.alert-warning {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #92400E;
}

.alert-danger {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.alert-info {
    background: #DBEAFE;
    border-color: #93C5FD;
    color: #1E40AF;
}

/* ================================================================
   MODALES
   ================================================================ */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #4C1D95 0%, #6D28D9 100%);
    color: #FFFFFF;
    padding: 16px 24px;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 15px;
    color: #FFFFFF;
}

.modal-header .close {
    color: rgba(255,255,255,0.8);
    text-shadow: none;
    opacity: 1;
    font-size: 22px;
    transition: color 0.2s;
}

.modal-header .close:hover {
    color: #FFFFFF;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 14px 24px;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    border-radius: 0 0 12px 12px;
}

/* ================================================================
   DROPDOWN
   ================================================================ */
.dropdown-menu {
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    padding: 6px;
    margin-top: 4px;
    font-size: 13px;
}

.dropdown-menu > li > a {
    border-radius: 6px;
    padding: 7px 12px;
    color: #374151;
    font-weight: 500;
    transition: all 0.15s;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background: #EDE9FE;
    color: #6D28D9;
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
    background: #6D28D9;
    color: #FFFFFF;
}

.dropdown-menu > .divider {
    margin: 4px 0;
    background: #E5E7EB;
}

/* ================================================================
   BREADCRUMB
   ================================================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 16px;
    font-size: 12px;
}

.breadcrumb > .active {
    color: #6D28D9;
    font-weight: 600;
}

.breadcrumb > li + li:before {
    color: #9CA3AF;
    content: "\f054";
    font-family: FontAwesome;
    font-size: 9px;
    vertical-align: middle;
    padding: 0 6px;
}

/* ================================================================
   TOASTR
   ================================================================ */
#toast-container .toast {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 12px 16px;
    opacity: 1;
}

#toast-container .toast-success {
    background: #059669;
}

#toast-container .toast-error {
    background: #DC2626;
}

#toast-container .toast-warning {
    background: #D97706;
}

#toast-container .toast-info {
    background: #6D28D9;
}

/* ================================================================
   PAGINACIÓN
   ================================================================ */
.pagination > li > a,
.pagination > li > span {
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1px solid #E5E7EB;
    color: #6D28D9;
    font-size: 12.5px;
    padding: 5px 11px;
    transition: all 0.2s;
}

.pagination > li > a:hover {
    background: #EDE9FE;
    border-color: #DDD6FE;
    color: #5B21B6;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    border-color: #6D28D9;
    color: #FFFFFF;
}

/* ================================================================
   TABS
   ================================================================ */
.nav-tabs > li > a {
    border-radius: 7px 7px 0 0;
    color: #6B7280;
    font-weight: 500;
    padding: 9px 16px;
    font-size: 13px;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tabs > li > a:hover {
    color: #6D28D9;
    background: #F5F3FF;
    border-color: transparent;
    border-bottom-color: #DDD6FE;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
    color: #6D28D9;
    background: #FFFFFF;
    border: none;
    border-bottom: 2px solid #7C3AED;
    font-weight: 600;
}

.tab-content {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
}

/* ================================================================
   PROGRESS BARS
   ================================================================ */
.progress {
    border-radius: 20px;
    height: 8px;
    background: #E5E7EB;
    box-shadow: none;
}

.progress-bar {
    border-radius: 20px;
    background: linear-gradient(90deg, #7C3AED, #A78BFA);
    box-shadow: none;
    transition: width 0.4s ease;
}

.progress-bar-success {
    background: linear-gradient(90deg, #059669, #10B981);
}

.progress-bar-warning {
    background: linear-gradient(90deg, #D97706, #F59E0B);
}

.progress-bar-danger {
    background: linear-gradient(90deg, #DC2626, #EF4444);
}

.progress-bar-info {
    background: linear-gradient(90deg, #2563EB, #3B82F6);
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.loginColumns {
    max-width: 420px;
    margin: 80px auto;
}

/* ================================================================
   SWEET ALERT
   ================================================================ */
.sweet-alert {
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.sweet-alert h2 {
    color: #1F2937;
    font-weight: 700;
    font-size: 20px;
}

.sweet-alert .sa-button-container .cancel {
    border-radius: 7px;
}

.sweet-alert .sa-button-container .confirm {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%) !important;
    border-radius: 7px;
    box-shadow: none !important;
}

/* ================================================================
   HOLD ON (loading overlay)
   ================================================================ */
.holdon-overlay {
    background: rgba(30, 27, 75, 0.75);
}

/* ================================================================
   SCROLLBAR GLOBAL
   ================================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F3F4F6;
}
::-webkit-scrollbar-thumb {
    background: #C4B5FD;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8B5CF6;
}

/* ================================================================
   ELEMENTOS VARIOS
   ================================================================ */
hr {
    border-top: 1px solid #E5E7EB;
    margin: 16px 0;
}

.text-navy,
.text-primary {
    color: #6D28D9 !important;
}

.text-muted {
    color: #9CA3AF !important;
}

a {
    color: #6D28D9;
    transition: color 0.2s;
}

a:hover {
    color: #5B21B6;
    text-decoration: none;
}

/* Sombras de tarjetas stat */
.widget {
    border-radius: 10px;
    padding: 20px;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* Page header */
.page-heading {
    padding: 0 0 16px 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 20px;
}

.page-heading h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}

/* ================================================================
   ANIMACIONES GENERALES
   ================================================================ */
.ibox,
.btn,
.form-control,
.dropdown-menu,
.panel {
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .wrapper-content {
        padding: 12px 12px 30px;
    }

    .ibox-title {
        padding: 12px 14px;
    }

    .ibox-content {
        padding: 14px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }
}

/* ================================================================
   RESPONSIVE — MENÚ DRAWER + TABLAS
   Umbral 991px coincide con el JS (body-small < 992px)
   ================================================================ */
@media (max-width: 991px) {

    /* ── Sidebar: drawer cerrado por defecto ── */
    body.body-small .navbar-static-side,
    body.body-small nav.navbar-static-side {
        display: block !important;
        position: fixed !important;
        width: 220px !important;
        z-index: 2200 !important;
        transform: translateX(-220px);
        visibility: hidden;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0s linear 0.28s;
    }

    /* Drawer abierto */
    body.body-small.mini-navbar .navbar-static-side,
    body.body-small.mini-navbar nav.navbar-static-side {
        transform: translateX(0) !important;
        visibility: visible;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0s linear 0s;
    }

    /* Page wrapper siempre full-width en móvil */
    body.body-small #page-wrapper,
    body.body-small.mini-navbar #page-wrapper {
        margin-left: 0 !important;
    }

    /* ── Sidebar en modo COMPLETO dentro del drawer ── */
    body.body-small.mini-navbar .nav-label,
    body.body-small.mini-navbar .navbar-default .nav li a span {
        display: inline !important;
    }

    body.body-small.mini-navbar .navbar-default .nav > li > a {
        padding: 13px 20px 13px 25px !important;
    }

    /* Submenús inline — sin flyout */
    body.body-small.mini-navbar .nav-second-level,
    body.body-small.mini-navbar .nav:not(.nav-second-level) > li > .nav-second-level {
        position: static !important;
        left: auto !important;
        top: auto !important;
        display: block;
        padding-left: 16px;
        background: rgba(0, 0, 0, 0.12);
    }

    body.body-small.mini-navbar .nav-second-level > li > a {
        padding: 9px 20px 9px 30px !important;
        font-size: 12px;
    }

    body.body-small .logo-element,
    body.body-small.mini-navbar .logo-element {
        display: none !important;
    }

    /* ── Backdrop ── */
    #ix-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.48);
        z-index: 2100;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    body.body-small.mini-navbar #ix-sidebar-backdrop {
        display: block;
    }

    /* ── Grid Bootstrap: resetear col-sm-* a ancho completo ──
       Sin sidebar (margin-left:0), el contenido es full-width en este rango.
       Bootstrap activa col-sm a ≥768px pero nosotros tratamos <992px como móvil. ── */
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4,
    .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8,
    .col-sm-9, .col-sm-10, .col-sm-11 {
        width: 100% !important;
        float: none !important;
    }

    /* Excepción: columnas que deben mantenerse en dos por fila (pares de col-sm-6) */
    .col-xs-6.col-sm-6 {
        width: 50% !important;
        float: left !important;
    }

    /* ── Tablas: scroll horizontal estético ── */
    .ibox {
        overflow: visible !important;
    }

    .ibox-content {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #7C3AED #EDE9FE;
    }

    .ibox-content::-webkit-scrollbar { height: 5px; }
    .ibox-content::-webkit-scrollbar-track { background: #EDE9FE; border-radius: 3px; }
    .ibox-content::-webkit-scrollbar-thumb { background: #7C3AED; border-radius: 3px; }

    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: none;
        scrollbar-width: thin;
        scrollbar-color: #7C3AED #EDE9FE;
    }

    .table-responsive::-webkit-scrollbar { height: 5px; }
    .table-responsive::-webkit-scrollbar-track { background: #EDE9FE; border-radius: 3px; }
    .table-responsive::-webkit-scrollbar-thumb { background: #7C3AED; border-radius: 3px; }

    .ibox-content .table,
    .ibox-content .table-bordered,
    .ibox-content .table-striped {
        min-width: 500px;
        margin-bottom: 4px;
    }

    .ibox-content::after {
        content: '← desliza →';
        display: block;
        text-align: center;
        font-size: 10px;
        color: #A78BFA;
        letter-spacing: 1px;
        padding: 2px 0 0;
        opacity: 0.8;
    }
}
