/* ********************************************************************************************
 * @Name:        site.css
 * @Description: Dark theme Truevice — paleta azul/teal para empresa tech de Internet+WiFi
 * @Author:      pixel
 * @Date:        2026/05/25
 ******************************************************************************************** */

/* ===================== VARIABLES ===================== */
:root {
    --blue:    #1A6BFF;
    --blue2:   #1255CC;
    --blue3:   #4D90FF;
    --teal:    #00D4C8;
    --teal2:   #00A89D;
    --white:   #FFFFFF;
    --dark:    #07090F;
    --bg:      #0A0E1A;
    --sf:      #0F1526;
    --card:    #141929;
    --dim:     #1E2640;
    --border:  rgba(26,107,255,.18);
    --border2: rgba(0,212,200,.25);
    --green:   #22C55E;
    --yellow:  #F59E0B;
    --red:     #EF4444;
    --text:    #E8F0FF;
    --muted:   #7A8CB0;
    --mono:    'JetBrains Mono', monospace;
    --sans:    'Inter', system-ui, sans-serif;
    --sidebar-w: 240px;
    --sidebar-collapsed-w: 68px;
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(26,107,255,.15) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(0,212,200,.08) 0%, transparent 50%);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    min-height: 100vh;
    line-height: 1.5;
}

/* ===================== LAYOUT ===================== */
.tv-wrapper { display: flex; min-height: 100vh; }

/* ===================== SIDEBAR ===================== */
.tv-sidebar {
    width: var(--sidebar-w);
    background: var(--sf);
    border-right: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: width .22s ease, transform .25s ease;
    overflow: hidden;
}

.tv-sidebar-backdrop { display: none; }

.tv-sidebar-logo {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-brand-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-text span:first-child { color: var(--blue3); }
.sidebar-brand-text span:last-child  { color: var(--teal); }

.sidebar-brand-compact {
    display: none;
    font-size: 16px;
    font-weight: 800;
    color: var(--blue3);
    width: 36px;
    text-align: center;
}

.tv-sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    flex-shrink: 0;
    transition: color .2s;
}
.tv-sidebar-collapse-btn:hover { color: var(--blue3); }
.collapse-open { display: none; }
.collapse-close { display: block; }

.tv-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tv-nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 8px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.tv-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
}
.tv-nav a:hover { background: var(--dim); color: var(--text); }
.tv-nav a.active { background: rgba(26,107,255,.18); color: var(--blue3); }

.nav-icon { flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tv-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
}

/* Sidebar colapsado */
body.sidebar-collapsed .tv-sidebar { width: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .tv-nav-section,
body.sidebar-collapsed .tv-sidebar-footer > span { display: none; }
body.sidebar-collapsed .sidebar-brand-compact { display: block; }
body.sidebar-collapsed .collapse-close { display: none; }
body.sidebar-collapsed .collapse-open  { display: block; }
body.sidebar-collapsed .tv-sidebar-footer { justify-content: center; }
body.sidebar-collapsed .tv-sidebar-footer { justify-content: center; font-size: 10px; }

/* ===================== MAIN AREA ===================== */
.tv-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .22s ease;
}
body.sidebar-collapsed .tv-main { margin-left: var(--sidebar-collapsed-w); }

/* ===================== TOPBAR ===================== */
.tv-topbar {
    height: 56px;
    background: var(--sf);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tv-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.tv-mobile-menu-btn .menu-close { display: none; }

.tv-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.tv-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tv-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 6px var(--teal);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

.tv-user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--dim);
    padding: 4px 10px;
    border-radius: 20px;
}

.tv-btn-logout {
    background: rgba(239,68,68,.12);
    color: var(--red);
    border: 1px solid rgba(239,68,68,.3);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.tv-btn-logout:hover { background: rgba(239,68,68,.25); }

/* ===================== CONTENT ===================== */
.tv-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

/* ===================== CARDS ===================== */
.tv-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.tv-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 12px;
}

