﻿/* ============================================================
   QuedaListo — Notificaciones CLIENTE (dark theme)
   ============================================================ */

:root {
    --bg:           #0b0f14;
    --card:         #121821;
    --card-2:       #0f141b;
    --card-hover:   #18202a;
    --border:       #1f2937;
    --border-soft:  #29323f;

    --text:         #ffffff;
    --muted:        #9ca3af;
    --text-soft:    #6b7280;

    --primary:      var(--ql-primario);
    --primary-hov:  var(--ql-primario-hover);
    --azul:         #3b82f6;
    --green:        #22c55e;
    --red:          #ef4444;
    --yellow:       #f59e0b;
    --purple:       var(--ql-primario-claro);
    --naranja:      var(--ql-primario);

    --sidebar-bg:   #0a0a0a;
    --sidebar-hover:#16181c;

}

/* ===== Tema claro (día) ===== */
html[data-theme="light"] {
    /* estados más oscuros para que se lean sobre blanco */
    --green: #15803d; --yellow: #d97706; --red: #dc2626; --blue: #2563eb;
    --bg:           #eef2f6;
    --card:         #ffffff;
    --card-2:       #f6f8fa;
    --card-hover:   #eef2f6;
    --border:       #e2e8f0;
    --border-soft:  #cbd5e1;
    --text:         #0f172a;
    --muted:        #64748b;
    --text-soft:    #94a3b8;
    --sidebar-bg:   #ffffff;
    --sidebar-hover:#f1f5f9;
}


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

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.offline-bar, .topbar-user-btn, .topbar-user-popup { display: none !important; }
.bottom-nav { display: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR (cliente dark)
   ============================================================ */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 0;
}
.sidebar-logo {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo-img { width: 66%; height: auto; object-fit: contain; display: block; }

.sidebar-nav {
    display: flex; flex-direction: column;
    gap: 2px; padding: 12px 10px; flex: 1;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted);
    padding: 12px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    text-decoration: none;
    transition: background .18s, color .18s;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: var(--text); }
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgb(var(--ql-primario-rgb) / .3);
}
.nav-badge {
    margin-left: auto;
    background: var(--primary); color: #fff;
    border-radius: 999px;
    min-width: 22px; height: 22px;
    padding: 0 7px;
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-nav a.active .nav-badge { background: var(--text); color: var(--primary); }

.sidebar-avatar-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 14px 8px !important;
    margin-top: auto;
    border-top: 1px solid var(--border);
}
.sidebar-avatar-big {
    width: 36px !important; height: 36px !important;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px !important; font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-avatar-wrap strong {
    font-size: 13px !important;
    font-weight: 700; color: var(--text) !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: left !important;
}
.sidebar-avatar-role { display: none !important; }
.sidebar-help { display: none !important; }

.btn-logout {
    margin: 0 14px 18px !important;
    padding: 10px !important;
    background: transparent !important;
    border: 1px solid var(--border-soft) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
    font-family: 'DM Sans', sans-serif !important;
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgb(var(--ql-primario-rgb) / .06) !important;
}

/* ============================================================
   MAIN
   ============================================================ */
.main-area { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--primary);
    display: flex; align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.mob-menu-btn {
    display: none;
    width: 36px; height: 36px;
    background: transparent; border: none; border-radius: 8px;
    color: var(--text); cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.mob-menu-btn svg, .mob-menu-btn i { width: 22px; height: 22px; }
.mob-menu-btn:hover { background: rgba(255,255,255,.06); }
.topbar-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    flex: 1;
}
.topbar-spacer { flex: 1; }
.topbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: border-color .15s;
    text-decoration: none;
    font-family: inherit;
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); }
.topbar-btn svg { width: 16px; height: 16px; }

/* ============================================================
   PAGE CONTENT (filtros + panel)
   ============================================================ */
.page-content {
    padding: 22px 28px 28px;
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    align-items: start;
}

/* ============================================================
   FILTROS
   ============================================================ */
.notif-filtros {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 14px;
    position: sticky;
    top: 84px;
}
.notif-filtros h3 {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 10px;
    padding: 0 4px;
}

