:root {
    /* 🎨 Paleta de colores refinada */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2235;
    --bg-hover: #1f2937;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-color: #1f2937;
    --border-hover: #374151;
    
    /* 📐 Dimensiones */
    --sidebar-width: 340px;
    --header-height: 56px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 🌑 Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Reset y base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    height: 100dvh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100dvh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Alpine.js: oculta elementos hasta que Alpine esté listo */
[x-cloak] {
    display: none !important;
}

/* App wrapper */
.app-wrapper {
    display: flex;
    height: 100dvh;
    position: relative;
}

/* ==================== OVERLAY ==================== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 40;
    cursor: pointer;
}

/* 🔑 En desktop, el overlay nunca se muestra */
@media (min-width: 768px) {
    .overlay {
        display: none !important;
    }
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    max-width: 85vw;
    height: 100dvh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform var(--transition);
    overflow: hidden;
}

/* Sidebar header */
.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botones con icono */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ==================== BREADCRUMB VERTICAL ==================== */
.breadcrumb-nav {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    max-height: 40vh; /* Altura máxima antes de scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Header del breadcrumb */
.breadcrumb-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.25rem;
}

.breadcrumb-header-icon {
    font-size: 0.9rem;
}

.breadcrumb-header-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Lista vertical */
.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Cada item del breadcrumb */
.breadcrumb-item-wrapper {
    position: relative;
}

/* Línea conectora entre niveles */
.breadcrumb-connector {
    display: flex;
    justify-content: center;
    padding: 0;
    height: 12px;
}

.connector-line {
    display: block;
    width: 2px;
    height: 100%;
    background: var(--border-color);
    border-radius: 1px;
}

/* Cuando el item está activo, la línea se colorea */
.breadcrumb-item-wrapper:has(.breadcrumb-btn.active) .connector-line {
    background: var(--accent);
}

/* Botón del breadcrumb */
.breadcrumb-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-size: 0.85rem;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.breadcrumb-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateX(2px);
}

.breadcrumb-btn:active {
    transform: scale(0.98) translateX(2px);
}

/* Botón activo (carpeta actual) */
.breadcrumb-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    font-weight: 500;
}

.breadcrumb-btn.active:hover {
    background: var(--accent-light);
    transform: translateX(2px);
}

/* Íconos en el breadcrumb */
.breadcrumb-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* Texto del breadcrumb */
.breadcrumb-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
}

/* Indicador de ubicación actual */
.breadcrumb-indicator {
    font-size: 0.8rem;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Footer del breadcrumb */
.breadcrumb-footer {
    padding: 0.5rem 0.25rem 0.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.breadcrumb-back-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-family: inherit;
    transition: all var(--transition);
}

.breadcrumb-back-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
    border-style: solid;
}

/* Scrollbar personalizado para el breadcrumb */
.breadcrumb-nav::-webkit-scrollbar {
    width: 4px;
}

.breadcrumb-nav::-webkit-scrollbar-track {
    background: transparent;
}

.breadcrumb-nav::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.breadcrumb-nav::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ==================== MOBILE ADJUSTMENTS ==================== */
@media (max-width: 767px) {
    .breadcrumb-nav {
        max-height: 35vh;
    }
    
    .breadcrumb-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    .breadcrumb-label {
        font-size: 0.88rem;
    }
}

/* Loading */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Error */
.error-banner {
    margin: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Sidebar content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
}

/* Secciones */
.section {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 0.9rem;
}

.badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 99px;
    font-weight: 500;
}

/* Lista de items */
.item-list {
    list-style: none;
}

.item-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-size: 0.88rem;
    text-align: left;
}

.item-button:hover {
    background: var(--bg-hover);
}

.item-button:active {
    background: var(--bg-tertiary);
    transform: scale(0.98);
}

.item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.item-meta {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.item-arrow, .play-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0;
    transition: all var(--transition);
}

.item-button:hover .item-arrow,
.item-button:hover .play-icon {
    opacity: 1;
    color: var(--accent-light);
}

/* Item de video */
.video-item:hover {
    border-left: 3px solid var(--accent);
}

/* Item de audio */
.audio-item:hover {
    border-left: 3px solid var(--success);
}

