/* Fire System: capa final de identidad visual. Se carga después de site.css. */
:root {
    --fire-navy-950: #071624;
    --fire-navy-900: #0b2239;
    --fire-navy-800: #123654;
    --fire-navy-700: #1d4a6b;
    --fire-red-700: #b5081b;
    --fire-red-600: #d30b24;
    --fire-red-500: #ea1b32;
    --fire-red-100: #fde8eb;
    --fire-surface: #f4f6f8;
    --fire-white: #fff;
    --fire-text: #172a3a;
    --fire-muted: #647482;
    --fire-border: #d7e0e7;
    --bazar-primary: var(--fire-red-600);
    --bazar-primary-hover: var(--fire-red-700);
    --bazar-primary-dark: var(--fire-navy-900);
    --bazar-primary-light: var(--fire-red-100);
    --bazar-background: var(--fire-surface);
    --bazar-border: var(--fire-border);
    --bazar-text: var(--fire-text);
    --bazar-muted: var(--fire-muted);
    --brand-yellow: var(--fire-red-500);
    --brand-yellow-dark: var(--fire-red-700);
    --brand-black: var(--fire-navy-900);
    --brand-black-soft: var(--fire-navy-950);
    --brand-green: var(--fire-red-500);
    --brand-green-dark: var(--fire-navy-700);
    --table-yellow: var(--fire-red-500);
    --table-black: var(--fire-navy-900);
    --table-green: var(--fire-red-600);
    --table-green-dark: var(--fire-red-700);
    --socios-yellow: var(--fire-red-500);
    --socios-black: var(--fire-navy-900);
    --socios-green: var(--fire-red-600);
    --socios-green-dark: var(--fire-red-700);
    --surface: var(--fire-surface);
    --border: var(--fire-border);
    --text: var(--fire-text);
    --muted: var(--fire-muted);
}

body {
    color: var(--fire-text);
    background: radial-gradient(circle at 100% 0, rgba(211, 11, 36, .045), transparent 26rem), var(--fire-surface);
}

