:root {
    --bg-main: #f7eef2;
    --bg-panel: #ffffff;
    --bg-soft: #f6f9fc;
    --border-soft: #ead6dd;
    --text-main: #3d1624;
    --text-soft: #7d6470;
    --primary-900: #4b0019;
    --primary-800: #650020;
    --primary-700: #7f1231;
    --primary-500: #a3264b;
    --accent: #d4a017;
    --success-soft: #e8fff4;
    --danger-soft: #fff0f0;
    --shadow-soft: 0 18px 45px rgba(17, 42, 84, .08);
    --shadow-panel: 0 8px 26px rgba(11, 31, 77, .08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

html, body { min-height: 100%; }
body {
    position: relative;
    isolation: isolate;
    font-size: .95rem;
    color: var(--text-main);
    background:
        linear-gradient(rgba(238, 243, 249, .78), rgba(238, 243, 249, .84)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat,
        var(--bg-main);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat;
    opacity: .18;
    z-index: -1;
}

a { text-decoration: none; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 18px;
    background:
        linear-gradient(180deg, rgba(8, 23, 51, .94) 0%, rgba(13, 37, 84, .93) 55%, rgba(16, 42, 93, .92) 100%),
        url('/images/QUINTANA_ROO.png') center center / contain no-repeat;
    color: #fff;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}

.app-sidebar::before {
    content: "";
    position: fixed;
    inset: 0 auto 0 0;
    width: 300px;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(255,255,255,.12), transparent 34%);
}

.sidebar-brand-wrap, .menu-block, .sidebar-footer { position: relative; z-index: 1; }
.sidebar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    margin-bottom: 24px;
}
.sidebar-brand-mark {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.12);
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-brand-logo { width: 54px; height: 54px; object-fit: contain; }
.sidebar-kicker {
    font-size: .74rem;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    margin-bottom: 4px;
}
.sidebar-brand-title { font-weight: 800; line-height: 1.25; font-size: 1rem; }
.menu-block + .menu-block { margin-top: 20px; }
.menu-heading {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.48);
    margin: 0 12px 10px;
    font-weight: 700;
}
.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.86);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 6px;
    transition: .22s ease;
    font-weight: 500;
}
.nav-link-modern i { font-size: 1rem; width: 18px; text-align: center; }
.nav-link-modern:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}
.nav-link-modern.active {
    background: linear-gradient(90deg, rgba(35,89,196,.35), rgba(33,166,255,.22));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
}
.sidebar-footer {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.btn-logout {
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    border-radius: 14px;
    padding: 11px 14px;
    background: rgba(255,255,255,.04);
}
.btn-logout:hover { background: rgba(255,255,255,.10); color: #fff; }

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(238, 243, 249, .48);
}
.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 28px 8px;
}
.page-kicker {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .74rem;
    color: var(--text-soft);
    margin-bottom: 4px;
    font-weight: 700;
}
.page-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-900);
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--text-soft);
    box-shadow: var(--shadow-panel);
    font-weight: 600;
}
.app-content { padding: 12px 28px 28px; }
.modern-alert { border-radius: 16px; }

.card,
.panel-modern,
.surface-card {
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-panel) !important;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(2px);
}
.card .card-body { padding: 1.25rem 1.35rem; }

.hero-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #091c43, #153978 55%, #2071b8 100%);
    color: #fff;
    border-radius: 28px;
    padding: 1.8rem;
    box-shadow: 0 20px 40px rgba(8, 24, 61, .18);
}
.hero-panel::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -40px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
}
.eyebrow {
    text-transform: uppercase;
    font-size: .74rem;
    letter-spacing: .14em;
    color: rgba(255,255,255,.72);
    margin-bottom: .55rem;
    font-weight: 700;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    border-radius: 20px;
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-panel);
    border: 1px solid var(--border-soft);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--primary-500), var(--accent));
}
.stat-label {
    color: var(--text-soft);
    font-size: .84rem;
    margin-bottom: .5rem;
    font-weight: 600;
}
.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-900);
    line-height: 1.15;
}
.trend-box {
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
    border: 1px solid #e2edf8;
    border-radius: 16px;
    padding: .95rem;
}

.table-responsive,
.table {
    border-radius: 16px;
}
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #f8fbff;
    --bs-table-hover-bg: #edf5ff;
    margin-bottom: 0;
}
.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-soft);
    border-bottom-width: 1px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.table > :not(caption) > * > * {
    padding: .92rem .82rem;
    border-color: #ebf0f5;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: #d7e0ea;
    min-height: 48px;
    box-shadow: none;
}
textarea.form-control { min-height: 120px; }
.form-control:focus,
.form-select:focus {
    border-color: #4a8eff;
    box-shadow: 0 0 0 .22rem rgba(35,89,196,.12);
}
.form-label {
    font-weight: 700;
    color: #1b3550;
    margin-bottom: .5rem;
}
.form-check-input { border-radius: 8px; }
.form-check-input:checked { background-color: var(--primary-700); border-color: var(--primary-700); }
.text-danger { font-size: .85rem; }

