/* ====== Variables (tema) ====== */
:root{
    --bg: #0f172a;           /* slate-900 */
    --bg-soft: #111827;      /* gray-900 */
    --card: #0b1220;         /* navy glass */
    --muted: #94a3b8;        /* slate-400 */
    --text: #e5e7eb;         /* gray-200 */
    --text-strong: #ffffff;  /* white */
    --primary: #2563eb;      /* blue-600 */
    --success: #10b981;      /* emerald-500 */
    --accent: #7c3aed;       /* violet-600 */
    --shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
    --radius: 16px;
}

/* ====== Reset básico ====== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background:
            radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.20), transparent 60%),
            radial-gradient(1400px 700px at 110% 10%, rgba(37, 99, 235, 0.16), transparent 60%),
            var(--bg);
}

/* ====== Layout base ====== */
.page{
    max-width: 1200px;
    margin: 88px auto 48px auto; /* deja espacio a la barra superior fija */
    padding: 0 18px 32px;
}

/* ====== Hero ====== */
.hero{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(120deg, rgba(124,58,237,.14), rgba(37,99,235,.14));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}
.hero h1{ margin: 0 0 6px 0; color: var(--text-strong); font-size: clamp(22px, 2.6vw, 32px); }
.hero p{ margin: 0; color: var(--muted); }
.hero__badge{
    background: rgba(16,185,129,.18);
    color: #d1fae5;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(16,185,129,.35);
}

/* ====== Grid de contenido ====== */
.grid{
    margin-top: 22px;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px){
    .grid{
        grid-template-columns: 1.2fr 1fr;
    }
}

/* ====== Tarjetas y componentes ====== */
.card{
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.card__title{
    color: var(--text-strong);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: .2px;
}

/* ====== KPIs ====== */
.kpis{
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
}
@media (min-width: 700px){
    .kpis{
        grid-template-columns: repeat(3, 1fr);
    }
}
.kpi{
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 14px;
}
.kpi__icon{
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: rgba(124,58,237,.16);
    border: 1px solid rgba(124,58,237,.32);
    border-radius: 14px;
    font-size: 26px;
}
.kpi--accent .kpi__icon{
    background: rgba(37,99,235,.16);
    border-color: rgba(37,99,235,.32);
}
.kpi__meta h3{
    margin: 0 0 6px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.kpi__value{
    font-size: clamp(20px, 2.6vw, 26px);
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 6px;
}
.kpi__sub{
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}
.kpi__bar{
    height: 8px;
    background: rgba(37,99,235,.15);
    border: 1px solid rgba(37,99,235,.35);
    border-radius: 999px;
    overflow: hidden;
}
.kpi__bar span{
    display: block;
    height: 100%;
    background: var(--primary);
    width: 0%;
}
.kpi__bar--green{
    background: rgba(16,185,129,.15);
    border-color: rgba(16,185,129,.35);
}
.kpi__bar--green span{
    background: var(--success);
}

/* ====== Tabla ====== */
.table-wrapper{ overflow: auto; }
.table{
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    font-size: 14px;
}
.table thead th{
    text-align: left;
    background: rgba(255,255,255,0.04);
    color: var(--text-strong);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 12px 10px;
}
.table tbody td{
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 12px 10px;
}
.table tfoot td{
    border-top: 1px solid rgba(255,255,255,0.08);
    font-weight: 800;
    color: var(--text-strong);
    padding: 12px 10px;
}
.ta-right{ text-align: right; }

/* ====== Footer ====== */
.footer{
    margin-top: 24px;
    color: var(--muted);
    text-align: center;
}

/* ====== Botones / inputs (estéticos globales) ====== */
button{
    background: var(--success);
    color: #052e1f;
    border: 1px solid rgba(16,185,129,.6);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}
button:hover{ filter: brightness(1.05); }

input[type="text"], input[type="number"], input[type="date"], input[type="file"], select{
    width: 100%;
    background: rgba(255,255,255,0.02);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

/* ====== Ajustes para la barra superior (menu.php) ====== */
.topbar{
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(2,6,23,.7);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    z-index: 50;
}

chart-container {
    position: relative;
    height: 320px;   /* controla la altura */
    max-height: 60vh; /* opcional: evita que ocupe más del 60% de la pantalla */
}
/* ===== Carousel Avances ===== */
.carousel{
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
.carousel__track{
    display: flex;
    transition: transform .5s ease;
}
.slide{
    min-width: 100%;
    position: relative;
    background: #0b1220;
}
.slide img{
    display: block;
    width: 100%;
    height: 260px;           /* alto consistente */
    object-fit: cover;
    border-radius: 12px;
}
.slide__caption{
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    background: rgba(2,6,23,.55);
    border: 1px solid rgba(255,255,255,.15);
    color: #e5e7eb;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    backdrop-filter: blur(6px);
}

/* Controles */
.car-btn{
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
    color: #fff; cursor: pointer;
    display: grid; place-items: center;
}
.car-prev{ left: 10px; }
.car-next{ right: 10px; }
.car-btn:hover{ background: rgba(255,255,255,.14); }

/* Dots */
.car-dots{
    position: absolute; left: 0; right: 0; bottom: 8px;
    display: flex; gap: 6px; justify-content: center; align-items: center;
}
.dot{
    width: 8px; height: 8px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.18);
    cursor: pointer;
}
.dot.active{ background: #fff; }