.content-area {
    background-image: linear-gradient(rgba(244,246,248,.965), rgba(244,246,248,.965)), url("../img/fire-system-inventory-bg.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.sidebar {
    background: radial-gradient(circle at 35% 0, rgba(234, 27, 50, .18), transparent 16rem), linear-gradient(180deg, var(--fire-navy-900), var(--fire-navy-950));
    border-right-color: rgba(255,255,255,.08);
}

.brand-logo { overflow: visible; background: transparent; border-radius: 0; box-shadow: none; }
.brand-logo img { filter: drop-shadow(0 6px 10px rgba(0,0,0,.28)); }
.brand-company { color: var(--fire-white); }
.brand-system { color: rgba(255,255,255,.58); }
.sidebar-divider { background: linear-gradient(90deg, var(--fire-red-600), rgba(234,27,50,.1)); }
.sidebar-link i:first-child, .nav-link-content i, .subnav-link i { color: #ff6678; }
.sidebar-link.active { color: #fff; background: linear-gradient(135deg, var(--fire-red-600), var(--fire-red-700)); box-shadow: 0 8px 20px rgba(181,8,27,.28); }
.sidebar-link.active i:first-child, .sidebar-link.active .nav-link-content i { color: #fff; }
.subnav { border-left-color: rgba(234,27,50,.42); }
.subnav-link.active { color: #ff8c9a; background: rgba(234,27,50,.1); }
.security-badge { border-color: rgba(234,27,50,.25); background: rgba(234,27,50,.08); }
.security-badge > i { color: #ff6678; }

.topbar { background: rgba(255,255,255,.93); border-bottom-color: var(--fire-border); box-shadow: 0 5px 18px rgba(11,34,57,.045); }
.topbar-kicker { color: var(--fire-red-700); }
.topbar-title h1, label, .form-label { color: var(--fire-navy-900); }
.sidebar-toggle:hover, .user-menu:hover, .user-menu:focus { color: var(--fire-red-700); background: var(--fire-red-100); border-color: rgba(211,11,36,.35); }
.user-avatar { color: #fff; background: linear-gradient(135deg, var(--fire-red-500), var(--fire-red-700)); }
.footer-separator { color: var(--fire-red-600); }

/* Encabezados internos inspirados en las fichas de inventario de referencia. */
.page-section-header {
    position: relative;
    min-height: 118px;
    margin-bottom: 1.15rem;
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    background: linear-gradient(110deg, #fff 0%, #fff 58%, rgba(11,34,57,.04) 100%);
    border: 1px solid var(--fire-border);
    border-left: 5px solid var(--fire-red-600);
    border-radius: 14px;
    box-shadow: 0 9px 24px rgba(11,34,57,.06);
    width: 100%;
    max-width: 1100px;
    margin-right: auto;
    margin-left: auto;
    justify-content: center;
    text-align: center;
}

.page-section-header::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 52%;
    background: url("../img/fire-system-header.jpg") center/cover no-repeat;
    opacity: .12;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.28) 24%, #000 62%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.28) 24%, #000 62%);
    pointer-events: none;
}

.page-section-icon {
    position: relative;
    z-index: 1;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg,var(--fire-navy-800),var(--fire-navy-950));
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(11,34,57,.2);
    font-size: 1.45rem;
}

.page-section-header > div {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-section-kicker {
    display: block;
    margin-bottom: .2rem;
    color: var(--fire-red-700);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.page-section-header h1 {
    margin: 0;
    color: var(--fire-navy-900);
    font-size: clamp(1.35rem,2vw,1.75rem);
    font-weight: 800;
}

.page-section-header p {
    margin: .35rem 0 0;
    color: var(--fire-muted);
    font-size: .86rem;
}

.list-toolbar {
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.list-toolbar-label {
    color: var(--fire-navy-800);
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.list-toolbar-label i {
    margin-right: .35rem;
    color: var(--fire-red-600);
}

.tableFormManualWith {
    padding: 1rem !important;
}

.content-area .form-title {
    position: relative;
    width: 100%;
    max-width: 1100px;
    min-height: 104px;
    margin: 0 auto 1.15rem !important;
    padding: 1.35rem 1.5rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center !important;
    border: 1px solid var(--fire-border);
    border-top: 5px solid var(--fire-red-600);
    border-radius: 14px;
    background: radial-gradient(circle at 100% 0, rgba(211,11,36,.055), transparent 230px), #fff;
    box-shadow: 0 9px 24px rgba(11,34,57,.06);
}
.content-area .form-title h1 { margin: 0 !important; color: var(--fire-navy-900); font-size: clamp(1.35rem,2vw,1.8rem); font-weight: 800; text-align: center !important; }
.content-area .form-title h1::after { content: ""; display: block; width: 54px; height: 4px; margin: .65rem auto 0; border-radius: 99px; background: var(--fire-red-600); }
.content-area .form-title p { max-width: 720px; margin: .7rem auto 0; color: var(--fire-muted); font-size: .88rem; text-align: center; }

.form-section, .personalFormManualWith, .tableFormManualWith, .card, .modal-content { border-color: var(--fire-border) !important; border-radius: 14px; }
.form-section, .personalFormManualWith, .tableFormManualWith { background: #fff; box-shadow: 0 10px 28px rgba(11,34,57,.065); }

/* Centra los formularios principales dentro del área útil de trabajo. */
.content-area > .container-fluid > form,
.content-area .personalFormManualWith {
    margin-right: auto;
    margin-left: auto;
}

.content-area > .container-fluid > form {
    width: 100%;
}

/* Formularios administrativos */
.content-area form.personalFormManualWith,
.content-area > .container-fluid > form:has(> .form-section) {
    overflow: hidden;
    border: 1px solid #d8e1e8 !important;
    border-radius: 18px !important;
    background: var(--fire-white);
    box-shadow: 0 18px 45px rgba(11, 34, 57, .10) !important;
}

.content-area form.personalFormManualWith > .form-section,
.content-area > .container-fluid > form > .form-section,
.content-area form.personalFormManualWith > .modal-body,
.content-area > .container-fluid > form > .modal-body {
    position: relative;
    margin: 0;
    padding: 2rem !important;
    border: 0 !important;
    border-top: 5px solid var(--fire-red-600) !important;
    border-radius: 0 !important;
    background:
        radial-gradient(circle at 100% 0, rgba(211, 11, 36, .055), transparent 230px),
        var(--fire-white);
    box-shadow: none !important;
}

/* Línea visual común para cualquier formulario administrativo dentro del main. */
.content-area > .container-fluid > form:not(.login100-form):not(.checkout-entry) {
    max-width: 1100px;
}

.content-area form:not(.login100-form) textarea.form-control {
    min-height: 112px;
    resize: vertical;
}

.content-area form:not(.login100-form) .input-group-text {
    min-width: 46px;
    justify-content: center;
    color: var(--fire-red-700);
    border-color: #c8d3dc;
    border-radius: 10px 0 0 10px;
    background: #f3f6f8;
}

.content-area form:not(.login100-form) .text-danger:not(:empty) {
    display: block;
    margin-top: .35rem;
    font-size: .78rem;
    font-weight: 650;
}

.content-area form .row {
    --bs-gutter-x: 1.35rem;
    --bs-gutter-y: .45rem;
}

.content-area form label:not(.form-check-label) {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .45rem;
    color: var(--fire-navy-800);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .025em;
}

.content-area form label:not(.form-check-label)::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fire-red-600);
    content: "";
}

.content-area form .form-control,
.content-area form .form-select {
    min-height: 48px;
    padding: .7rem .9rem;
    border: 1px solid #c8d3dc;
    border-radius: 10px;
    background-color: #fbfcfd;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.content-area form .form-control:hover,
.content-area form .form-select:hover {
    border-color: #9eacb8;
    background-color: #fff;
}

.content-area form .form-control:focus,
.content-area form .form-select:focus {
    border-color: var(--fire-red-500);
    background-color: #fff;
    box-shadow: 0 0 0 .24rem rgba(211, 11, 36, .11);
}

.content-area form .form-control[readonly],
.content-area form .form-control:disabled {
    color: #536474;
    border-style: dashed;
    background: #eef2f5;
}

.content-area form .form-check {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 48px;
    padding: .7rem 1rem .7rem 3.2rem;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
    background: #f7f9fa;
}

.content-area form .form-check-input {
    width: 2.35rem;
    height: 1.25rem;
    margin-left: -2.55rem;
    border-radius: 99px;
}

.content-area form .form-check-label {
    color: var(--fire-navy-800);
    font-weight: 750;
}

.content-area form .botonesOpciones .btn {
    min-height: 48px;
    border-radius: 10px;
    font-weight: 800;
    letter-spacing: .015em;
    box-shadow: 0 7px 16px rgba(11, 34, 57, .10);
    transition: transform .18s ease, box-shadow .18s ease;
}

.content-area form .botonesOpciones .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(11, 34, 57, .15);
}

.content-area form .botonesOpciones .btn-primary {
    border-color: var(--fire-red-700);
    background: linear-gradient(135deg, var(--fire-red-600), var(--fire-red-800));
}

.content-area form .botonesOpciones .btn-secondary {
    border-color: var(--fire-navy-800);
    background: linear-gradient(135deg, var(--fire-navy-700), var(--fire-navy-900));
}

.content-area form [data-valmsg-summary="true"]:not(.validation-summary-valid) {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-left: 4px solid var(--fire-red-600);
    border-radius: 8px;
    background: #fff2f3;
}

.sidebar .nested-subnav-link {
    margin-left: 1rem;
    padding-left: 1.05rem;
    border-left: 2px solid rgba(255, 255, 255, .16);
    font-size: .9rem;
}

@media (max-width: 767.98px) {
    .content-area form.personalFormManualWith > .form-section,
    .content-area > .container-fluid > form > .form-section,
    .content-area form.personalFormManualWith > .modal-body,
    .content-area > .container-fluid > form > .modal-body {
        padding: 1.25rem !important;
    }

    .page-section-header {
        flex-direction: column;
        text-align: center;
    }

    .content-area form .botonesOpciones + .botonesOpciones {
        margin-top: .75rem;
    }
}
.form-control, .form-select { min-height: 43px; color: var(--fire-text); border-color: #c9d4dd; border-radius: 8px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--fire-red-500); box-shadow: 0 0 0 .2rem rgba(211,11,36,.14); }
.form-check-input:checked { background-color: var(--fire-red-600); border-color: var(--fire-red-600); }

.btn { border-radius: 8px; font-weight: 650; }
.btn-primary, .tableFormManualWith .btn-success { color: #fff !important; background: linear-gradient(135deg,var(--fire-red-600),var(--fire-red-700)) !important; border-color: var(--fire-red-700) !important; }
.btn-primary:hover, .tableFormManualWith .btn-success:hover { background: var(--fire-navy-900) !important; border-color: var(--fire-navy-900) !important; }
.btn-secondary { color: #fff; background: var(--fire-navy-700); border-color: var(--fire-navy-700); }
.btn-outline-primary { color: var(--fire-red-700); border-color: var(--fire-red-600); }
.btn-outline-primary:hover { color: #fff; background: var(--fire-red-600); border-color: var(--fire-red-600); }

.tableFormManualWith .table-responsive > table.table thead th, .table thead th { color: #fff; background: var(--fire-navy-900) !important; border-color: rgba(255,255,255,.12) !important; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fdecef; }
.table a { color: var(--fire-red-700); font-weight: 650; }
.card-header, .modal-header { color: var(--fire-navy-900); background: #f8fafb; border-color: var(--fire-border); }

.fire-popup-navbar { min-height: 82px; padding: .65rem 1rem; background: var(--fire-navy-900); border-bottom: 4px solid var(--fire-red-600); }
.fire-popup-navbar img { width: min(420px,75vw); max-height: 58px; object-fit: contain; object-position: left center; }

.home-access-section {
    margin-top: 1.6rem;
}

.home-section-heading {
    margin-bottom: .8rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.home-section-heading span {
    color: var(--fire-red-700);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.home-section-heading h3 {
    margin: .12rem 0 0;
    color: var(--fire-navy-900);
    font-size: 1.15rem;
    font-weight: 800;
}

.home-access-section .home-modules {
    margin-top: 0;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.module-card-featured {
    border-color: rgba(211,11,36,.3);
    background: linear-gradient(135deg, #fff, #fff6f7);
}

@media (max-width: 575.98px) {
    .page-section-header {
        padding: 1.1rem;
        align-items: flex-start;
    }

    .page-section-header::after {
        display: none;
    }

    .page-section-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        font-size: 1.1rem;
    }

    .page-section-header p {
        display: none;
    }

    .list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}
