/* ══════════════════════════════════════
   PALETA: Verde-Azulado & Blanco
   ══════════════════════════════════════ */
:root {
    /* Layout */
    --sidebar-width: 240px;
    --navbar-height: 56px;
    --transition: .25s ease;

    /* Paleta principal */
    --color-primary:      #0e7490;   /* teal-700  — navbar */
    --color-primary-dark: #0a5568;   /* teal-900  — hover  */
    --color-accent:       #22d3ee;   /* cyan-400  — activo */

    /* Sidebar */
    --sidebar-bg:           #083344; /* teal muy oscuro */
    --sidebar-hover:        rgba(255,255,255,.06);
    --sidebar-active-bg:    rgba(34,211,238,.15);
    --sidebar-active-border:#22d3ee;
    --sidebar-text:         #90c8d4;

    /* Página */
    --bg-page: #f0f9fb;

    /* Bootstrap override (bg-primary, btn-primary) */
    --bs-primary:     #0e7490;
    --bs-primary-rgb: 14,116,144;
    --bs-link-color:  #0e7490;
}

/* ── Base ── */
body {
    background-color: var(--bg-page);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Bootstrap primary override */
.bg-primary          { background-color: var(--color-primary) !important; }
.btn-primary         { background-color: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.btn-primary:hover   { background-color: var(--color-primary-dark) !important; border-color: var(--color-primary-dark) !important; }
.btn-outline-primary { color: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.btn-outline-primary:hover { background-color: var(--color-primary) !important; color: #fff !important; }
.text-primary        { color: var(--color-primary) !important; }
.border-primary      { border-color: var(--color-primary) !important; }

/* ════════════════════════════════════════
   LAYOUT: sidebar fijo izquierda +
   content-wrapper a su derecha
   ════════════════════════════════════════ */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar: full height, fijo ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition);
    flex-shrink: 0;
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

/* ── Sidebar header ── */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 1rem 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    overflow: hidden;
    text-align: center;
}

.sidebar-header .sidebar-logo {
    display: block;
    max-height: 80px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-header .sidebar-logo-default {
    max-height: 94px;
    max-width: 195px;
    padding: .35rem;
    background: #fff;
    border-radius: .65rem;
}

.login-brand-logo {
    display: block;
    width: min(100%, 280px);
    height: auto;
    margin: 0 auto .75rem;
}

/* ════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr);
    background: #fff;
}

.content-wrapper.public-content-wrapper {
    margin-left: 0;
    width: 100%;
}

.public-page-content {
    min-height: 100vh;
}

.login-showcase {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(3rem, 7vw, 7rem);
    color: #fff;
    background:
        radial-gradient(circle at 15% 15%, rgba(34,211,238,.2), transparent 30%),
        linear-gradient(145deg, #062b3b 0%, #083f55 52%, #0e7490 100%);
}

.login-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom right, #000, transparent 80%);
}

.login-showcase-content {
    position: relative;
    z-index: 2;
    width: min(100%, 760px);
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.5rem;
    padding: .5rem .85rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #bcebf4;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.login-showcase h1 {
    max-width: 720px;
    margin-bottom: 1.25rem;
    font-size: clamp(2.25rem, 4.5vw, 4.35rem);
    font-weight: 750;
    line-height: 1.03;
    letter-spacing: -.045em;
}

.login-lead {
    max-width: 650px;
    margin-bottom: 2.5rem;
    color: #b9dbe2;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.7;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.login-feature {
    display: flex;
    gap: .9rem;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .9rem;
    background: rgba(3,32,43,.28);
    backdrop-filter: blur(8px);
}

.login-feature > span {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border-radius: .7rem;
    background: rgba(34,211,238,.14);
    color: #67e8f9;
    font-size: 1.15rem;
}

.login-feature strong,
.login-feature small {
    display: block;
}

.login-feature strong {
    margin-bottom: .2rem;
    font-size: .9rem;
}

.login-feature small {
    color: #9fc8d2;
    font-size: .74rem;
    line-height: 1.45;
}

.login-showcase-decoration {
    position: absolute;
    right: -3rem;
    bottom: -5rem;
    color: rgba(255,255,255,.04);
    font-size: 22rem;
    line-height: 1;
    transform: rotate(-8deg);
}

.login-access {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 4.5rem);
    background:
        radial-gradient(circle at 100% 0, rgba(34,211,238,.09), transparent 28%),
        #f6fbfc;
}

.login-card {
    width: min(100%, 440px);
    border: 1px solid #dceef2;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 24px 65px rgba(8,51,68,.12);
}

.login-card-body {
    padding: clamp(1.6rem, 4vw, 2.5rem);
}

.login-card h2 {
    margin: -.15rem 0 .25rem;
    color: #0b3445;
    font-size: 1.3rem;
    font-weight: 750;
}

.login-card .form-label {
    color: #365865;
    font-size: .82rem;
    font-weight: 650;
}

.login-card .input-group-text {
    border-color: #d8e8ec;
    background: #f3fafb;
}

.login-card .form-control {
    min-height: 46px;
    border-color: #d8e8ec;
}

.login-submit {
    min-height: 48px;
    border-radius: .65rem;
    font-size: .95rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(14,116,144,.2);
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: 1.35rem;
    color: #73909a;
    font-size: .7rem;
}

.login-security-note i {
    color: var(--color-primary);
}

@media (max-width: 991.98px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-showcase {
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }

    .login-showcase h1 {
        max-width: 620px;
        font-size: clamp(2rem, 8vw, 3.2rem);
    }

    .login-showcase-decoration {
        font-size: 14rem;
    }

    .login-access {
        padding: 2.5rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .login-showcase {
        padding: 2rem 1rem;
    }

    .login-kicker,
    .login-lead {
        margin-bottom: 1.25rem;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
    }

    .login-feature:nth-child(n+3) {
        display: none;
    }

    .login-access {
        padding: 1.25rem .8rem 2rem;
    }

    .login-card {
        border-radius: 1rem;
    }
}

.sys-name {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sys-sub {
    font-size: .65rem;
    color: #5d7a8c;
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-top: 4px;
}

/* ── Sidebar section label ── */
.sidebar-section {
    padding: .65rem 1.2rem .25rem;
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(144,200,212,.4);
    font-weight: 700;
    margin-top: .25rem;
    border-top: 1px solid rgba(255,255,255,.05);
}
.sidebar-section:first-child {
    border-top: none;
    margin-top: 0;
}

/* ── Sidebar nav ── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(183, 220, 231, .16) transparent;
}

.sidebar-nav:hover {
    scrollbar-color: rgba(183, 220, 231, .38) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(183, 220, 231, .16);
    background-clip: padding-box;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb { background-color: rgba(183, 220, 231, .38); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background-color: rgba(183, 220, 231, .55); }

/* ── Content wrapper: desplazado el ancho del sidebar ── */
.content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.content-wrapper.expanded {
    margin-left: 0;
}

/* ── Navbar: sticky dentro del content-wrapper ── */
.navbar {
    position: sticky;
    top: 0;
    height: var(--navbar-height);
    z-index: 1020;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    flex-shrink: 0;
}

/* ── Contenido de página ── */

/* ════════════════════════════════════════
   PAGE HEADER — estándar para todas las vistas
   ════════════════════════════════════════ */
.page-header    { margin-bottom: 1.75rem; }
.page-header h4 { margin: 0; font-weight: 700; color: #1a2e35; }
.page-header p  { margin: .2rem 0 0; font-size: .85rem; color: #6c757d; }

/* ── Section label — estándar para todas las vistas ── */
.section-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(14,116,144,.2), transparent);
}

/* ── Action bar — estándar para todas las vistas ── */
.action-bar {
    background: #fff;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 1rem 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}
.page-content {
    flex: 1;
}

/* ── Overlay móvil ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1029;
}

.sidebar-overlay.show {
    display: block;
}

/* ════════════════════════════════════════
   SIDEBAR LINKS
   ════════════════════════════════════════ */

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem 1.2rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.sidebar-link i:first-child {
    font-size: .95rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active-bg); color: #fff; border-left-color: var(--sidebar-active-border); }

.sidebar-toggle-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
}

.sidebar-toggle-btn:focus { outline: none; box-shadow: none; }

.sidebar-arrow {
    font-size: .65rem;
    margin-left: auto !important;
    transition: transform var(--transition);
}

.sidebar-toggle-btn.open .sidebar-arrow { transform: rotate(180deg); }

.sidebar-submenu { display: none; background: rgba(0,0,0,.18); }
.sidebar-submenu.open { display: block; }

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem 1.2rem .48rem 2.9rem;
    color: #7d96a8;
    text-decoration: none;
    font-size: .825rem;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.sidebar-sublink:hover { background: var(--sidebar-hover); color: #cde; }
.sidebar-sublink.active { background: var(--sidebar-active-bg); color: #fff; border-left-color: var(--sidebar-active-border); }

/* ── Suscripción: bloque de cuenta destacado ── */
.subscription-sidebar-card {
    margin: 1rem .7rem .7rem;
    overflow: hidden;
    border: 1px solid rgba(101, 214, 255, .28);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(21, 118, 160, .28), rgba(80, 62, 157, .22));
    box-shadow: 0 10px 24px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.subscription-sidebar-card .subscription-toggle {
    min-height: 66px;
    padding: .7rem .75rem;
    border-left: 0;
    color: #eefaff;
}

.subscription-sidebar-card .subscription-toggle:hover,
.subscription-sidebar-card .subscription-toggle.open {
    background: rgba(101, 214, 255, .1);
}

.subscription-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: #dff8ff;
    background: linear-gradient(135deg, #148cad, #6554c0);
    box-shadow: 0 5px 12px rgba(0, 0, 0, .24);
}

.subscription-icon i {
    width: auto !important;
    font-size: 1rem !important;
}

.subscription-title {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    line-height: 1.15;
}

.subscription-title strong { font-size: .88rem; font-weight: 700; }
.subscription-title small { margin-top: .2rem; color: #9fc5d3; font-size: .64rem; }

.subscription-sidebar-card .sidebar-arrow { margin-left: auto !important; }

.subscription-sidebar-card .subscription-submenu {
    padding: .35rem 0 .5rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(5, 26, 40, .24);
}

.subscription-sublink {
    width: 100%;
    padding: .48rem .8rem .48rem 1rem;
    border: 0;
    border-left: 3px solid transparent;
    text-align: left;
    background: transparent;
    cursor: default;
}

.subscription-sublink:hover {
    color: #cde;
    background: rgba(255, 255, 255, .04);
}

/* ════════════════════════════════════════
   PLANES DE SUSCRIPCIÓN
   ════════════════════════════════════════ */
.plans-page { padding-bottom: 1.5rem; }
.plans-grid { row-gap: 1.5rem; }
.plans-heading { max-width: 720px; }
.plans-heading h1 { color: #14384b; font-size: clamp(1.7rem, 3vw, 2.45rem); }
.plans-kicker {
    display: inline-flex;
    align-items: center;
    padding: .38rem .75rem;
    border-radius: 999px;
    color: #116780;
    background: #e5f7fb;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.plan-card {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    color: #fff;
    background-image: var(--plan-bg);
    background-position: center;
    background-size: cover;
    box-shadow: 0 18px 45px rgba(20, 56, 75, .18);
    transition: transform .25s ease, box-shadow .25s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 54px rgba(20, 56, 75, .28);
}

.plan-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 24, 35, .45), rgba(5, 25, 39, .93) 48%, rgba(4, 20, 31, .98));
}

.plan-current { outline: 3px solid rgba(36, 190, 152, .72); outline-offset: 2px; }

.plan-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 560px;
    padding: 1.6rem;
    flex-direction: column;
}

.plan-label {
    margin-bottom: .28rem;
    color: #a8d7e5;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.plan-name { color: #fff; font-size: 1.45rem; }
.plan-current-badge,
.plan-saving-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .32rem .55rem;
    border-radius: 999px;
    font-size: .67rem;
    font-weight: 700;
    white-space: nowrap;
}
.plan-current-badge { color: #d8fff3; background: rgba(32, 170, 133, .28); }
.plan-saving-badge { color: #fff3c4; background: rgba(220, 161, 27, .3); }
.plan-price-wrap { min-height: 73px; }
.plan-currency { vertical-align: top; color: #b9d9e4; font-size: 1.1rem; font-weight: 700; }
.plan-price { color: #fff; font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.06em; }
.plan-period { display: block; margin-top: .38rem; color: #b8d1da; font-size: .78rem; }
.plan-description { min-height: 48px; color: #d6e4e9; font-size: .9rem; }
.plan-features { display: grid; gap: .75rem; color: #e8f0f3; font-size: .88rem; }
.plan-features li { display: flex; align-items: flex-start; gap: .55rem; }
.plan-features i { margin-top: .1rem; color: #63dbba; }
.plan-card .btn { border-radius: 12px; font-weight: 700; }
.plan-card .btn-primary { border-color: #24a9c7; background: linear-gradient(135deg, #148cad, #6554c0); }
.plan-card .btn-primary:hover { border-color: #6b58c7; background: linear-gradient(135deg, #117b99, #5847ad); }

@media (max-width: 767.98px) {
    .plan-card,
    .plan-card-content { min-height: 520px; }
}

/* ── Mobile ── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0 !important;
    }
}

/* ── Cards ── */
.card { border-radius: .75rem; background-color: #fff; }

/* ── Badge primary override ── */
.badge.bg-primary { background-color: var(--color-primary) !important; }

/* ── Sidebar header icon teal ── */
.sidebar-header .bi-box-seam { color: var(--color-accent) !important; }

/* ── Dashboard stat cards: icon teal ── */
.stat-icon-teal   { background-color: rgba(14,116,144,.12); color: var(--color-primary); }
.stat-icon-green  { background-color: rgba(16,185,129,.12); color: #10b981; }
.stat-icon-amber  { background-color: rgba(245,158,11,.12); color: #f59e0b; }
.stat-icon-red    { background-color: rgba(239,68,68,.12);  color: #ef4444; }
