/*
 * Nan — Design System
 * Estructura modular. Paleta customizable con Zoe (ver sección Variables).
 */

/* ===== Fuentes ===== */
@font-face {
    font-family: 'Yozakura';
    src: url('/static/fonts/YOZAKURA-Regular.otf') format('opentype');
    font-display: swap;
}

/* =====================================================================
   PERSONALIZABLE CON ZOE
   Cambiar estos valores para ajustar la estética completa de Nan.
   ===================================================================== */
:root {
    /* Paleta Girasol — dark mode warm */
    --accent: #F4C430;
    --accent-hover: #E0B020;
    --accent-dim: rgba(244, 196, 48, 0.12);
    --accent-glow: rgba(244, 196, 48, 0.38);

    /* Fondos dark con tinte cálido */
    --bg-base: #0A0A08;
    --bg-surface: #131310;
    --bg-card: #1A1A16;
    --bg-card-hover: #23231E;

    /* Texto cream — sin blanco puro */
    --text-primary: #F2EDD6;
    --text-secondary: #A89F80;
    --text-muted: #635E4A;

    /* Bordes con tinte dorado */
    --border: rgba(244, 196, 48, 0.08);
    --border-accent: rgba(244, 196, 48, 0.28);

    /* Semánticos — adaptados a la paleta */
    --green: #8CB369;
    --green-dim: rgba(140, 179, 105, 0.13);
    --red: #D94040;
    --red-dim: rgba(217, 64, 64, 0.12);
    --yellow: #F4C430;
    --blue: #6BAED6;
    --blue-dim: rgba(107, 174, 214, 0.12);

    /* Tipografía */
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-title: 'Inter', sans-serif;
    --font-art: 'Yozakura', cursive;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;

    /* Menubar + Taskbar */
    --menubar-height: 36px;

    /* Radios */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Desktop OS */
    --taskbar-height: 44px;
}
/* ===================================================================== */

/* ===== Reset ===== */
body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    overflow-x: hidden;
}

/* ===== Layout ===== */
.nan-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Main content ===== */
.nan-main {
    flex: 1;
    margin-left: 0;
    padding: 16px 28px;
    padding-top: calc(var(--menubar-height) + 16px);
    min-height: 100vh;
}

/* ===== Top bar ===== */
.nan-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.nan-topbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ===== Cards ===== */
.nan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-base);
}

.nan-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

/* Alias backward-compat (templates que aún usen .ezg-card) */
.ezg-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.ezg-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ezg-topbar h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.ezg-layout { display: flex; min-height: 100vh; }
.ezg-main { flex: 1; margin-left: 0; padding: 16px 28px; padding-top: calc(var(--menubar-height) + 16px); min-height: 100vh; }

/* ===== KPI Cards ===== */
.kpi-card { text-align: center; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.kpi-card .kpi-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-top: 4px; }

/* ===== Botones Nan ===== */
.btn-nan {
    background: var(--accent);
    color: var(--bg-base);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-nan:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    color: var(--bg-base);
}

.btn-nan-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-nan-outline:hover { background: var(--accent-dim); }

/* Alias */
.btn-ezg { background: var(--accent); color: var(--bg-base); border: none; border-radius: var(--radius-sm); padding: 8px 20px; font-weight: 600; cursor: pointer; }
.btn-ezg:hover { background: var(--accent-hover); color: var(--bg-base); }

/* ===== Badges ===== */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.status-badge.ok { background: var(--green-dim); color: var(--green); }
.status-badge.warning { background: rgba(217, 119, 6, 0.12); color: var(--yellow); }
.status-badge.error { background: var(--red-dim); color: var(--red); }

