:root {
    --bg: #f4f7ff;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --border: #dbeafe;
    --ok: #166534;
    --ok-bg: #dcfce7;
    --err: #b91c1c;
    --err-bg: #fee2e2;
    /* KPI / acentos dashboard & reportes */
    --kpi-cot: #4f46e5;
    --kpi-fact: #059669;
    --kpi-tboard: #d97706;
    --kpi-users: #7c3aed;
    --kpi-general: #0e7490;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; }

.sil-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(122, 184, 255, 0.18) 0%, transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(160, 225, 255, 0.16) 0%, transparent 24%),
        linear-gradient(160deg, #0f3f99, #0d3b92 55%, #0c367f);
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.sil-login-shell {
    width: min(96vw, 900px);
    position: relative;
    z-index: 2;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}
.sil-login-card {
    width: 100%;
    max-width: 560px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 18px 45px rgba(10, 29, 96, 0.45);
    position: relative;
    z-index: 5;
}
.sil-login-card {
    max-width: 520px;
    background: rgba(255, 255, 255, 0.95);
}
.sil-login-banner {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e5edff;
    background: #fff;
}
.sil-login-logo {
    display: block;
    max-width: 220px;
    width: 100%;
    margin: 0 auto 10px;
}

/* Fondo tipo red de nodos (fractal) */
.sil-login::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='760' viewBox='0 0 420 760'%3E%3Cg stroke='rgba(255,255,255,0.32)' stroke-width='1' fill='none'%3E%3Cpath d='M12 40 L95 125 L180 85 L245 180 L140 265 L30 210 Z'/%3E%3Cpath d='M95 125 L160 210 L245 180 L290 270 L220 340 L140 265 Z'/%3E%3Cpath d='M30 380 L120 450 L210 420 L280 510 L170 585 L60 525 Z'/%3E%3Cpath d='M120 450 L190 520 L280 510 L335 605 L250 680 L170 585 Z'/%3E%3Cpath d='M180 85 L270 55 L350 120 L290 270'/%3E%3Cpath d='M220 340 L310 310 L385 365 L335 605'/%3E%3C/g%3E%3Cg fill='rgba(255,255,255,0.9)'%3E%3Ccircle cx='12' cy='40' r='2'/%3E%3Ccircle cx='95' cy='125' r='2'/%3E%3Ccircle cx='180' cy='85' r='2'/%3E%3Ccircle cx='245' cy='180' r='2'/%3E%3Ccircle cx='140' cy='265' r='2'/%3E%3Ccircle cx='30' cy='210' r='2'/%3E%3Ccircle cx='30' cy='380' r='2'/%3E%3Ccircle cx='120' cy='450' r='2'/%3E%3Ccircle cx='210' cy='420' r='2'/%3E%3Ccircle cx='280' cy='510' r='2'/%3E%3Ccircle cx='170' cy='585' r='2'/%3E%3Ccircle cx='60' cy='525' r='2'/%3E%3Ccircle cx='335' cy='605' r='2'/%3E%3C/g%3E%3C/svg%3E") left center / 30% 100% no-repeat,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='760' viewBox='0 0 420 760'%3E%3Cg stroke='rgba(255,255,255,0.32)' stroke-width='1' fill='none'%3E%3Cpath d='M408 60 L330 130 L240 100 L175 190 L272 275 L380 232 Z'/%3E%3Cpath d='M330 130 L265 218 L175 190 L122 278 L198 350 L272 275 Z'/%3E%3Cpath d='M392 390 L300 458 L205 425 L140 518 L248 594 L360 532 Z'/%3E%3Cpath d='M300 458 L228 525 L140 518 L90 610 L176 680 L248 594 Z'/%3E%3Cpath d='M240 100 L155 70 L78 136 L122 278'/%3E%3Cpath d='M198 350 L108 320 L35 375 L90 610'/%3E%3C/g%3E%3Cg fill='rgba(255,255,255,0.9)'%3E%3Ccircle cx='408' cy='60' r='2'/%3E%3Ccircle cx='330' cy='130' r='2'/%3E%3Ccircle cx='240' cy='100' r='2'/%3E%3Ccircle cx='175' cy='190' r='2'/%3E%3Ccircle cx='272' cy='275' r='2'/%3E%3Ccircle cx='380' cy='232' r='2'/%3E%3Ccircle cx='392' cy='390' r='2'/%3E%3Ccircle cx='300' cy='458' r='2'/%3E%3Ccircle cx='205' cy='425' r='2'/%3E%3Ccircle cx='140' cy='518' r='2'/%3E%3Ccircle cx='248' cy='594' r='2'/%3E%3Ccircle cx='360' cy='532' r='2'/%3E%3Ccircle cx='90' cy='610' r='2'/%3E%3C/g%3E%3C/svg%3E") right center / 30% 100% no-repeat,
      linear-gradient(30deg, transparent 0 49%, rgba(255,255,255,0.12) 50% 51%, transparent 52% 100%);
    opacity: 0.9;
    animation: silFractalDrift 15s ease-in-out infinite;
    pointer-events: none;
}

