/* =========================================================
   MODERN THEME OVERRIDE FOR ADMINLTE 2 & BOOTSTRAP 3
   ========================================================= */

/* GLOBAL FONT & BODY */
body {
    background-color: #f4f7f6;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333940;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
}

/* NAVBAR (TOP HEADER) RESTORE ORIGINALS */
.main-header .navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.main-header .logo {
    background-color: #ffffff !important;
    font-weight: 700;
    transition: width 0.3s ease-in-out;
    border-bottom: 1px solid #edf2f7 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.main-header .logo-lg img,
.main-header .logo-mini img {
    max-height: 48px !important;
    width: auto !important;
    margin: 0 auto;
    object-fit: contain;
    padding: 5px !important;
}

/* SIDEBAR (MAIN MENUS) */
.main-sidebar {
    background-color: #222d32;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.sidebar-menu > li > a {
    font-weight: 500;
    padding: 15px 15px 15px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}
.sidebar-menu > li:hover > a, .sidebar-menu > li.active > a {
    background-color: #1e282c;
    border-left-color: #f39c12; /* Brand accent color */
    color: #fff;
}
.sidebar-menu .treeview-menu {
    background-color: #1a2226;
    padding-left: 0;
}
.sidebar-menu .treeview-menu > li > a {
    color: #8aa4af;
    padding: 12px 15px 12px 20px;
    display: block;
    font-size: 14px;
    transition: all 0.2s ease;
}
.sidebar-menu .treeview-menu > li > a:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.05);
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.2) !important;
    background-color: #222d32 !important;
    width: 250px !important;
    padding: 10px 0;
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu > li > a {
    color: #b8c7ce !important; /* Force light text on collapse */
    padding: 10px 20px !important;
    white-space: normal !important;
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu > li > a:hover {
    color: #ffffff !important;
}

/* CONTENT BOXES (CARDS) */
.box {
    border-radius: 12px;
    border: none !important; /* Removes the top colored line */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
    background: #ffffff;
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}
.box:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.06), 0 3px 6px rgba(0, 0, 0, 0.03) !important;
}
.box-header.with-border {
    border-bottom: 1px solid #f0f2f5;
    padding: 15px 20px;
}
.box-title {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}
.box-body {
    padding: 20px;
}

/* BUTTONS */
.btn {
    border-radius: 6px !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-primary {
    background-color: #0d6efd !important;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: #0b5ed7 !important;
    box-shadow: 0 4px 8px rgba(13,110,253,0.3) !important;
}
.btn-success {
    background-color: #198754 !important;
}
.btn-success:hover, .btn-success:active, .btn-success:focus {
    background-color: #157347 !important;
    box-shadow: 0 4px 8px rgba(25,135,84,0.3) !important;
}
.btn-info {
    background-color: #0dcaf0 !important;
    color: #fff !important;
}
.btn-info:hover {
    background-color: #31d2f2 !important;
    box-shadow: 0 4px 8px rgba(13,202,240,0.3) !important;
}
.btn-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}
.btn-warning:hover {
    background-color: #ffca2c !important;
    box-shadow: 0 4px 8px rgba(255,193,7,0.3) !important;
}
.btn-danger {
    background-color: #dc3545 !important;
}
.btn-danger:hover {
    background-color: #bb2d3b !important;
    box-shadow: 0 4px 8px rgba(220,53,69,0.3) !important;
}
.btn-default {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #d3d9df !important;
}
.btn-default:hover {
    background-color: #e2e6ea !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05) !important;
}

/* BUTTON GROUPS (ACTIONS) */
.table .btn-group,
table.dataTable .btn-group {
    display: inline-flex !important;
    gap: 6px !important;
}
.table .btn-group > .btn,
table.dataTable .btn-group > .btn {
    border-radius: 6px !important;
    float: none !important;
    margin: 0 !important; /* Overrides Bootstrap's negative margins */
    position: relative !important;
}

/* FORMS AND INPUTS */
/* FORMS AND INPUTS */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
    height: 42px;
    padding: 10px 15px;
    font-size: 14px;
    color: #334155;
    background-color: #ffffff;
    transition: all 0.2s ease;
}
.form-control:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15) !important;
    outline: none;
    color: #0f172a;
}
select.form-control {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    height: auto !important;
    min-height: 42px;
}

/* INPUT GROUPS & ADDONS */
.input-group {
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    border-radius: 8px;
}
.input-group .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
    z-index: 2;
}
.input-group-addon {
    border-radius: 8px 0 0 8px !important;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-right: 0 !important;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 16px;
}
.input-group .form-control:focus {
    border-left: 1px solid #f97316 !important;
}
.form-group {
    margin-bottom: 15px;
}

/* FIX SELECT2 INSIDE INPUT GROUP AND GLOBAL STYLES */
.select2-container .select2-selection--single {
    height: 42px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 15px !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 10px !important;
}
.input-group .select2-container {
    width: 100% !important;
    display: table;
    table-layout: fixed;
}
.input-group .select2-container .select2-selection--single {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
}