/* Badges de tipo evento */
.badge-laboral { background: var(--blue-dim); color: var(--blue); }
.badge-academico { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-personal { background: var(--accent-dim); color: var(--accent); }
.badge-salud { background: var(--red-dim); color: #f87171; }

/* ===== Forms dark ===== */
.form-control, .form-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
    color: var(--text-primary);
}

.form-label { color: var(--text-secondary); font-size: 0.85rem; }

/* ===== Login ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 60px var(--accent-glow);
}

.login-card .login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 2px solid var(--border-accent);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    box-shadow: 0 0 28px var(--accent-glow);
}

.login-card .login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nan-main { padding: 10px; padding-top: calc(var(--menubar-height) + 10px); padding-bottom: calc(48px + 10px); }
    .nan-topbar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .nan-topbar h1 { font-size: 1.2rem; }
    .chat-panel { width: calc(100vw - 16px) !important; left: 8px !important; right: 8px !important; bottom: 56px !important; max-height: calc(100vh - var(--menubar-height) - 64px) !important; }
    .nan-card, .ezg-card { overflow-x: auto; }
    .table { font-size: 0.75rem !important; white-space: nowrap; }
    .kpi-card .kpi-value { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .nan-main { padding: 8px; padding-top: calc(var(--menubar-height) + 8px); padding-bottom: calc(48px + 8px); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== Taskbar Inicio (botón N) ===== */
.taskbar-inicio {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    width: 32px; height: 32px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(244,196,48,0.3);
}
.taskbar-inicio:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 18px rgba(244,196,48,0.5);
    transform: scale(1.05);
}
.taskbar-inicio.active {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(244,196,48,0.6);
}
.taskbar-inicio-logo {
    color: var(--bg-base);
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: -0.02em;
}
.chat-pulse-dot {
    position: absolute;
    top: -2px; right: -2px;
    width: 9px; height: 9px;
    background: var(--green);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* ===== Chat Panel ===== */
.chat-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    left: 8px;
    width: 420px;
    max-height: calc(100vh - var(--menubar-height) - var(--taskbar-height) - 24px);
    z-index: 999998;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.70);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--bg-base);
    flex-shrink: 0;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 350px;
    max-height: 65vh;
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-bubble-user {
    background: var(--accent);
    color: var(--bg-base);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
    background: var(--bg-surface);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: var(--bg-surface);
}

.chat-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

.chat-send-btn {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    width: 36px; height: 36px;
    color: var(--bg-base);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.chat-send-btn:hover { background: var(--accent-hover); }

/* Overlay de novedades — tapa el chat body, fuerza lectura */
.chat-novedades-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border-radius: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-novedades-overlay-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-novedades-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-novedades-overlay-footer {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-novedades-item {
    background: var(--bg-surface);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 9px 11px;
}
.chat-novedades-item-title {
    font-size: 0.74rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 3px;
}
.chat-novedades-item-desc {
    font-size: 0.77rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.chat-novedades-item--leida {
    border-left-color: var(--border);
    opacity: 0.65;
}
.chat-novedades-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 2px 2px;
    margin-top: 4px;
}
.chat-novedades-section-label--hist {
    color: var(--text-muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.btn-novedades-ok {
    width: 100%;
    background: var(--accent);
    color: var(--bg-base);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s;
}
.btn-novedades-ok:hover { background: var(--accent-hover); }

/* ===== Animations ===== */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 15px var(--accent-dim); }
    50% { box-shadow: 0 0 28px var(--accent-glow); }
}
.glow-pulse { animation: glow-pulse 2.4s ease-in-out infinite; }

/* ===== Tables ===== */
.table {
    color: var(--text-primary);
    background: var(--bg-card) !important;
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: var(--bg-surface);
    --bs-table-hover-bg: var(--bg-card-hover);
    --bs-table-border-color: var(--border);
}
.table thead th {
    color: var(--text-secondary);
    background: var(--bg-surface) !important;
    border-bottom-color: var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table tbody tr { background: var(--bg-card) !important; border-bottom-color: var(--border); }
.table tbody tr:hover { background: var(--bg-card-hover) !important; }
.table td { border-bottom-color: var(--border); background: transparent !important; }

/* ===== Modals dark ===== */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
}
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.modal-title { color: var(--accent); font-weight: 600; }
.btn-close { filter: invert(1) brightness(0.7); }

/* ===== Chat Sesiones Sidebar ===== */
.sesion-grupo-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 10px 4px 4px;
    margin-top: 6px;
}
.sesion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
    gap: 4px;
    transition: background 0.15s;
}
.sesion-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sesion-item.active { background: var(--accent-dim); color: var(--accent); }
.sesion-item-titulo { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sesion-menu-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0 2px; font-size: 14px; flex-shrink: 0;
    opacity: 0; transition: opacity 0.1s;
    line-height: 1;
}
.sesion-item:hover .sesion-menu-btn { opacity: 1; }
.sesion-menu-btn:hover { color: var(--text-primary); }

/* Carpetas */
.carpeta-header {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 4px;
    user-select: none;
}
.carpeta-header:hover { color: var(--text-primary); }
.carpeta-header .carpeta-arrow { font-size: 10px; transition: transform 0.2s; }
.carpeta-section[open] .carpeta-arrow { transform: rotate(90deg); }
.carpeta-section summary { list-style: none; }
.carpeta-section summary::-webkit-details-marker { display: none; }
.carpeta-sesiones { padding-left: 12px; }