.sil-login::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      radial-gradient(circle at 8% 30%, rgba(255,255,255,0.55) 0 3px, transparent 4px),
      radial-gradient(circle at 92% 38%, rgba(255,255,255,0.5) 0 3px, transparent 4px),
      radial-gradient(circle at 16% 72%, rgba(175,225,255,0.6) 0 4px, transparent 5px),
      radial-gradient(circle at 86% 70%, rgba(175,225,255,0.58) 0 4px, transparent 5px),
      radial-gradient(circle at 50% 20%, rgba(255,255,255,0.14) 0 6px, transparent 7px),
      radial-gradient(circle at 52% 76%, rgba(255,255,255,0.14) 0 6px, transparent 7px);
    opacity: 0.72;
    pointer-events: none;
    animation: silNodesFloat 8s ease-in-out infinite;
}

.sil-login-card h1 {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.4px;
}

.sil-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 6px 0 12px;
}
/* Botones: visibles, amigables, jerarquía por color */
button.sil-btn,
a.sil-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}
button.sil-btn:active,
a.sil-btn:active { transform: translateY(1px); }

.sil-btn {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.sil-btn:hover {
    filter: brightness(1.03);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.sil-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 48%, #1d4ed8 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.sil-btn-primary:hover { filter: brightness(1.06); }

.sil-btn-success {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.32);
}
.sil-btn-success:hover { filter: brightness(1.05); }

.sil-btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 55%, #b91c1c 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.sil-btn-danger:hover { filter: brightness(1.05); }

.sil-btn-muted {
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
    color: #f1f5f9 !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25);
}
.sil-btn-muted:hover { filter: brightness(1.08); }

/* Secundario “acento” (exportar, acciones destacadas) */
.sil-btn-accent {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}
.sil-btn-accent:hover { filter: brightness(1.05); }

.sil-login-card .sil-btn-primary {
    width: 100%;
    padding: 13px 18px;
    font-size: 1rem;
    border-radius: 14px;
    margin-top: 4px;
}

.sil-muted { color: var(--muted); font-size: 0.92rem; }
.sil-ok { background: var(--ok-bg); color: var(--ok); padding: 10px; border-radius: 10px; margin: 10px 0; }
.sil-err { background: var(--err-bg); color: var(--err); padding: 10px; border-radius: 10px; margin: 10px 0; }

.sil-app { display: flex; min-height: 100vh; }
.sil-sidebar {
    width: 260px;
    background: #1e3a8a;
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sil-brand { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.sil-brand-logo {
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 8px;
}
.sil-brand-logo img {
    width: 100%;
    max-height: 58px;
    object-fit: contain;
    display: block;
}
.sil-brand-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sil-brand-mini img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
/* Menú lateral: cada entrada con color propio (misma familia que KPIs) */
.sil-nav-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sil-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    line-height: 1.25;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease, border-color 0.15s ease;
}
.sil-nav__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sil-nav:hover:not(.active) {
    filter: brightness(1.1);
    transform: translateX(3px);
}
.sil-nav.active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
    filter: brightness(1.05);
}

.sil-nav--dashboard {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.55) 0%, rgba(67, 56, 202, 0.42) 100%);
    border-color: rgba(165, 180, 252, 0.4);
}
.sil-nav--dashboard .sil-nav__dot {
    background: #c7d2fe;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.sil-nav--colegios {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.5) 0%, rgba(15, 118, 110, 0.45) 100%);
    border-color: rgba(45, 212, 191, 0.38);
}
.sil-nav--colegios .sil-nav__dot {
    background: #5eead4;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.45);
}

.sil-nav--reportes {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.55) 0%, rgba(217, 119, 6, 0.48) 100%);
    border-color: rgba(252, 211, 77, 0.42);
}
.sil-nav--reportes .sil-nav__dot {
    background: #fcd34d;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5);
}

.sil-nav--usuarios {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.48) 0%, rgba(190, 24, 93, 0.42) 100%);
    border-color: rgba(251, 113, 133, 0.4);
}
.sil-nav--usuarios .sil-nav__dot {
    background: #fda4af;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.45);
}

