/* ==========================================================================
   1. CSS VARIABLES (THEME COLORS)
   ========================================================================== */
:root {
    --primary: #721c24 !important;
    --primary-hover: #5c161d !important;
    --secondary: #68696f !important;
    --secondary-hover: #55565b !important;
}

/* ==========================================================================
   2. BASE & TYPOGRAPHY
   ========================================================================== */
html {
    font-size: 13px !important;
}

html, body {
    margin: 0;
    height: 100%;
    font-weight: 400;
    line-height: 1.4 !important;
    color: #212529;
    text-align: left;
    background-color: transparent !important;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   3. LAYOUT & WRAPPERS
   ========================================================================== */
.wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    height: auto !important;
    position: absolute;
}

.content-wrapper {
    background-color: unset !important;
    flex: 1 0 auto;
}

.main-footer {
    flex-shrink: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #000; }

/* ==========================================================================
   4. PAGE TITLES & BREADCRUMBS
   ========================================================================== */
.page-title {
    animation: fadeInUp 0.6s ease-in-out;
    display: block !important;
    width: 100% !important;
    margin-bottom: auto !important;
    height: auto !important;
}

.page-title .breadcrumb {
    margin-bottom: 0 !important;
    letter-spacing: 1px !important;
    white-space: normal !important;
}

.content-header .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a { color: #6c757d; text-decoration: none; transition: color 0.3s ease; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--primary); font-weight: 500; }

@media (max-width: 767.98px) {
    .page-title { font-size: 1.25rem !important; }
}

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

/* ==========================================================================
   5. BOOTSTRAP OVERRIDES (Buttons, Badges, Colors)
   ========================================================================== */
/* Text & Background Utilities */
.text-primary { color: var(--primary) !important; }
.text-primary:hover { color: var(--primary-hover) !important; }
.bg-primary { background-color: var(--primary) !important; color: white; }
.border-primary { border-color: var(--primary) !important; }

.text-secondary { color: var(--secondary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.border-secondary { border-color: var(--secondary) !important; }

/* Global Button Animation (Premium Lift Effect) */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.btn:hover:not(.disabled):not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}
.btn:active:not(.disabled):not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1) !important;
}

/* Buttons - Primary */
.btn-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; color: #fff !important;
}
.btn-outline-primary { background-color: transparent !important; border-color: var(--primary) !important; color: var(--primary) !important; }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; color: #fff !important;
}
.btn-primary:disabled, .btn-outline-primary:disabled { opacity: 0.65 !important; background-color: var(--primary) !important; color: #fff !important; }

/* Buttons - Secondary */
.btn-secondary { background-color: var(--secondary) !important; border-color: var(--secondary) !important; color: #fff !important; }
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active, .btn-secondary:not(:disabled):not(.disabled):active {
    background-color: var(--secondary-hover) !important; border-color: var(--secondary-hover) !important; color: #fff !important;
}
.btn-outline-secondary { color: var(--secondary); border-color: var(--secondary); }
.btn-outline-secondary:hover { background-color: var(--secondary); border-color: var(--secondary); color: #ffffff; }

/* Buttons - Warning (Dark text for contrast) */
.btn-warning, a.btn-warning, button.btn-warning { color: #212529 !important; }
.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .btn-warning:not(:disabled):not(.disabled):active, a.btn-warning:hover {
    color: #212529 !important;
}
.btn-outline-warning { color: var(--warning) !important; border-color: var(--warning) !important; background-color: transparent !important; }
.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active {
    background-color: var(--warning) !important; border-color: var(--warning) !important; color: #212529 !important;
}

/* Badges & Pagination */
.badge-primary { background-color: var(--primary); color: #fff !important; }
.badge-primary:hover, .badge-primary:focus, .badge-primary.active { background-color: var(--primary-hover) !important; color: #fff !important; }
.badge-secondary { background-color: var(--secondary); }
.pagination .page-item.active .page-link { background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; color: #fff !important; }
.pagination .page-item.active .page-link:hover { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.list-group-item.active { background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; color: #fff !important; }
.list-group-item.active:hover { background-color: var(--primary) !important; border-color: var(--primary) !important; }

/* Progress Bars */
.progress-bar-animated { animation: 1s linear infinite progress-bar-stripes !important; }
.progress-bar { transition: width .6s ease !important; }

/* Nav-Pills */
.nav-pills .nav-link {
    color: #495057;
    background-color: #f1f3f5;
    border: 1px solid #e9ecef;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    margin: 0 0.25rem;
}
.nav-pills .nav-link:not(.active):hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
    color: var(--primary);
    cursor: pointer;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #ffffff !important;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.nav-pills .nav-item { border: none !important; background-color: transparent !important; }

/* ==========================================================================
   6. ALERTS & FLASH MESSAGES
   ========================================================================== */
div.alert {
    border: none !important;
    border-left: 5px solid !important;
    border-radius: 8px !important;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

div.alert .alert-heading {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: inherit;
}

div.alert ul { margin-bottom: 0; padding-left: 1.5rem; }
div.alert ul li { margin-bottom: 0.25rem; font-size: 0.95rem; }
div.alert ul li:last-child { margin-bottom: 0; }
div.alert p { margin-bottom: 0; }

div.alert.alert-warning { color: #856404 !important; background-color: #fff3cd !important; border-left-color: #ffc107 !important; }
div.alert.alert-danger { color: #721c24 !important; background-color: #f8d7da !important; border-left-color: #dc3545 !important; }
div.alert.alert-success { color: #155724 !important; background-color: #d4edda !important; border-left-color: #28a745 !important; }
div.alert.alert-info { color: #0c5460 !important; background-color: #d1ecf1 !important; border-left-color: #17a2b8 !important; }
div.alert.alert-primary { color: var(--white) !important; background-color: var(--primary) !important; border-left-color: var(--primary) !important; }

/* Web2py Flash Specifics */
.w2p_flash {
    position: fixed;
    top: 70px;
    right: 20px;
    max-width: 400px;
    z-index: 1050 !important;
}
.w2p_flash.alert {
    border-left: 0 !important;
    padding: 0.75rem 1.25rem !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    margin-bottom: 0 !important;
}
.w2p_flash.alert:hover {
    transform: translateY(1px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}
#closeflash { display: none; }

/* ==========================================================================
   7. NAVBAR & GENTELELLA SIDEBAR
   ========================================================================== */
.navbar { background-color: var(--primary) !important; color: #cfcece !important; }
.navbar .navbar-nav .nav-link { color: #cfcece !important; padding: 0.75rem 1rem !important; font-weight: bold !important; text-transform: uppercase !important; display: inline-block !important; }
.navbar .navbar-nav .nav-link:hover, .navbar .navbar-nav .nav-item:hover { background-color: var(--primary-hover) !important; color: #ffffff !important; border-radius: 15px !important; }
.navbar .navbar-nav .nav-item.active .nav-link, .navbar .navbar-nav .nav-link.active { background-color: var(--primary-hover) !important; color: #cfcece !important; border-radius: 15px !important; }
.navbar .navbar-nav .dropdown-menu { background-color: var(--primary) !important; border-radius: 10px !important; }
.navbar .navbar-nav .dropdown-item { color: #cfcece !important; padding: 0.75rem 1.25rem !important; transition: background-color 0.3s ease, color 0.3s ease; }
.navbar .navbar-nav .dropdown-item:hover { background-color: var(--primary-hover) !important; color: #fff !important; border-radius: 20px !important; }
.navbar .navbar-nav .dropdown-item.active { background-color: var(--primary-hover) !important; color: #cfcece !important; }
.navbar-toggler { border-color: var(--secondary) !important; }
.navbar-toggler-icon { color: #cfcece !important; }

/* Sidebar Background */
.nav_title, .left_col, body.nav-md .container.body .col-md-3.left_col { background: var(--primary) !important; }

/* Active Menu Item */
.nav.side-menu > li.active > a {
    text-shadow: rgba(0, 0, 0, 0.25) 0 -1px 0;
    background: linear-gradient(var(--primary-hover), var(--primary)), var(--primary) !important;
    box-shadow: rgba(0, 0, 0, 0.25) 0 1px 0, inset rgba(255, 255, 255, 0.16) 0 1px 0 !important;
}

/* Gentelella Active Border Override */
.nav.side-menu > li.active, .nav.side-menu > li.current-page { border-right: 5px solid var(--warning) !important; }

/* Child Menu */
.nav-md ul.nav.child_menu { border-bottom: 1px solid var(--primary) !important; }
.nav.child_menu > li > a { color: #cfcece !important; }
.nav.child_menu > li > a:hover, .nav.child_menu > li.active > a, .nav.child_menu > li.current-page > a {
    background-color: var(--primary) !important; color: #ffffff !important; font-weight: bold;
}
.nav-md ul.nav.child_menu li::before { background: var(--secondary) !important; }
.nav-md ul.nav.child_menu li::after { border-left: 1px solid var(--secondary) !important; }
.nav-item { font-weight: bold; }

/* Footer */
footer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
footer > .text-center { width: 100%; float: none !important; margin: 0 !important; }
footer > .clearfix { display: none !important; }

/* ==========================================================================
   8. ICONS ALIGNMENT
   ========================================================================== */
.material-symbols-outlined {
    font-size: 1.5rem !important;
    vertical-align: middle !important;
}
.fa-xl {
    font-size: 1.6666em;
    line-height: 1.1em;
    vertical-align: -30%;
}

/* Expanded Sidebar Perfect Alignment */
body.nav-md .nav.side-menu > li > a { display: flex !important; align-items: center !important; padding: 13px 15px !important; font-size: 1.1rem !important; }
body.nav-md .nav.side-menu > li > a .material-symbols-outlined { margin: 0 10px 0 0 !important; font-size: 1.3rem !important; }
body.nav-md .nav.side-menu > li > a .fa-chevron-down { margin-left: auto !important; }

/* Collapsed Sidebar Stacking */
body.nav-sm .nav.side-menu > li > a { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; text-align: center !important; font-weight: 400 !important; font-size: 10px !important; padding: 12px 5px !important; }
body.nav-sm .nav.side-menu > li > a .material-symbols-outlined { margin: 0 0 5px 0 !important; font-size: 26px !important; width: auto !important; }
body.nav-sm .nav.side-menu > li > a .fa-chevron-down { display: none !important; }

/* ==========================================================================
   9. WEB2PY FORMS & DATAGRIDS
   ========================================================================== */
/* Web2py Tables */
.web2py_table table { width: 100% !important; table-layout: auto; }
.web2py_table th a { color: black; }
.table-primary, .table-primary>td, .table-primary>th { background-color: var(--primary) !important; color: white !important; border-color: rgba(255, 255, 255, .25) !important; }
td.button.nav { display: table-cell !important; }
.table td, .table th { vertical-align: middle; }

/* Action Buttons */
.web2py_table a.buttondelete { background-color: var(--danger); color: white; border: none; }
.web2py_table a.buttonedit { background-color: var(--warning); color: black; border: none; }
.web2py_table a.buttonadd { background-color: var(--primary); color: white; border: none; }


@media (max-width: 768px) {

    /* 1. Reset básico de la tabla */
    .web2py_htmltable {
        overflow-x: visible !important;
        width: 100% !important;
    }

    .web2py_table table,
    .web2py_table thead,
    .web2py_table tbody,
    .web2py_table tr,
    .web2py_table th,
    .web2py_table td {
        display: block;
        width: 100%;
    }

    /* Ocultamos cabecera nativa */
    .web2py_table thead {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* 2. Diseño de la Tarjeta Principal */
    .web2py_table tbody tr {
        background-color: var(--light) !important;
        border: 1px solid #e2e6ea;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        margin-bottom: 1rem;
        padding: 0;
        overflow: hidden;
    }

    /* =======================================================
       CABECERA DE LA TARJETA (Primera Columna)
    ======================================================= */
    .web2py_table tbody td:first-child {
        background-color: #f8f9fa;
        color: #2c3e50;
        font-size: 1rem;
        font-weight: 700;
        border-bottom: 1px solid #eaedf0;
        padding: 0.6rem 1rem;
        display: block;
        text-align: left !important;
    }

    /* La cabecera es obvia, no necesita data-label */
    .web2py_table tbody td:first-child::before {
        display: none;
    }

    /* =======================================================
       CUERPO DE LA TARJETA (Diseño "Recibo" Key-Value)
    ======================================================= */
    .web2py_table tbody td:not(:first-child) {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #f1f3f5;
        padding: 0.4rem 1rem;
        min-height: 2.5rem;
    }

    /* Quitamos el borde a la última fila, sea cual sea el contenido */
    .web2py_table tbody td:last-child {
        border-bottom: none;
    }

    /* Estilo limpio para la Etiqueta Izquierda */
    .web2py_table tbody td:not(:first-child)::before {
        content: attr(data-label);
        font-weight: 700;
        color: #8392a5;
        font-size: 0.9rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }

    /* Alineación a la derecha del contenido general (Textos, Badges, Precios) */
    .web2py_table tbody td:not(:first-child) > div,
    .web2py_table tbody td:not(:first-child) > span {
        text-align: right !important;
        margin-bottom: 0;
        font-size: 0.9rem;
    }

    /* Aseguramos que contenedores flex o grupos de botones se peguen a la derecha sin forzar anchos */
    .web2py_table tbody td:not(:first-child) > .btn-group,
    .web2py_table tbody td:not(:first-child) > .d-flex {
        justify-content: flex-end !important;
        flex-grow: 1;

    }

    .web2py_table tbody td:not(:first-child) > .btn-group {
        display: flex !important;
        width: 100%;
    }
}

/* ==========================================================================
   WEB2PY LEGACY BUTTON
   ========================================================================== */
.button.btn { background-image: none !important; filter: none !important; border-radius: .25rem !important; }
.buttontext.button { background: transparent !important; background-image: none !important; filter: none !important; border: none !important; border-radius: .25rem !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; color: inherit !important; font-weight: inherit !important; }

/* Inputs & Form Elements */
.form-group label { font-size: 0.85rem !important; letter-spacing: 0.3px; color: #495057; }
.form-group table { width: 100% !important; }
.form-control { border-radius: 6px !important; border: 1px solid #ced4da !important; padding: 0.25rem 0.5rem !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important; transition: all 0.2s ease-in-out !important; }
.form-control:focus { border-color: var(--primary) !important; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.form-control[readonly], .form-control[disabled] { color: #495057 !important; opacity: 1 !important; }
.form-control[readonly]:focus, .form-control[disabled]:focus { box-shadow: none !important; border-color: #ced4da !important; }
.form-control::placeholder { color: #aab2bd !important; font-style: italic !important; opacity: 1 !important; }
.form-control:-ms-input-placeholder { color: #aab2bd !important; font-style: italic !important; }
.form-control::-ms-input-placeholder { color: #aab2bd !important; font-style: italic !important; }

input[type="password"] { appearance: none !important; }
textarea { height: 6rem !important; }

/* Checkboxes & Radios */
/* input[type='checkbox'] { appearance: none; width: 10px; height: 10px; transform: scale(2); margin: 0 0.5rem; border: 1px solid #555; border-radius: 2px; cursor: pointer; position: relative; }
input[type='checkbox']:checked { background-color: var(--primary); border-color: var(--primary); }
input[type='checkbox']:checked::before { content: '✔'; color: white; position: absolute; top: 50%; left: 50%; transform: translate(-100%, -100%) scale(0.5); } */
.web2py_checkboxeswidget label { font-weight: normal !important; }

input[type='radio'] { appearance: none; width: 10px; height: 10px; transform: scale(2); margin: 0 0.5rem; border: 1px solid darkgray; border-radius: 50%; outline: none; }
input[type='radio']:hover { box-shadow: 0 0 5px 0px lightgray inset; }
input[type='radio']:before { content: ''; display: block; width: 60%; height: 60%; margin: 20% auto; border-radius: 50%; }
input[type='radio']:checked { border: 1px solid var(--primary); }
input[type='radio']:checked:before { background: var(--primary); }

/* Error Wrappers */
.input-group .error_wrapper { position: absolute; top: 2rem; }
.input-group:has(.error_wrapper) { margin-bottom: 1rem; }

/* Web2py File Upload UI Upgrade */
input[type="file"].upload { display: block; flex: 1; min-width: 0; padding: 0.4rem; margin-bottom: 0 !important; background-color: #f8f9fa !important; border: 1px solid #ced4da !important; border-radius: 3px !important; color: #495057; cursor: pointer; transition: all 0.2s ease; }
input[type="file"].upload:hover { background-color: #ffffff !important; border-color: var(--primary) !important; }
input[type="file"].upload + a.btn-outline-danger { margin-top: 4px !important; }
input[type="file"].upload + a.btn-outline-danger:hover { opacity: 1; border-style: solid !important; }

.form-group span[style*="nowrap"] { display: inline-block; margin-top: 0.25rem; color: #ced4da; font-size: 0.85rem; }
.form-group span[style*="nowrap"] a { display: inline-flex; align-items: center; color: var(--success) !important; padding: 0.25rem 0.75rem; margin: 0 0.25rem; border-radius: 3px; font-weight: 600; font-size: 1.5em !important; text-decoration: underline !important; text-transform: capitalize !important; transition: all 0.2s ease; }
.form-group span[style*="nowrap"] a:hover { transform: translateY(-1px); }
.form-group span[style*="nowrap"] a::before { content: "\f019"; font-family: "FontAwesome"; margin-right: 6px; font-weight: normal; }
.form-group span[style*="nowrap"] input[type="checkbox"] { margin-left: 0.75rem; margin-right: 0.35rem; transform: scale(1.2); cursor: pointer; }

.d-flex > input[type="file"].upload { order: 1 !important; }
.d-flex > a.btn-outline-danger { order: 2 !important; }
.d-flex > .error_wrapper { flex: 0 0 100% !important; order: 10 !important; margin-top: 0.25rem !important; position: relative !important; top: auto !important; }

/* Datagrid btn-group adjustments
.btn-group { display: inline-flex; }
.btn-group > .btn { display: flex; align-items: center; justify-content: center; padding: 0; }
.btn-group > .btn.disabled { background: #e9ecef; opacity: 0.6; cursor: not-allowed; }
*/

/* ==========================================================================
   10. WIZARD BOOTSTRAP THEME OVERRIDES
   ========================================================================== */
.form_wizard .wizard_steps li a .step_no { transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; }

/* Current Step */
.form_wizard .wizard_steps li a.selected .step_no {
    background: var(--primary) !important; border-color: var(--primary) !important; color: #ffffff !important; font-weight: 700; font-size: 1.2em !important;
    transform: scale(1.15); box-shadow: 0 4px 10px rgba(0,0,0,0.15), 0 0 0 4px rgb(from var(--primary) r g b / 0.15);
}
.form_wizard .wizard_steps li a.selected:before,
.form_wizard .wizard_steps li a.selected .step_no { background: var(--primary) !important; color: #fff; }
.form_wizard .wizard_steps li a.selected .step_descr { color: var(--primary) !important; font-weight: 600; font-size: 1.1em; letter-spacing: 0.2px; }
.form_wizard .wizard_steps li a.selected:hover .step_no { transform: scale(1.15); }

/* Done Steps */
.form_wizard .wizard_steps li a.done .step_no { background: var(--success) !important; border-color: var(--success) !important; color: #ffffff !important; box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.form_wizard .wizard_steps li a.done .step_descr { color: var(--success) !important; }
.form_wizard .wizard_steps li a.done::before { background: var(--success) !important; }

/* Error Steps */
.form_wizard .wizard_steps li a.error:not(.selected) .step_no { background: var(--danger) !important; border-color: var(--danger) !important; color: #ffffff !important; box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.form_wizard .wizard_steps li a.error:not(.selected) .step_descr { color: var(--danger) !important; }
.form_wizard .wizard_steps li a.error:not(.selected)::before { background: var(--danger) !important; }

/* Disabled/Unreached Steps */
.form_wizard .wizard_steps li a.disabled .step_no { background: #f1f3f5 !important; border-color: #dee2e6 !important; color: #adb5bd !important; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); }
.form_wizard .wizard_steps li a.disabled .step_descr { color: #adb5bd !important; font-weight: 500; }
.form_wizard .wizard_steps li a.disabled::before { background: #dee2e6 !important; }

/* Furthest Reached Step */
.form_wizard .wizard_steps li:has(a.selected) ~ li:has(a.done):not(:has(~ li a.done)) a.done .step_no { background: var(--warning) !important; border-color: var(--warning) !important; color: #000000 !important; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.form_wizard .wizard_steps li:has(a.selected) ~ li:has(a.done):not(:has(~ li a.done)) a.done .step_descr { color: var(--dark) !important; font-weight: 500; }
.form_wizard .wizard_steps li:has(a.selected) ~ li:has(a.done):not(:has(~ li a.done)) a.done::before { background: var(--warning) !important; }

/* Hover Effects */
.form_wizard .wizard_steps li a:hover .step_no { transform: scale(1.08); }
.form_wizard .wizard_steps li a.disabled:hover .step_no { transform: none; }

.form_wizard .stepContainer { padding-bottom: 1.5rem !important; }
.form_wizard .wizard_steps { padding: 0 !important; }

/* Wizard Layout Fixes */
ul.wizard_steps { display: flex !important; flex-direction: row; flex-wrap: nowrap; width: 100% !important; padding: 0; margin: 0 0 20px 0; }
ul.wizard_steps li { flex: 1 1 0 !important; display: block; text-align: center; min-width: 0; }
ul.wizard_steps li a { display: block; width: 100%; }
ul.wizard_steps li a .step_descr { display: block; line-height: 1.2; padding: 5px 2px 0 2px; white-space: normal; word-break: normal; hyphens: auto; }

/* Wizard Mobile Adaptation */
@media (max-width: 767.98px) {
    .form_wizard .wizard_steps { flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; padding-top: 15px !important; padding-bottom: 15px !important; scrollbar-width: none; }
    .form_wizard .wizard_steps::-webkit-scrollbar { display: none; }
    .form_wizard .wizard_steps li { flex: 1 0 auto !important; min-width: 70px !important; position: relative; }
    .form_wizard .wizard_steps li a { display: flex !important; flex-direction: column !important; align-items: center !important; padding: 0 !important; margin: 0 !important; }
    .form_wizard .wizard_steps li a .step_descr { display: none !important; }
    .form_wizard .wizard_steps li a::before { width: 100% !important; left: 50% !important; top: 18px !important; height: 3px !important; }
    .form_wizard .wizard_steps li:last-child a::before { display: none !important; }
    .form_wizard .stepContainer { overflow-x: hidden !important; padding-top: 0 !important; }
}

/* ==========================================================================
   11. DROPZONE.JS OVERRIDES
   ========================================================================== */
.dropzone { border: 2px dashed var(--primary) !important; background: var(--light) !important; border-radius: 8px; padding: 15px; }
.dropzone .dz-preview { position: relative; display: inline-block; vertical-align: top; margin: 8px; min-height: auto; width: 150px; background: var(--white, #ffffff); border: 1px solid rgba(0, 0, 0, 0.125); border-radius: 6px; box-shadow: none; padding: 10px 10px 15px 10px; }
.dropzone .dz-preview .dz-image { display: none !important; }
.dropzone .dz-preview .dz-details { position: static !important; opacity: 1 !important; padding: 0 !important; color: var(--dark); text-align: left; }
.dropzone .dz-preview .dz-details .dz-filename { border: none !important; background: transparent !important; white-space: normal !important; word-wrap: break-word !important; font-weight: 600; font-size: 0.85rem; line-height: 1.2; margin-bottom: 5px; }
.dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span { border: none !important; background: transparent !important; padding: 0 !important; }
.dropzone .dz-preview .dz-details .dz-size { font-size: 0.9rem; color: var(--secondary); }

/* Progress & Feedback */
.dropzone .dz-preview .dz-progress { opacity: 1 !important; position: relative !important; height: 8px !important; top: auto !important; left: auto !important; margin: 12px 0 0 0 !important; width: 100% !important; background: rgba(0, 0, 0, 0.1) !important; border-radius: 4px; overflow: hidden; }
.dropzone .dz-preview .dz-progress .dz-upload { background: var(--success) !important; position: absolute; top: 0; left: 0; bottom: 0; width: 0; transition: width 300ms ease-in-out; }
.dropzone .dz-preview:not(.dz-processing) .dz-progress { animation: none !important; }
.dropzone .dz-preview .dz-error-message { top: 100% !important; left: 0 !important; width: 100% !important; background: var(--danger) !important; color: var(--white, #ffffff) !important; border-radius: 4px; margin-top: 5px !important; padding: 5px 10px !important; text-align: center; }
.dropzone .dz-preview .dz-error-message:after { border-bottom: 6px solid var(--danger) !important; }

/* Status Marks */
.dropzone .dz-preview .dz-success-mark svg path, .dropzone .dz-preview .dz-success-mark svg g { fill: var(--success) !important; }
.dropzone .dz-preview .dz-error-mark svg path, .dropzone .dz-preview .dz-error-mark svg g { fill: var(--danger) !important; }
.dropzone .dz-preview.dz-success .dz-success-mark, .dropzone .dz-preview.dz-error .dz-error-mark { animation: none !important; opacity: 1 !important; }
.dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark { position: absolute !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; margin: 0 !important; pointer-events: none; transition: opacity 0.2s ease; z-index: 500; }
.dropzone .dz-preview:hover .dz-success-mark, .dropzone .dz-preview:hover .dz-error-mark { opacity: 0 !important; }

/* Remove Button */
.dropzone .dz-preview .dz-remove { margin: 1em 2em 0em 2em; padding: 0.5em 2em; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; color: var(--danger) !important; background-color: transparent; border: 1px solid var(--danger); border-radius: 4px; text-decoration: none !important; transition: all 0.2s ease-in-out; cursor: pointer; }
.dropzone .dz-preview .dz-remove:hover { background-color: var(--danger) !important; color: var(--white, #ffffff) !important; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); }

/* ==========================================================================
   12. LOADING OVERLAY & MISC COMPONENTS
   ========================================================================== */
#loading { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 99999; display: flex; align-items: center; justify-content: center; flex-direction: column; background-color: rgba(33, 37, 41, 0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
#loading .loading-spinner { width: 60px; height: 60px; margin-bottom: 20px; border: 5px solid rgba(255, 255, 255, 0.15); border-radius: 50%; border-top-color: var(--primary); animation: smooth-spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite; }
#loading-text { color: #ffffff; font-size: 1.25rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; animation: gentle-pulse 1.5s ease-in-out infinite; }

@keyframes smooth-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes gentle-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.98); } }

/* SweetAlerts */
.swal2-timer-progress-bar { height: 6px; background: var(--success); }
.swal2-input::placeholder { font-weight: bold; opacity: 0.5; color: #444; }
.swal2-styled:focus { outline: none !important; box-shadow: none !important; }

/* Trumbowyg Editor */
.trumbowyg-box {
    border: 1px solid #ced4da !important;
    border-radius: 1.25rem !important;
    background-color: #fafafa !important; /* Fondo gris sutil en reposo */
    overflow: visible !important;
    margin: 0 !important;
    transition: all 0.2s ease-in-out;
}

.trumbowyg-box, .trumbowyg-textarea {
    height: auto !important;
    min-height: 100px !important; /* Altura inicial 100px */
}
.trumbowyg-editor {
    min-height: 100px !important;
    max-height: 300px !important; /* Crece hasta 300px, luego habilita el scroll interno */
    overflow-y: auto !important;
    background-color: transparent !important;
    color: #495057 !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 1rem;
    line-height: 1.4;
}

.trumbowyg-box.trumbowyg-focus {
    background-color: #ffffff !important;
    border-color: #80bdff !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1) !important;
}

.trumbowyg-button-pane {
    background-color: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
}

.trumbowyg-button-pane button {
    border-radius: 50% !important;
    transition: background-color 0.15s ease;
}
.trumbowyg-button-pane button:hover,
.trumbowyg-button-pane button.trumbowyg-active {
    background-color: #e2e6ea !important;
}

.trumbowyg-box.trumbowyg-fullscreen,
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-editor,
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-textarea {
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    background-color: #ffffff !important;
}


/* Floating Buttons */
.container-btn { position: sticky; bottom: 20px; margin: 10px 0; z-index: 1049; }
.btn-float { display: flex; align-items: center; width: 200px; height: 40px; border-radius: 20px; overflow: hidden; white-space: nowrap; background-color: rgba(201, 202, 203, 0.6); backdrop-filter: blur(2px); }
.btn-float:hover { background-color: rgba(201, 202, 203, 0.8); }
.container-btn .material-symbols-outlined { font-size: 1.5rem; margin-left: 7px; }

/* Popovers & Cards */
.popover { border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 8px; }
.popover-body { color: #212529; padding: 8px 12px; }
.card-toggle::after { content: "▼"; float: right; transition: transform 0.3s ease; }
.card-toggle.collapsed::after { transform: rotate(0deg); }
.card-toggle:not(.collapsed)::after { transform: rotate(-180deg); }

#w2p_nav-tabs.nav-tabs { display: flex !important; flex-wrap: wrap !important; height: auto !important; gap: 15px 5px; }
#w2p_nav-tabs.nav-link { display: block; width: 100%; text-align: center; margin: 0 !important; }
#w2p_nav-tabs.tab-content { clear: both !important; position: relative !important; }
#w2p_nav-tabs.nav-link.active { color: var(--primary) !important; transform: scale(1.1) !important; }

/* Custom modals */
#w2pModalBody > object,
#w2pModalBody > iframe { clip-path: inset(0 round 8px 8px 8px 8px) !important; }

.word-wrap{
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
}