.filtro-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.filtro-item:hover { background: var(--card-hover); color: var(--text); }
.filtro-item.active {
    background: rgb(var(--ql-primario-rgb) / .12);
    color: var(--primary);
}
.filtro-left {
    display: flex; align-items: center; gap: 10px;
}
.filtro-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--card-2);
    border: 1px solid var(--border-soft);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--muted);
    transition: background .15s, color .15s;
}
.filtro-item.active .filtro-icon {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.filtro-icon svg { width: 14px; height: 14px; }

.filtro-badge {
    background: var(--card-2);
    color: var(--muted);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    min-width: 22px; height: 20px;
    padding: 0 7px;
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.filtro-item.active .filtro-badge {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Acciones */
.notif-acciones {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.notif-acciones h3 {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 4px 10px;
}
.notif-acciones a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px; font-weight: 600;
    transition: background .15s, color .15s;
    text-decoration: none;
    margin-bottom: 2px;
}
.notif-acciones a:hover { background: var(--card-hover); color: var(--text); }
.notif-acciones a svg { width: 14px; height: 14px; flex-shrink: 0; }
.notif-acciones .danger { color: var(--red); }
.notif-acciones .danger:hover { background: rgba(239, 68, 68, .1); color: var(--red); }

/* ============================================================
   PANEL DE NOTIFICACIONES
   ============================================================ */
.notif-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    min-width: 0;
}

.notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.notif-panel-titulo {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}
.notif-panel-count {
    font-size: 12px;
    color: var(--primary);
    background: rgb(var(--ql-primario-rgb) / .12);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.notif-container {
    display: flex;
    flex-direction: column;
}

.notif-item {
    display: flex; align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--card-hover); }

.notif-item.no-leida::before {
    content: "";
    position: absolute;
    left: 8px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.notif-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-icon svg { width: 20px; height: 20px; }

.icon-solicitud {
    background: rgba(59, 130, 246, .15);
    color: var(--azul);
    border: 1px solid rgba(59, 130, 246, .25);
}
.icon-turno {
    background: rgb(var(--ql-primario-rgb) / .15);
    color: var(--primary);
    border: 1px solid rgb(var(--ql-primario-rgb) / .25);
}
.icon-mensaje {
    background: rgba(34, 197, 94, .15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, .25);
}
.icon-sistema {
    background: rgb(30 136 229 / .15);
    color: var(--purple);
    border: 1px solid rgb(30 136 229 / .25);
}

.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.3;
}
.notif-text {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 6px;
}

.notif-tag {
    display: inline-flex; align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.tag-solicitud { background: rgba(59, 130, 246, .12); color: var(--azul); border: 1px solid rgba(59, 130, 246, .3); }
.tag-turno     { background: rgb(var(--ql-primario-rgb) / .12); color: var(--primary); border: 1px solid rgb(var(--ql-primario-rgb) / .3); }
.tag-mensaje   { background: rgba(34, 197, 94, .12); color: var(--green); border: 1px solid rgba(34, 197, 94, .3); }
.tag-sistema   { background: rgb(30 136 229 / .12); color: var(--purple); border: 1px solid rgb(30 136 229 / .3); }

.notif-meta {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.notif-time {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
.notif-menu {
    width: 28px; height: 28px;
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
}
.notif-menu:hover { border-color: var(--primary); color: var(--primary); background: rgb(var(--ql-primario-rgb) / .06); }
.notif-menu svg { width: 14px; height: 14px; }

.notif-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}
.notif-empty svg {
    width: 40px; height: 40px;
    color: var(--text-soft);
    margin-bottom: 10px;
}
.notif-empty p { font-size: 14px; }

.notif-panel-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .app-layout { grid-template-columns: 220px 1fr; }
    .page-content { grid-template-columns: 240px 1fr; }
}

@media (max-width: 900px) and (min-width: 769px) {
    .page-content { grid-template-columns: 1fr; }
    .notif-filtros { position: static; }
}

@media (max-width: 768px) {
    body { background: var(--bg); overflow-x: hidden; }
    .app-layout { display: block; }
    .main-area { padding-bottom: 84px; }
    .mob-menu-btn { display: flex !important; }

    .sidebar { width: 280px !important; background: var(--sidebar-bg); }

    .topbar { padding: 0 14px; height: 60px; gap: 10px; flex-wrap: wrap; }
    .topbar-title { font-size: 17px; }
    .topbar-btn span { display: none; }

    .page-content { padding: 14px 14px 90px; gap: 12px; grid-template-columns: 1fr; }

    .notif-filtros { position: static; padding: 12px; }

    .notif-panel-header { padding: 12px 14px; }
    .notif-item { padding: 14px 16px; gap: 10px; }
    .notif-item.no-leida::before { left: 4px; }
    .notif-meta { flex-direction: row-reverse; align-items: center; gap: 8px; }

    /* Bottom Nav */
    .bottom-nav {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--sidebar-bg);
        border-top: 1px solid var(--border);
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav-inner {
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 58px;
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        height: 100%;
        color: var(--muted);
        font-size: 10px;
        font-weight: 600;
        text-decoration: none;
        position: relative;
        transition: color .15s;
    }
    .bottom-nav-item svg { width: 20px; height: 20px; }
    .bottom-nav-item.active { color: var(--primary); }
    .bottom-nav-badge {
        position: absolute;
        top: 5px; right: calc(50% - 16px);
        background: var(--primary); color: #fff;
        min-width: 16px; height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        font-size: 9px; font-weight: 700;
        display: flex; align-items: center; justify-content: center;
        border: 2px solid var(--sidebar-bg);
    }
}


/* Texto sobre fondos de marca: siempre blanco (día y noche) */
html[data-theme="light"] :is(.sidebar-nav a.active, .nav-badge, .sidebar-avatar-big) { color: #fff; }
html[data-theme="light"] .sidebar-nav a.active .nav-badge { background: #fff; color: var(--primary); }

/* Avisos con destino: se nota que se pueden tocar */
.notif-item.clickable { cursor: pointer; }
.notif-cta { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--primary); }