/* Estados vacíos */
.empty-state {
    padding: 1rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.footer-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Header */
.main-header {
    padding: 0 1rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.hamburger {
    display: none;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== REPRODUCTOR ==================== */
.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000;
}

/* Barra superior del reproductor */
.player-topbar {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.player-type-icon {
    font-size: 1.2rem;
}

.player-filename {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Control de subtítulos */
.subtitle-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
}

.subtitle-label {
    font-size: 0.9rem;
}

.subtitle-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Botón cerrar reproductor mejorado */
.close-btn {
    color: var(--text-secondary);
    transition: all var(--transition);
    border-radius: var(--radius-sm);
}

.close-btn:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.close-btn:active {
    transform: scale(0.9);
}

/* En móvil, botón más prominente */
@media (max-width: 767px) {
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        background: var(--bg-tertiary);
    }
    
    .close-btn:hover {
        background: rgba(239, 68, 68, 0.15);
    }
}

/* Contenedor de video */
.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - 100px);
    object-fit: contain;
}

/* Contenedor de audio */
.audio-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.audio-artwork {
    margin-bottom: 2rem;
}

.audio-visualizer {
    text-align: center;
}

.visualizer-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.audio-bars {
    display: flex;
    gap: 3px;
    justify-content: center;
    height: 40px;
}

.audio-bars span {
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: bounce 1.5s ease-in-out infinite;
}

.audio-bars span:nth-child(1) { animation-delay: 0s; }
.audio-bars span:nth-child(2) { animation-delay: 0.2s; }
.audio-bars span:nth-child(3) { animation-delay: 0.4s; }
.audio-bars span:nth-child(4) { animation-delay: 0.6s; }
.audio-bars span:nth-child(5) { animation-delay: 0.8s; }

@keyframes bounce {
    0%, 100% { height: 10px; }
    50% { height: 30px; }
}

.audio-filename {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
    text-align: center;
}

#audioPlayer {
    width: 100%;
    max-width: 400px;
}

/* Error overlay */
.player-error-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.error-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.error-card h3 {
    margin-bottom: 0.5rem;
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ==================== WELCOME SCREEN ==================== */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.welcome-card {
    text-align: center;
    max-width: 450px;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.welcome-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

/* Botones */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.welcome-btn {
    width: 100%;
}

/* ==================== MOBILE STYLES ==================== */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
    }

    .header-title {
        font-size: 0.95rem;
    }

    .player-topbar {
        padding: 0.4rem 0.75rem;
    }

    .player-filename {
        font-size: 0.8rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 300px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .sidebar {
        width: 360px;
    }

    .main-header {
        padding: 0 1.5rem;
    }
}

/* ==================== PANTALLA DE LOGIN ==================== */
.login-screen {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-icon {
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.token-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: 0.5px;
    transition: all var(--transition);
}

.token-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.token-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
}

.token-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-visibility {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.toggle-visibility:hover {
    opacity: 1;
}

/* Error de autenticación */
.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.85rem;
}

.error-icon {
    flex-shrink: 0;
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

/* Footer login */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.login-footer .footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== BOTÓN LOGOUT EN SIDEBAR ==================== */
.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logout-btn {
    color: var(--text-muted);
}

.logout-btn:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* ==================== APP LAYOUT (autenticado) ==================== */
.app-layout {
    display: flex;
    height: 100dvh;
}

/* Mobile login adjustments */
@media (max-width: 767px) {
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .login-icon {
        font-size: 2.5rem;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
}

/* ==================== PANTALLA DE LOGIN ==================== */
.login-screen {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-icon {
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.token-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
    letter-spacing: 0.5px;
    transition: all var(--transition);
}

.token-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.token-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
}

.token-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-visibility {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-visibility:hover {
    opacity: 1;
}

.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.85rem;
}

.btn-login {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-login-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
    display: flex;
    height: 100dvh;
}

/* ==================== LOGOUT Y HEADER ACTIONS ==================== */
.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logout-btn {
    color: var(--text-muted);
}

.logout-btn:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* ==================== FOOTER PATH ==================== */
.footer-path-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== MOBILE LOGIN ==================== */
@media (max-width: 767px) {
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .login-icon {
        font-size: 2.5rem;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
}