/* Dropdown menú contextual */
.sesion-dropdown {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 160px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    font-size: 0.8rem;
}
.sesion-dropdown-item {
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}
.sesion-dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sesion-dropdown-item.danger { color: #dc2626; }
.sesion-dropdown-item.danger:hover { background: rgba(220,38,38,0.1); }
.sesion-dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== Desktop OS — Ventanas y Taskbar ===== */

/* Ventana estilo Linux */
.desktop-window {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.window-titlebar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    user-select: none;
}
.window-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.window-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: block;
}
.dot-close  { background: var(--red); }
.dot-min    { background: var(--yellow); }
.dot-max    { background: var(--green); }
.window-title-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    flex: 1;
}
.window-title-icon { font-size: 13px; flex-shrink: 0; }
.window-body {
    padding: 14px;
    flex: 1;
    overflow-y: auto;
}

/* Terminal greeting */
.desktop-terminal-greeting {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--green);
    padding: 2px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.desktop-terminal-greeting .terminal-prompt { color: var(--accent); font-weight: 700; }
.desktop-terminal-greeting .terminal-text   { color: var(--text-primary); }
.desktop-terminal-greeting .terminal-cursor {
    display: inline-block;
    width: 8px; height: 14px;
    background: var(--accent);
    animation: blink 1.1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Grid de tiles */
.desktop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 14px;
    align-items: start;
}
@media (max-width: 1024px) {
    .desktop-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .desktop-grid { grid-template-columns: 1fr; }
}

