﻿/* =========================
   LOKER'S - Inicio Layout
   SOLO Layout: sidebar + topbar + shell
   ========================= */

:root {
    --bg: #0b1220;
    --panel: rgba(255,255,255,.06);
    --panel2: rgba(255,255,255,.08);
    --border: rgba(255,255,255,.10);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.70);
    --muted2: rgba(255,255,255,.55);
    --shadow: 0 16px 50px rgba(0,0,0,.35);
    --accent: #4ea1ff;
    --accent2: #7cc1ff;
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-w: 280px;
    --topbar-h: 68px;
}

/* ✅ Fix global overflow */
html, body {
    width: 100%;
    overflow-x: hidden;
}

/* ✅ Shell (grid principal) */
.inicio-shell {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background: radial-gradient(900px 500px at 20% 0%, rgba(78,161,255,.25), transparent 60%), radial-gradient(700px 400px at 90% 10%, rgba(124,193,255,.18), transparent 55%), linear-gradient(180deg, #0a0f1c, #070b14);
    color: var(--text);
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    position: relative;
}

/* =========================
   BACKDROP (móvil)
   ========================= */
.inicio-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(5px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

/* =========================
   SIDEBAR
   ========================= */
.inicio-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    background: rgba(255,255,255,.05);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 18px;
    background: linear-gradient(135deg, rgba(78,161,255,.35), rgba(124,193,255,.18));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.brand-title {
    font-weight: 900;
    letter-spacing: .6px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted2);
    margin-top: 2px;
}

.sidebar-nav {
    padding: 14px 10px;
    overflow: auto;
}

.nav-section {
    font-size: 11px;
    color: var(--muted2);
    letter-spacing: 1px;
    padding: 10px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

    .nav-item:hover {
        background: rgba(255,255,255,.06);
        border-color: rgba(255,255,255,.10);
    }

    .nav-item:active {
        transform: translateY(1px);
    }

    .nav-item.active {
        background: linear-gradient(135deg, rgba(78,161,255,.22), rgba(124,193,255,.10));
        border-color: rgba(78,161,255,.28);
    }

.nav-ico {
    width: 26px;
    display: inline-flex;
    justify-content: center;
    opacity: .95;
}

.nav-text {
    flex: 1;
    font-weight: 700;
    font-size: 14px;
}

.nav-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.12);
    color: var(--muted);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 12px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.12);
}

.user-name {
    font-weight: 800;
    font-size: 13px;
}

.user-role {
    font-size: 12px;
    color: var(--muted2);
}

.btn-logout {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

    .btn-logout:hover {
        background: rgba(255,255,255,.09);
    }

/* =========================
   MAIN + TOPBAR
   ========================= */
.inicio-main {
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr auto;
    min-height: 100vh;
    min-width: 0;
}

.inicio-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    min-width: 0;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    flex: 0 0 auto;
}

    .btn-icon:hover {
        background: rgba(255,255,255,.09);
    }

.topbar-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-h1 {
    font-weight: 900;
    line-height: 1.05;
}

.topbar-h2 {
    font-size: 12px;
    color: var(--muted2);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    min-width: 260px;
}

.search-ico {
    opacity: .8;
}

.search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
}

    .search-input::placeholder {
        color: rgba(255,255,255,.55);
    }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    min-width: 0;
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: linear-gradient(135deg, rgba(78,161,255,.25), rgba(124,193,255,.12));
    border: 1px solid rgba(255,255,255,.14);
    flex: 0 0 auto;
}

.topbar-userinfo {
    min-width: 0;
}

.topbar-username,
.topbar-userrole {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.topbar-username {
    font-weight: 900;
    font-size: 13px;
    line-height: 1.0;
}

.topbar-userrole {
    font-size: 12px;
    color: var(--muted2);
    margin-top: 2px;
}

.inicio-content {
    padding: 16px;
    min-width: 0;
}

.inicio-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted2);
    background: rgba(255,255,255,.03);
}

/* =========================
   COLLAPSE SIDEBAR (Desktop)
   ========================= */
.inicio-shell.sidebar-closed {
    grid-template-columns: 92px minmax(0, 1fr);
}

    .inicio-shell.sidebar-closed .brand-text,
    .inicio-shell.sidebar-closed .nav-text,
    .inicio-shell.sidebar-closed .nav-badge,
    .inicio-shell.sidebar-closed .user-info,
    .inicio-shell.sidebar-closed .btn-logout span:last-child {
        display: none;
    }

    .inicio-shell.sidebar-closed .sidebar-brand,
    .inicio-shell.sidebar-closed .nav-item,
    .inicio-shell.sidebar-closed .user-mini {
        justify-content: center;
    }

/* =========================
   RESPONSIVE (Mobile)
   ========================= */
@media (max-width: 980px) {
    .search-box {
        display: none;
    }
}

@media (max-width: 560px) {
    .inicio-topbar {
        gap: 10px;
        padding: 10px 10px;
    }

    .topbar-userinfo {
        display: none;
    }

    .topbar-user {
        padding: 8px 8px;
        border-radius: 14px;
    }
}

@media (max-width: 860px) {
    .inicio-shell {
        grid-template-columns: 1fr;
    }

    .inicio-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-w);
        transform: translateX(-105%);
        transition: transform .18s ease;
        box-shadow: var(--shadow);
    }

    .inicio-shell.sidebar-open .inicio-sidebar {
        transform: translateX(0);
    }

    .inicio-shell.sidebar-open .inicio-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .inicio-shell.sidebar-closed {
        grid-template-columns: 1fr;
    }
}

/* =========================
   ALERT GLOBAL
   ========================= */
.alertTop {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    pointer-events: none;
}

    .alertTop * {
        pointer-events: auto;
    }





/* =========================
   BASE GLOBAL (NO rompe layout)
   ========================= */
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Links neutrales (evita morado/azul default) */
a {
    color: inherit;
    text-decoration: none;
}

/* Inputs y botones: heredan fuente, no se ven “Times” */
input, select, textarea, button {
    font: inherit;
}

    /* Placeholder en tema oscuro */
    input::placeholder, textarea::placeholder {
        color: rgba(255,255,255,.55);
        opacity: 1;
    }

/* Imágenes responsivas por defecto */
img {
    max-width: 100%;
    height: auto;
}