.btn {
    border-radius: 14px;
    padding: .72rem 1rem;
    font-weight: 700;
}
.btn-primary {
    background: linear-gradient(90deg, var(--primary-800), var(--primary-500));
    border: none;
    box-shadow: 0 10px 24px rgba(23,59,143,.16);
}
.btn-primary:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn-outline-primary { border-color: #2f62d6; color: #214eb5; }
.btn-outline-primary:hover { background: #214eb5; border-color: #214eb5; }
.btn-outline-secondary { border-color: #d3dde8; color: #496175; }

.page-section {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 1.25rem;
    box-shadow: var(--shadow-panel);
}
.section-title {
    font-weight: 800;
    color: var(--primary-900);
    margin-bottom: .25rem;
}
.section-subtitle { color: var(--text-soft); margin-bottom: 0; }
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.search-panel,
.filter-panel {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: var(--shadow-panel);
}

.login-wrapper {
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(8, 24, 61, .76), rgba(18, 45, 99, .72)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat;
}
.login-card {
    width: 100%;
    max-width: 1120px;
    border-radius: 28px !important;
    background: rgba(255,255,255,.96);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,.24) !important;
}
.login-brand-panel {
    background: linear-gradient(180deg, #071735 0%, #102a5d 100%);
    min-height: 680px;
    align-items: center;
    justify-content: center;
    padding: 42px 34px;
    position: relative;
}
.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255,255,255,.14), transparent 45%);
}
.brand-content { position: relative; z-index: 1; }
.brand-logo { width: 220px; max-width: 100%; filter: drop-shadow(0 16px 30px rgba(0,0,0,.28)); }
.mobile-logo { width: 112px; max-width: 100%; }
.brand-title { font-size: 2rem; font-weight: 800; margin-bottom: 6px; }
.brand-subtitle { font-size: 1.05rem; opacity: .88; letter-spacing: .06em; }
.brand-divider { width: 86px; height: 4px; border-radius: 999px; background: linear-gradient(90deg, #ffffff, #8db5ff); }
.brand-text { font-size: 1rem; line-height: 1.75; opacity: .92; max-width: 360px; margin: 0 auto; }
.login-badge { display: inline-block; background: rgba(11,31,77,.08); color: #0b1f4d; font-weight: 800; font-size: .78rem; letter-spacing: .08em; padding: 8px 14px; border-radius: 999px; }
.login-title { font-size: 2rem; font-weight: 800; color: #0b1f4d; }
.login-input { border-radius: 14px; border: 1px solid #d7deea; padding-top: 14px; padding-bottom: 14px; }
.btn-login { background: linear-gradient(90deg, #0b1f4d, #173b8f); color: #fff; font-weight: 800; border: none; border-radius: 14px; font-size: 1rem; }
.btn-login:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px rgba(11,31,77,.2); }
.login-footer { border-top: 1px solid #eef2f7; padding-top: 16px; }

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eff5ff;
    color: #1b4fb8;
    font-weight: 700;
    font-size: .78rem;
}

@media (max-width: 1199.98px) {
    .app-shell { grid-template-columns: 260px 1fr; }
    .app-sidebar::before { width: 260px; }
}

@media (max-width: 991.98px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar {
        position: relative;
        height: auto;
        width: 100%;
        box-shadow: none;
    }
    .app-sidebar::before { display: none; }
    .app-topbar { padding-top: 18px; }
}

@media (max-width: 767.98px) {
    .app-content, .app-topbar { padding-left: 16px; padding-right: 16px; }
    .page-title { font-size: 1.35rem; }
    .login-card { border-radius: 20px !important; }
    .card .card-body { padding: 1rem; }
}


    /* Fondo institucional con logo */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat;
        background-size: contain;
        opacity: 0.08; /* 🔥 controla qué tan visible se ve */

        z-index: -1;
        pointer-events: none;
    }
body::before {
    background: url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat;
    background-size: contain;
    opacity: .18;
}

/* Fondo institucional y paleta guinda */
body {
    background:
        linear-gradient(rgba(247, 238, 242, .80), rgba(247, 238, 242, .88)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat,
        var(--bg-main);
}

body::before {
    background: url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat;
    background-repeat: no-repeat;
    opacity: .22;
}

.app-sidebar {
    background:
        linear-gradient(180deg, rgba(75, 0, 25, .94) 0%, rgba(101, 0, 32, .93) 56%, rgba(127, 18, 49, .92) 100%),
        url('/images/QUINTANA_ROO.png') center center / contain no-repeat;
}

.app-main {
    background: rgba(247, 238, 242, .50);
}

.hero-panel,
.login-brand-panel {
    background: linear-gradient(135deg, #4b0019, #7f1231 58%, #a3264b 100%);
}

.login-wrapper {
    background:
        linear-gradient(135deg, rgba(75, 0, 25, .78), rgba(127, 18, 49, .72)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat,
        #4b0019;
}

.btn-primary,
.btn-login {
    background: linear-gradient(90deg, var(--primary-900), var(--primary-500));
}

.btn-primary {
    box-shadow: 0 10px 24px rgba(127, 18, 49, .18);
}

.btn-outline-primary {
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.btn-outline-primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.badge-soft {
    background: #fff2f5;
    color: var(--primary-700);
}

/* Transparencias y estados guinda */
body {
    background:
        linear-gradient(rgba(247, 238, 242, .64), rgba(247, 238, 242, .72)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat,
        var(--bg-main);
}

body::before {
    opacity: .30;
}

.app-main {
    background: rgba(247, 238, 242, .26);
}

.card,
.panel-modern,
.surface-card,
.page-section,
.search-panel,
.filter-panel,
.login-card {
    background-color: rgba(255, 255, 255, .82) !important;
    backdrop-filter: blur(1.5px);
}

.status-pill,
.trend-box,
.stat-card {
    background: rgba(255, 255, 255, .78) !important;
    border-color: rgba(234, 214, 221, .82) !important;
    backdrop-filter: blur(1.5px);
}

.table {
    --bs-table-bg: rgba(255, 255, 255, .30);
    --bs-table-striped-bg: rgba(127, 18, 49, .055);
    --bs-table-hover-bg: rgba(127, 18, 49, .13);
    --bs-table-hover-color: var(--text-main);
}

.table-responsive {
    background: rgba(255, 255, 255, .42);
    backdrop-filter: blur(1px);
}

.table thead th {
    background: rgba(75, 0, 25, .08);
    color: var(--primary-800);
}

.table > :not(caption) > * > * {
    border-color: rgba(127, 18, 49, .14);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-color-state: var(--text-main);
    --bs-table-bg-state: rgba(127, 18, 49, .13);
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, .82);
    border-color: rgba(127, 18, 49, .24);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 .22rem rgba(127, 18, 49, .14);
}

.form-label,
.login-title {
    color: var(--primary-900);
}

.nav-link-modern.active {
    background: linear-gradient(90deg, rgba(127, 18, 49, .50), rgba(212, 160, 23, .22));
}

.brand-divider {
    background: linear-gradient(90deg, #ffffff, var(--accent));
}

.login-badge {
    background: rgba(127, 18, 49, .10);
    color: var(--primary-900);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.quick-action {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(127, 18, 49, .20);
    border-radius: 14px;
    background: rgba(255, 255, 255, .78);
    color: var(--primary-800);
    font-weight: 800;
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(1.5px);
    transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.quick-action i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(127, 18, 49, .10);
    color: var(--primary-700);
    font-size: 1rem;
    flex: 0 0 auto;
}

.quick-action span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quick-action strong {
    margin-left: auto;
    min-width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(212, 160, 23, .22);
    color: var(--primary-900);
    font-size: .86rem;
}

.quick-action:hover {
    transform: translateY(-1px);
    background: rgba(255, 242, 245, .90);
    border-color: rgba(127, 18, 49, .34);
    color: var(--primary-900);
}

.quick-action.primary {
    background: linear-gradient(90deg, rgba(75, 0, 25, .94), rgba(163, 38, 75, .88));
    color: #fff;
    border-color: rgba(75, 0, 25, .20);
}

.quick-action.primary i {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.quick-action.warning i {
    background: rgba(212, 160, 23, .20);
    color: #815f00;
}

/* Login: imagen institucional visible sin repetir ni distorsionar */
.login-wrapper {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .66), rgba(247, 238, 242, .72)),
        url('/images/QUINTANA_ROO.png') center center / contain fixed no-repeat,
        var(--bg-main);
}

.login-card {
    position: relative;
    background-color: rgba(255, 255, 255, .70) !important;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/images/QUINTANA_ROO.png') center center / contain no-repeat;
    opacity: .18;
    pointer-events: none;
    z-index: 0;
}

.login-card > .row {
    position: relative;
    z-index: 1;
}

.login-card .bg-white {
    background-color: rgba(255, 255, 255, .78) !important;
}

.login-brand-panel {
    background:
        linear-gradient(135deg, rgba(75, 0, 25, .72), rgba(127, 18, 49, .52)),
        url('/images/QUINTANA_ROO.png') center center / contain no-repeat;
}