.tv-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tv-stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.tv-stat-val.blue  { color: var(--blue3); }
.tv-stat-val.teal  { color: var(--teal); }
.tv-stat-val.green { color: var(--green); }
.tv-stat-val.red   { color: var(--red); }
.tv-stat-val.yellow{ color: var(--yellow); }

.tv-stat-label {
    font-size: 12px;
    color: var(--muted);
}

/* ===================== GRID STATS ===================== */
.tv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ===================== SEMÁFOROS ===================== */
.tv-ok      { color: var(--green); }
.tv-revisar { color: var(--yellow); }
.tv-alerta  { color: var(--red); }

.tv-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    gap: 4px;
}
.tv-badge-ok      { background: rgba(34,197,94,.15);  color: var(--green); }
.tv-badge-revisar { background: rgba(245,158,11,.15); color: var(--yellow); }
.tv-badge-alerta  { background: rgba(239,68,68,.15);  color: var(--red); }
.tv-badge-blue    { background: rgba(26,107,255,.18); color: var(--blue3); }
.tv-badge-teal    { background: rgba(0,212,200,.15);  color: var(--teal); }
.tv-badge-muted   { background: var(--dim); color: var(--muted); }

/* ===================== TABLA ===================== */
.tv-table-wrap { overflow-x: auto; }

table.tv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.tv-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
table.tv-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: middle;
}
table.tv-table tbody tr:hover { background: rgba(255,255,255,.025); }
table.tv-table tbody tr:last-child td { border-bottom: none; }

/* ===================== TIMELINE DE ETAPAS ===================== */
.tv-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 0;
    overflow-x: auto;
}

.tv-tl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 90px;
}

/* Línea conectora */
.tv-tl-step::before {
    content: '';
    position: absolute;
    top: 12px;
    left: calc(-50% + 12px);
    right: calc(50% + 12px);
    height: 2px;
    background: var(--dim);
    transition: background .3s;
}
.tv-tl-step:first-child::before { display: none; }
.tv-tl-step.done::before,
.tv-tl-step.active::before { background: var(--blue); }

/* Círculo */
.tv-tl-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--dim);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    position: relative;
    z-index: 1;
    transition: all .3s;
}
.tv-tl-step.done .tv-tl-dot {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}
.tv-tl-step.active .tv-tl-dot {
    background: var(--blue3);
    border-color: var(--blue3);
    color: white;
    box-shadow: 0 0 0 4px rgba(26,107,255,.25);
    animation: tl-pulse 2s infinite;
}
.tv-tl-step.cerrado .tv-tl-dot {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

@keyframes tl-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(26,107,255,.25); }
    50%       { box-shadow: 0 0 0 8px rgba(26,107,255,.10); }
}

.tv-tl-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    margin-top: 6px;
    white-space: nowrap;
}
.tv-tl-step.done .tv-tl-label,
.tv-tl-step.active .tv-tl-label { color: var(--blue3); }
.tv-tl-step.cerrado .tv-tl-label { color: var(--teal); }

/* Timeline miniatura (en lista de proyectos) */
.tv-tl-mini {
    display: flex;
    align-items: center;
    gap: 3px;
}
.tv-tl-mini-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--dim);
    flex-shrink: 0;
    transition: background .2s;
}
.tv-tl-mini-dot.done   { background: var(--blue); }
.tv-tl-mini-dot.active { background: var(--blue3); box-shadow: 0 0 4px var(--blue3); }
.tv-tl-mini-dot.cerrado{ background: var(--teal); }
.tv-tl-mini-line {
    flex: 1;
    height: 2px;
    background: var(--dim);
    min-width: 8px;
}
.tv-tl-mini-line.done { background: var(--blue); }