/* Taskbar inferior */
.desktop-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    z-index: 200;
}
.taskbar-app {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.taskbar-app:hover  { background: var(--accent-dim); color: var(--accent); text-decoration: none; }
.taskbar-app.active { background: var(--accent-dim); color: var(--accent); border-bottom: 2px solid var(--accent); }
.taskbar-app .tapp-icon { font-size: 14px; }
.taskbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.taskbar-spacer { flex: 1; }
.taskbar-clock {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    padding: 2px 8px;
}
.taskbar-kpi {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.taskbar-kpi span { color: var(--accent); font-weight: 600; }
@media (max-width: 768px) {
    .desktop-taskbar { height: 48px; padding: 0 6px; gap: 2px; }
    .taskbar-inicio { width: 36px; height: 36px; border-radius: 8px; }
    .taskbar-inicio-logo { font-size: 0.95rem; }
    .taskbar-app { font-size: 1.1rem; padding: 6px 7px; gap: 0; }
    .taskbar-app .taskbar-label { display: none; }
    .taskbar-kpi { display: none; }
    .taskbar-clock { font-size: 0.7rem; padding: 2px 4px; }
}

/* Padding para no quedar tapado por taskbar */
.nan-main { padding-bottom: calc(var(--taskbar-height) + 12px); }

/* Scrollbar girasol */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(244,196,48,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(244,196,48,0.5); }

/* ===== Sticker Board — Plan de Estudios ===== */
.sticker-group {
    margin-bottom: 20px;
}
.sticker-group-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.sticker-row { margin-bottom: 10px; }
.sticker-cuat-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.sticker-tiles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sticker-tile {
    min-width: 130px;
    max-width: 180px;
    flex: 1 1 130px;
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 4px solid var(--border);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    user-select: none;
}
.sticker-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 2;
}
.sticker-tile.aprobada {
    border-left-color: var(--green);
    background: var(--green-dim);
}
.sticker-tile.cursando {
    border-left-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 12px rgba(244,196,48,0.15);
}
.sticker-tile.habilitada {
    border-left-color: var(--text-muted);
    background: var(--bg-card);
}
.sticker-tile.bloqueada {
    border-left-color: var(--border);
    background: var(--bg-surface);
    opacity: 0.55;
}
.sticker-tile.bloqueada:hover { transform: none; box-shadow: none; }
.sticker-estado {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.sticker-tile.aprobada  .sticker-estado { color: var(--green); }
.sticker-tile.cursando  .sticker-estado { color: var(--accent); }
.sticker-nombre {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 5px;
}
.sticker-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}
/* Leyenda */
.sticker-leyenda {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    border-left: 3px solid;
}
.sticker-leyenda.done      { border-left-color:var(--green);  background:var(--green-dim);  color:var(--green); }
.sticker-leyenda.cursando  { border-left-color:var(--accent); background:var(--accent-dim); color:var(--accent); }
.sticker-leyenda.habilitada{ border-left-color:var(--text-muted); background:var(--bg-card); color:var(--text-muted); }
.sticker-leyenda.bloqueada { border-left-color:var(--border); background:var(--bg-surface); color:var(--text-muted); opacity:0.7; }
/* Panel lateral de detalle */
.sticker-detail-panel {
    position: fixed;
    top: calc(var(--menubar-height) + 16px);
    right: 16px;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    padding: 20px 16px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 250;
    overflow-y: auto;
    max-height: calc(100vh - var(--menubar-height) - var(--taskbar-height) - 32px);
}
@media (max-width: 768px) {
    .sticker-tiles-row { gap: 6px; }
    .sticker-tile { min-width: 110px; padding: 8px 10px; }
    .sticker-nombre { font-size: 0.72rem; }
    .sticker-detail-panel { right: 8px; left: 8px; width: auto; top: calc(var(--menubar-height) + 8px); }
}

/* ===== Menubar Mac-style ===== */
.desktop-menubar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--menubar-height);
    background: rgba(19,19,16,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 2px;
    z-index: 500;
    font-size: 0.78rem;
}
.menubar-brand {
    display: flex; align-items: center; gap: 7px;
    text-decoration: none; margin-right: 6px;
}
.menubar-logo {
    width: 22px; height: 22px;
    background: var(--accent);
    color: var(--bg-base);
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.72rem; flex-shrink: 0;
    box-shadow: 0 0 8px rgba(244,196,48,0.4);
}
.menubar-name {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}
.menubar-btn {
    background: none; border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.menubar-btn:hover { background: var(--accent-dim); color: var(--accent); }
.menubar-dropdown { position: relative; }
.menubar-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    min-width: 168px;
    padding: 4px 0;
    box-shadow: 0 10px 32px rgba(0,0,0,0.55);
    z-index: 600;
}
.menubar-dropdown-right { left: auto; right: 0; }
.menubar-dropdown-content a, .menubar-dropdown-content span.menubar-dd-item {
    display: block;
    padding: 7px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    transition: background var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
}
.menubar-dropdown-content a:hover { background: var(--accent-dim); color: var(--accent); }
.menubar-dropdown-content .menubar-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menubar-dropdown-content .menubar-dd-label {
    padding: 6px 14px 3px;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: default;
}
.menubar-dropdown.open .menubar-dropdown-content { display: block; }
.menubar-clock {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    margin-left: 10px;
    white-space: nowrap;
}
/* Hamburger — hidden on desktop */
.menubar-hamburger {
    display: none;
    background: none; border: none;
    color: var(--accent);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    line-height: 1;
}
/* Mobile slide-down menu */
.menubar-mobile-menu {
    display: none;
    position: fixed;
    top: var(--menubar-height);
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-accent);
    padding: 6px 0 10px;
    z-index: 490;
    box-shadow: 0 10px 32px rgba(0,0,0,0.6);
    max-height: calc(100vh - var(--menubar-height) - 48px);
    overflow-y: auto;
}
.menubar-mobile-menu.open { display: block; }
.menubar-mobile-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background var(--transition-fast);
}
.menubar-mobile-menu a:hover, .menubar-mobile-menu a:active { background: var(--accent-dim); color: var(--accent); }
.menubar-mobile-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* Responsive menubar */
@media (max-width: 768px) {
    .menubar-dropdown { display: none; }
    .menubar-clock { display: none; }
    .menubar-hamburger { display: flex; }
}
/* Tile spans */
.tile-span-row { grid-row: span 2; }
.tile-span-col { grid-column: span 2; }

/* KPI grids internos */
.kpi-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.kpi-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 640px) {
    .desktop-grid { grid-template-columns: 1fr; }
    .tile-span-row { grid-row: auto; }
    .tile-span-col { grid-column: auto; }
    .kpi-grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .kpi-grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .desktop-window[style*="grid-row"] { grid-row: auto !important; }
}
@media (max-width: 390px) {
    .kpi-grid-2,
    .kpi-grid-3 { grid-template-columns: 1fr; gap: 6px; }
    .nan-main { padding: 6px; padding-top: calc(var(--menubar-height) + 6px); padding-bottom: calc(48px + 6px); }
    .desktop-grid { gap: 8px; }
    .window-body { padding: 10px; }
    .desktop-terminal-greeting { font-size: 0.7rem; }
    .desktop-terminal-greeting button { display: none; }
}