.sil-nav--perfil {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.52) 0%, rgba(126, 34, 206, 0.44) 100%);
    border-color: rgba(216, 180, 254, 0.42);
}
.sil-nav--perfil .sil-nav__dot {
    background: #d8b4fe;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.45);
}
.sil-user { margin-top: auto; font-size: 0.92rem; display: grid; gap: 4px; }
.sil-user span { opacity: 0.85; }
.sil-user a { color: #fff; text-decoration: underline; }
.sil-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.35);
    margin-bottom: 4px;
}
.sil-perfil-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
}
.sil-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer; font-size: 0.92rem; }

.sil-main { flex: 1; padding: 20px; }
.sil-main {
    position: relative;
    background:
        radial-gradient(circle at 12% 12%, rgba(184, 220, 255, 0.23) 0%, transparent 24%),
        radial-gradient(circle at 84% 10%, rgba(167, 210, 255, 0.20) 0%, transparent 22%),
        linear-gradient(180deg, #f4f8ff 0%, #edf4ff 100%);
}

.sil-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(54, 117, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(54, 117, 255, 0.08) 1px, transparent 1px);
    background-size: 55px 55px;
    pointer-events: none;
}

.sil-main > * {
    position: relative;
    z-index: 1;
}
.sil-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.sil-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* Bloques de métricas: cada uno con identidad visual clara */
.sil-kpi {
    --kpi-accent: #6366f1;
    border-radius: 14px;
    padding: 16px 16px 16px 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 5px solid var(--kpi-accent);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.sil-kpi span {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 6px;
}
.sil-kpi strong {
    display: block;
    font-size: 1.28rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    word-break: break-word;
}
.sil-kpi--cotizaciones { --kpi-accent: var(--kpi-cot); background: linear-gradient(145deg, #eef2ff 0%, #fff 55%); }
.sil-kpi--facturacion { --kpi-accent: var(--kpi-fact); background: linear-gradient(145deg, #ecfdf5 0%, #fff 55%); }
.sil-kpi--tboard { --kpi-accent: var(--kpi-tboard); background: linear-gradient(145deg, #fffbeb 0%, #fff 55%); }
.sil-kpi--usuarios { --kpi-accent: var(--kpi-users); background: linear-gradient(145deg, #f5f3ff 0%, #fff 55%); }
.sil-kpi--general { --kpi-accent: var(--kpi-general); }
.sil-kpi.sil-kpi--general {
    border-style: dashed;
    border-left-style: solid;
    box-shadow: 0 4px 16px rgba(14, 116, 144, 0.12);
}

.sil-card--dashboard { padding-top: 20px; }

.sil-dash-band {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #cbd5e1;
}
.sil-dash-band:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.sil-dash-band__title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #334155;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sil-dash-band__title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.sil-dash-band--general .sil-dash-band__title::before {
    background: var(--kpi-general);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.22);
}

/* Reportes / dashboard: fila de gráficas compacta */
.sil-charts-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}
@media (max-width: 1100px) {
    .sil-charts-row { grid-template-columns: 1fr; }
}
.sil-chart-card {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 70%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.sil-chart-card h3 {
    font-size: 0.82rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}
.sil-chart-canvas-wrap {
    position: relative;
    height: 200px;
    width: 100%;
    max-width: 100%;
}

.sil-report-kpis {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}
/* Mismo encabezado que «Resumen del periodo» en reportes */
.sil-dash-band__title--kpi-block {
    margin-bottom: 12px;
    font-size: 1rem;
    color: #1e293b;
}
.sil-kpi-section__hint {
    margin: -4px 0 12px;
    font-size: 0.92rem;
}
.sil-dash-band__title--general::before {
    background: var(--kpi-general) !important;
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.22) !important;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px; border-bottom: 1px solid #eef2ff; text-align: left; font-size: 0.93rem; }
th { background: #f8fbff; }
.sil-table-wrap table a:not(.sil-btn) {
    display: inline-block;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}
.sil-table-wrap table a:not(.sil-btn):hover {
    background: rgba(37, 99, 235, 0.18);
}

.sil-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sil-table-wrap { overflow-x: auto; }

@media (max-width: 900px) {
    .sil-app { flex-direction: column; }
    .sil-sidebar { width: 100%; }
}

@keyframes silFractalDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -6px, 0) scale(1.015);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes silNodesFloat {
    0% { transform: translateY(0px) translateX(0px); opacity: 0.72; }
    50% { transform: translateY(-8px) translateX(4px); opacity: 0.92; }
    100% { transform: translateY(0px) translateX(0px); opacity: 0.72; }
}