/* ===================== FORMULARIOS ===================== */
.tv-form-group { margin-bottom: 18px; }
.tv-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tv-input,
.tv-select,
.tv-textarea {
    width: 100%;
    background: var(--dim);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--sans);
    transition: border-color .2s;
    outline: none;
}
.tv-input:focus, .tv-select:focus, .tv-textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,107,255,.15);
}
.tv-textarea { resize: vertical; min-height: 80px; }
.tv-select option { background: var(--card); }
.has-error .tv-input,
.has-error .tv-select { border-color: var(--red); }
.help-block { font-size: 11px; color: var(--red); margin-top: 4px; }

/* ===================== BOTONES ===================== */
.tv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    font-family: var(--sans);
}
.tv-btn svg { width: 15px; height: 15px; }

.tv-btn-primary  { background: var(--blue);  color: white; }
.tv-btn-primary:hover  { background: var(--blue2); color: white; }

.tv-btn-teal     { background: var(--teal);  color: var(--dark); }
.tv-btn-teal:hover     { background: var(--teal2); color: var(--dark); }

.tv-btn-ghost    { background: var(--dim);   color: var(--text); border: 1px solid var(--border); }
.tv-btn-ghost:hover    { background: rgba(255,255,255,.07); color: var(--text); }

.tv-btn-danger   { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.tv-btn-danger:hover   { background: rgba(239,68,68,.25); color: var(--red); }

.tv-btn-sm { padding: 5px 10px; font-size: 11px; }

/* ===================== PAGE HEADER ===================== */
.tv-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.tv-page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.tv-page-title small {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 8px;
}

/* ===================== ALERTAS FLASH ===================== */
.tv-flash {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}
.tv-flash-success { background: rgba(34,197,94,.12);  color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.tv-flash-error   { background: rgba(239,68,68,.12);  color: var(--red);   border: 1px solid rgba(239,68,68,.3); }
.tv-flash-info    { background: rgba(26,107,255,.12); color: var(--blue3); border: 1px solid rgba(26,107,255,.3); }

/* ===================== KPI AREA HEADER ===================== */
.tv-area-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--blue3);
}

/* ===================== LOGIN ===================== */
.tv-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 25% 0%, rgba(26,107,255,.18) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 100%, rgba(0,212,200,.10) 0%, transparent 50%);
}

.tv-login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.tv-login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.tv-login-logo .brand-name {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}
.tv-login-logo .brand-name span:first-child { color: var(--blue3); }
.tv-login-logo .brand-name span:last-child  { color: var(--teal); }
.tv-login-logo small {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* ===================== FOOTER INSTITUCIONAL ===================== */
.tv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    flex-shrink: 0;
}
.tv-footer__right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tv-footer__logo {
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: .6;
    vertical-align: middle;
    transition: opacity .2s;
}
.tv-footer__right a:hover .tv-footer__logo { opacity: 1; }
.tv-footer__right a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* ===================== MOBILE QUICKNAV ===================== */
.tv-mobile-quicknav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--sf);
    border-top: 1px solid var(--border);
    z-index: 150;
    padding: 6px 0;
    justify-content: space-around;
}
.tv-mobile-quicknav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
}
.tv-mobile-quicknav a.active { color: var(--blue3); }
.tv-mobile-quicknav .quick-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.tv-mobile-quicknav .quick-icon svg { width: 20px; height: 20px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .tv-sidebar {
        transform: translateX(-100%);
    }
    .tv-sidebar.open { transform: translateX(0); }

    .tv-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    body.sidebar-open .tv-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .tv-main { margin-left: 0; }
    .tv-mobile-menu-btn { display: flex; }
    .tv-mobile-quicknav { display: flex; }
    .tv-content { padding: 16px 12px 80px; }
    .tv-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== UTILIDADES ===================== */
.text-muted   { color: var(--muted); }
.text-blue    { color: var(--blue3); }
.text-teal    { color: var(--teal); }
.text-green   { color: var(--green); }
.text-yellow  { color: var(--yellow); }
.text-red     { color: var(--red); }
.mono         { font-family: var(--mono); font-size: 12px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