/* Strip borders from dataTables wrapper */
table.dataTable.no-footer {
    border-bottom: 1px solid #edf2f7 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_length select {
    min-height: 38px !important;
    height: 38px !important;
    padding: 2px 12px !important;
    line-height: normal;
}

/* TABLES & DATATABLES */
.table {
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #edf2f7;
}
.table > thead > tr > th {
    background-color: #f8fafc !important;
    color: #000000 !important;
    font-weight: 700 !important;
    text-transform: none !important;
    font-size: 14px;
    padding: 10px 30px 10px 10px !important; /* Más espacio a la derecha para las flechas */
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
}
.table > tbody > tr > td {
    padding: 6px 10px !important;
    vertical-align: middle !important;
    color: #2d3748;
    border-top: 1px solid #edf2f7 !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #ffffff !important;
}
.table-striped > tbody > tr:nth-of-type(even) {
    background-color: #fcfcfd !important;
}
.table-hover > tbody > tr:hover {
    background-color: #f1f5f9 !important;
}

/* TABLE BUTTONS (MODERN LOOK) */
.table td .btn {
    padding: 8px 16px !important;
    font-size: 15px !important;
    line-height: 1.5;
}
.table td .btnActivar {
    border-radius: 20px !important;
    padding: 3px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    box-shadow: none !important;
}

/* Strip borders from dataTables wrapper */
table.dataTable.no-footer {
    border-bottom: 1px solid #edf2f7 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}

/* MODALS */
.modal-content {
    border-radius: 12px !important;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
    overflow: hidden;
}
.modal-dialog {
    margin-top: 5vh;
}
.modal-header {
    background: #ffffff !important; /* Force override inline blue */
    background-color: #ffffff !important;
    border-bottom: 1px solid #edf2f7 !important;
    padding: 24px;
    border-radius: 12px 12px 0 0 !important;
}
.modal-header .close {
    margin-top: -5px;
    font-size: 28px;
    color: #64748b !important;
    opacity: 0.7;
    text-shadow: none;
}
.modal-header .close:hover {
    color: #0f172a !important;
    opacity: 1;
}
.modal-title {
    font-weight: 600 !important;
    color: #1e293b !important; /* Force override inline white text */
    font-size: 20px;
}
.modal-body {
    padding: 24px;
    background-color: #ffffff;
}
.modal-footer {
    border-top: 1px solid #edf2f7 !important;
    background-color: #f8fafc !important;
    padding: 16px 24px;
    border-radius: 0 0 12px 12px !important;
}

/* SMALL BOXES (DASHBOARD STATS) */
.small-box {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    transition: transform 0.3s ease;
    overflow: hidden;
}
.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
}
.small-box > .inner {
    padding: 20px;
}
.small-box h3 {
    font-size: 32px;
    font-weight: 700;
}
.small-box p {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}
.small-box .icon {
    opacity: 0.2;
    transition: all 0.3s ease;
}
.small-box:hover .icon {
    font-size: 85px;
    opacity: 0.3;
}

/* BREADCRUMB */
.content-header > .breadcrumb {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
}
.content-header > h1 {
    font-weight: 600;
    font-size: 24px;
    color: #2c3e50;
}

/* ALERTS & BADGES */
.alert {
    border-radius: 8px !important;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.badge {
    padding: 5px 8px;
    border-radius: 4px !important;
    font-weight: 500;
}

/* MAIN FOOTER (GLOBAL) */
.main-footer {
    background-color: #ffffff !important;
    border-top: 1px solid #edf2f7 !important;
    padding: 20px 25px !important;
    color: #64748b !important;
    font-size: 13px !important;
    transition: all 0.3s ease;
}
.main-footer strong {
    font-weight: 600 !important;
    color: #475569 !important;
}
.main-footer a {
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.2s ease;
}
.main-footer a:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* AMPLIAR BUSCADOR DE DATATABLES GLOBLAMENTE */
.dataTables_filter input[type="search"] {
    width: 300px !important; /* El triple del normal aproximadamente */
    max-width: 100%;
}

/* PAGINATION BRAND ORANGE OVERRIDE */
.pagination > .active > a, 
.pagination > .active > span, 
.pagination > .active > a:hover, 
.pagination > .active > span:hover, 
.pagination > .active > a:focus, 
.pagination > .active > span:focus {
    background-color: #f39c12 !important;
    border-color: #e08e0b !important;
    color: #ffffff !important;
}

/* NAV-TABS CUSTOM BRAND ORANGE OVERRIDE */
.nav-tabs-custom > .nav-tabs > li.active {
    border-top-color: #f39c12 !important;
}
.nav-tabs-custom > .nav-tabs > li.active > a, 
.nav-tabs-custom > .nav-tabs > li.active > a:hover {
    color: #f39c12 !important;
    font-weight: 600;
}
