:root {
    --bg: #0f172a; --card-bg: #1e293b; --card-hover: #2a364d;
    --accent: #3b82f6; --accent-hover: #2563eb;
    --text-main: #f8fafc; --text-muted: #94a3b8;
    --border-color: #334155; --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
body.light-mode {
    --bg: #f1f5f9; --card-bg: #ffffff; --card-hover: #f8fafc;
    --accent: #3b82f6; --accent-hover: #2563eb;
    --text-main: #0f172a; --text-muted: #64748b;
    --border-color: #e2e8f0; --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body { background-color: var(--bg); color: var(--text-main); font-family: 'Segoe UI', sans-serif; margin: 0; display: flex; flex-direction: column; align-items: center; transition: all 0.4s ease; min-height: 100vh; }
header { margin-top: 3rem; text-align: center; transition: all 0.3s ease;}
.logo { width: 90px; margin-bottom: 0.5rem; transition: transform 0.3s; }
.logo:hover { transform: scale(1.05); }
h1 { margin: 0; font-size: 2rem; }

/* Botones Superiores */
.theme-toggle { position: absolute; top: 20px; right: 20px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 50%; width: 45px; height: 45px; font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow); transition: all 0.3s; z-index: 100; }
.theme-toggle:hover { transform: rotate(20deg) scale(1.1); border-color: var(--accent); }
.btn-login-top { position: absolute; top: 20px; left: 20px; background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 10px 18px; border-radius: 20px; font-weight: bold; cursor: pointer; box-shadow: var(--shadow); transition: all 0.3s; z-index: 50; }
.btn-login-top:hover { border-color: var(--accent); color: var(--accent); }
.top-left-controls { position: absolute; top: 20px; left: 20px; display: flex; gap: 15px; align-items: center; z-index: 50; }
.btn-back { background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 10px 18px; border-radius: 20px; font-weight: bold; cursor: pointer; box-shadow: var(--shadow); transition: all 0.3s; }
.btn-back:hover { border-color: var(--accent); color: var(--accent); }
.btn-akkflix-nav, .btn-akkflix { background: linear-gradient(135deg, #e50914, #b91c1c); color: white; border: none; padding: 10px 18px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: all 0.3s; box-shadow: var(--shadow); }
.btn-akkflix-nav:hover, .btn-akkflix:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4); }
.user-bar-top { position: absolute; top: 20px; left: 20px; display: flex; align-items: center; gap: 12px; background: var(--card-bg); padding: 8px 18px; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-color); z-index: 50;}

/* Contenedores */
.container { width: 90%; max-width: 500px; padding: 1rem 0 3rem 0; }
.upload-card, .explorer-card { background: var(--card-bg); padding: 2rem; border-radius: 20px; box-shadow: var(--shadow); margin-top: 25px; border: 1px solid var(--border-color); }

/* CORRECCIÓN: Etiqueta de Ruta Protegida */
.badge { 
    display: inline-block; 
    background-color: rgba(59, 130, 246, 0.15); 
    color: var(--accent); 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: bold; 
    margin-bottom: 1.5rem; 
    margin-right: 5px;
    max-width: 100%; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    box-sizing: border-box;
    vertical-align: bottom;
}

/* Búsqueda Global y Filtros AKKFLIX */
.search-bar { width: 100%; padding: 12px 20px; background: var(--bg); border: 2px solid var(--border-color); border-radius: 25px; color: var(--text-main); font-size: 1rem; margin-bottom: 15px; transition: border-color 0.3s; box-sizing: border-box; }
.search-bar:focus { outline: none; border-color: var(--accent); }
.genre-filters { display: flex; gap: 10px; overflow-x: auto; padding: 5px 0 15px 0; margin-bottom: 10px; justify-content: center; width: 100%; max-width: 800px; margin-left: auto; margin-right: auto; scroll-behavior: smooth; box-sizing: border-box; }
.genre-filters::-webkit-scrollbar { height: 4px; }
.genre-filters::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.btn-genre { background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 8px 18px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; cursor: pointer; white-space: nowrap; transition: all 0.3s; box-shadow: var(--shadow); }
.btn-genre:hover { border-color: #e50914; }
.btn-genre.active { background: #e50914; color: white; border-color: #e50914; }

/* Inputs y Botones Generales */
.custom-input, textarea, select { width: 90%; padding: 12px 15px; margin-bottom: 1rem; background: var(--bg); border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-main); font-size: 1rem; box-sizing: border-box; }
.custom-input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.custom-file-upload { display: flex; flex-direction: column; align-items: center; padding: 25px 15px; background: var(--bg); border: 2px dashed var(--border-color); border-radius: 12px; cursor: pointer; text-align: center; transition: all 0.3s; color: var(--text-muted); font-weight: bold; }
.custom-file-upload:hover { border-color: var(--accent); color: var(--accent); }
.custom-file-upload input { display: none; }
.upload-icon { font-size: 2rem; margin-bottom: 10px; }

/* CORRECCIÓN: Nombre de archivo seleccionado protegido */
#file-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    margin: 0 auto 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.btn-primary { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--accent), #60a5fa); color: white; border: none; border-radius: 12px; margin-top: 10px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: all 0.3s; text-align: center;}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { width: 100%; padding: 12px; background: transparent; color: var(--accent); border: 2px solid var(--accent); border-radius: 12px; margin-top: 10px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: all 0.3s; }
.btn-secondary:hover { background: rgba(59, 130, 246, 0.1); }
.btn-icon { background: transparent; border: none; font-size: 1.2rem; cursor: pointer; transition: transform 0.2s; color: var(--text-main); text-decoration: none;}
.btn-icon:hover { transform: scale(1.2); }
.btn-logout { background: transparent; color: #ef4444; border: 1px solid #ef4444; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.btn-logout:hover { background: #ef4444; color: white; }

/* Dashboard UI */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-box { background: var(--bg); padding: 15px; border-radius: 12px; text-align: center; border: 1px solid var(--border-color); }
.stat-box h3 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--text-muted); }
.stat-box p { margin: 0; font-size: 1.5rem; font-weight: bold; color: var(--accent); }
.top-movies { background: var(--bg); padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); margin-bottom: 20px;}
.top-movies ul { list-style: none; padding: 0; margin: 0; }
.top-movies li { padding: 8px 0; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between;}
.top-movies li:last-child { border-bottom: none; }

/* CORRECCIÓN: EXPLORADOR DE ARCHIVOS Y NOMBRES LARGOS */
.file-item-container { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--border-color); border-radius: 10px; margin: 8px 0; transition: all 0.2s; padding-right: 15px; }
.file-item-container:hover { background: var(--card-hover); border-color: var(--accent); }

.file-item-main { 
    flex: 1; 
    min-width: 0; /* Vital para permitir el corte de texto */
    padding: 14px 15px; 
    cursor: pointer; 
    font-weight: bold; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    display: block; 
    line-height: 1.5; 
}

.file-actions { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    flex-shrink: 0; /* Evita que los botones se aplasten */
}

/* Switch Toggle Público/Privado */
.switch-container { display: flex; align-items: center; gap: 5px; margin-right: 10px; }
.switch-label { font-size: 0.75rem; font-weight: bold; color: var(--text-muted); }
.switch { position: relative; display: inline-block; width: 36px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ef4444; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(18px); }

/* Modales */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; }
.modal-content { transform: scale(0.8); transition: transform 0.3s; position: relative; width: 90%; max-width: 350px; max-height: 85vh; overflow-y: auto; overflow-x: hidden; }
.modal-overlay.active .modal-content { transform: scale(1); }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; z-index: 10; }
.close-btn:hover { color: #ef4444; }

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.login-card { background: var(--card-bg); padding: 2.5rem 2rem; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-color); text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Dashboard & Users */
.dashboard-card { background: var(--card-bg); padding: 2rem; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-color); width: 90%; max-width: 600px; }
.create-user-box { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); text-align: center;}
.users-list { max-height: 300px; overflow-y: auto; }
.user-item { display: flex; justify-content: space-between; align-items: center; background: var(--bg); padding: 10px; border-radius: 8px; margin-bottom: 5px; border: 1px solid var(--border-color); }

/* CORRECCIÓN: Texto de usuario truncado si el username es inmenso */
.user-info { font-size: 0.9rem; text-align: left; flex: 1; min-width: 0; word-wrap: break-word; }
.user-info span { color: var(--accent); font-weight: bold; }

/* VISOR GENERAL */
.viewer-card { background: var(--bg); border: 1px solid var(--border-color); max-width: 800px; width: 95%; padding: 2.5rem 1rem 1rem 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); text-align: center;}
#viewer-container img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
#viewer-container iframe { width: 100%; height: 70vh; border: none; border-radius: 8px; }
#viewer-title { margin-top: 0; font-family: 'Segoe UI', sans-serif; letter-spacing: 1px; color: var(--text-main); }

/* AKKFLIX GRID Y CARTAS */
.akkflix-page { display: block; background: #05070b; color: #f7f7f8; }
.akkflix-page.light-mode { background: #eef1f5; }
.akkflix-nav { position: sticky; top: 0; z-index: 200; min-height: 72px; padding: 0 4vw; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: rgba(5,7,11,.82); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(18px); }
.akkflix-page.light-mode .akkflix-nav { background: rgba(255,255,255,.85); border-color: rgba(15,23,42,.1); }
.akkflix-brand { color: #e50914; font: 900 1.75rem/1 'Segoe UI', sans-serif; letter-spacing: -2px; text-decoration: none; }
.akkflix-brand span { color: var(--text-main); }
.akkflix-nav-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.akkflix-nav .theme-toggle { position: static; width: 42px; height: 42px; box-shadow: none; }
.akkflix-nav .btn-back { justify-self: start; background: transparent; box-shadow: none; }
.akkflix-hero { position: relative; isolation: isolate; overflow: hidden; margin: 0; min-height: 390px; padding: 90px 8vw 70px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; background: radial-gradient(circle at 75% 45%, rgba(229,9,20,.22), transparent 34%), linear-gradient(120deg, #07090e 35%, #111827 100%); }
.akkflix-hero::after { content: ''; position: absolute; inset: auto 0 0; height: 35%; z-index: -1; background: linear-gradient(transparent, #05070b); }
.hero-glow { position: absolute; right: 10%; width: 360px; height: 360px; z-index: -1; border-radius: 50%; background: #e50914; opacity: .08; filter: blur(70px); }
.hero-kicker, .section-eyebrow { margin: 0 0 10px; color: #ff3340; font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
.akkflix-hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.8rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
.akkflix-hero h1 span { color: #e50914; }
.akkflix-hero > p:not(.hero-kicker) { max-width: 560px; margin: 24px 0; color: #a9b1bf; font-size: 1.08rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px 28px; color: #a9b1bf; font-size: .85rem; }
.hero-stats strong { color: white; }
.akkflix-container { width: min(92%, 1320px); margin: 0 auto; padding: 3.5rem 0 5rem; }
.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.catalog-toolbar h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.04em; }
.catalog-search-wrap { width: min(100%, 430px); position: relative; }
.catalog-search-wrap > span { position: absolute; left: 18px; top: 12px; color: var(--text-muted); font-size: 1.4rem; }
.catalog-search-wrap .search-bar { margin: 0; padding-left: 48px; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.1); }
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 28px 18px; margin-top: 10px; }
.movie-card { background: transparent; border-radius: 14px; overflow: visible; cursor: pointer; transition: transform .25s ease; position: relative; border: 0; }
.movie-card:hover { transform: translateY(-7px); }
.movie-poster-wrap { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 2 / 3; background: #111827; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.movie-poster { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease, filter .3s ease; }
.movie-card:hover .movie-poster { transform: scale(1.055); filter: brightness(.72); }
.movie-card-shade { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.86)); opacity: .65; }
.movie-card-play { position: absolute; inset: 50% auto auto 50%; width: 52px; height: 52px; display: grid; place-items: center; padding-left: 3px; border-radius: 50%; transform: translate(-50%,-42%) scale(.8); background: rgba(229,9,20,.92); color: white; opacity: 0; transition: .25s ease; box-shadow: 0 10px 25px rgba(229,9,20,.35); }
.movie-card:hover .movie-card-play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.movie-info { padding: 13px 3px 0; text-align: left; }
.movie-title { margin: 0; font-size: 1.1rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movie-meta { margin: 6px 0 0; color: var(--text-muted); font-size: .78rem; }
.movie-badge { position: absolute; top: 12px; left: 12px; z-index: 2; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(8,10,15,.78); color: white; padding: 6px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; backdrop-filter: blur(10px); }

/* AKKFLIX DETALLES MODAL Y EPISODIOS */
.movie-detail-modal-card { width: min(92vw, 880px); max-width: 880px; padding: 22px; border-radius: 20px; background: #101622; border-color: rgba(255,255,255,.1); }
.movie-detail-content { display: flex; flex-direction: column; gap: 28px; text-align: left; }
@media (min-width: 600px) { .movie-detail-content { flex-direction: row; } }
.detail-poster { width: 100%; max-width: 280px; aspect-ratio: 2 / 3; border-radius: 14px; object-fit: cover; box-shadow: 0 20px 45px rgba(0,0,0,.45); }
.detail-info { flex: 1; }
.detail-title { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; color: #f8fafc; letter-spacing: -.04em; }
.detail-desc { color: var(--text-muted); line-height: 1.5; margin-bottom: 20px;}
.detail-genre { position: static; display: inline-block; background: rgba(229,9,20,.18); color: #ff3340; }
.detail-owner { margin: 0 0 18px; }
.detail-actions { margin-top: 14px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-edit-button { width: auto; margin: 0; padding: 9px 14px; }
.visibility-check { display: flex; align-items: center; gap: 9px; margin: 4px 0 18px; color: var(--text-muted); font-size: .8rem; cursor: pointer; }
.btn-play { background: #e50914; width: auto; padding: 12px 30px; display: inline-block; color: white;}
.btn-play:hover { background: #b91c1c; box-shadow: 0 6px 15px rgba(229, 9, 20, 0.4); }
.btn-danger-outline { padding: 10px 16px; border: 1px solid rgba(239,68,68,.55); border-radius: 10px; background: transparent; color: #f87171; font-weight: 700; cursor: pointer; }
.btn-danger-outline:hover { background: rgba(239,68,68,.12); }
.episode-add-btn { width: auto; padding: 7px 13px; margin: 0; border-color: #e50914; color: #ff3340; }
.episode-play { padding: 7px 14px; margin: 0; }
.player-card { width: min(94vw, 1100px); max-width: 1100px; padding: 20px; border-radius: 18px; background: #080b11; }
.akkflix-player { display: block; width: 100%; max-height: 76vh; border-radius: 12px; background: #000; }
.player-error { display: none; gap: 7px; flex-direction: column; margin-top: 14px; padding: 16px; border: 1px solid rgba(239,68,68,.35); border-radius: 12px; background: rgba(127,29,29,.22); color: #fecaca; }
.player-error.show { display: flex; }
.player-error span, .player-warning { color: #fca5a5; font-size: .88rem; }
.player-direct-link { align-self: flex-start; margin-top: 5px; color: white; font-weight: 700; }

/* CORRECCIÓN: Lista de Episodios Protegida contra nombres largos */
.episode-list { margin-top: 15px; max-height: 250px; overflow-y: auto; padding-right: 5px;}
.episode-item { display: flex; justify-content: space-between; background: var(--bg); padding: 12px; margin-bottom: 8px; border-radius: 8px; border: 1px solid var(--border-color); align-items: center; gap: 10px;}
.episode-item:hover { border-color: #e50914; }
.episode-info { font-size: 0.95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-info strong { color: #e50914; margin-right: 5px;}

/* BARRAS DE PROGRESO DE SUBIDA */
.progress-container { display: none; width: 100%; margin-top: 15px; margin-bottom: 10px; }
.progress-bar-bg { width: 100%; background-color: var(--border-color); border-radius: 10px; overflow: hidden; height: 12px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.progress-bar-fill { height: 100%; background: linear-gradient(135deg, var(--accent), #60a5fa); width: 0%; transition: width 0.2s ease; }
.progress-bar-fill.akkflix-theme { background: linear-gradient(135deg, #e50914, #b91c1c); }
.progress-text { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 8px; font-weight: bold; }

/* Notificaciones */
.toast { visibility: hidden; min-width: 250px; background: linear-gradient(135deg, #10b981, #059669); color: #fff; text-align: center; border-radius: 30px; padding: 12px 24px; font-weight: bold; position: fixed; z-index: 2000; bottom: 30px; left: 50%; transform: translateX(-50%); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }
.toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0; transform: translate(-50%, 20px);} to {bottom: 30px; opacity: 1; transform: translate(-50%, 0);} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }

/* --- DISEÑO RESPONSIVO PARA CELULARES --- */
@media (max-width: 768px) {
    .btn-login-top, .top-left-controls, .user-bar-top { position: relative; top: 0; left: 0; width: 90%; justify-content: center; flex-wrap: wrap; margin: 15px auto 0 auto; }
    header { margin-top: 1.5rem; }
    .theme-toggle { width: 40px; height: 40px; top: 15px; right: 15px; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .genre-filters { justify-content: flex-start; padding-left: 10px; padding-right: 10px; }
    .detail-poster { max-width: 100%; margin-bottom: 10px;}
    .akkflix-nav { grid-template-columns: auto 1fr auto; padding: 0 14px; }
    .akkflix-brand { font-size: 1.2rem; justify-self: center; }
    .akkflix-nav .btn-back { padding: 9px; font-size: 0; }
    .akkflix-nav .btn-back::before { content: '←'; font-size: 1.2rem; }
    .akkflix-nav .btn-akkflix { width: 42px; height: 42px; padding: 0; overflow: hidden; font-size: 0; }
    .akkflix-nav .btn-akkflix::before { content: '+'; font-size: 1.5rem; }
    .akkflix-hero { min-height: 310px; padding: 70px 6vw 55px; }
    .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 18px; }
    .catalog-search-wrap { width: 100%; }
    .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
    .movie-card-play { display: none; }
    .movie-detail-modal-card { padding: 16px; }
}

/* DRIVE — INTERFAZ PROFESIONAL */
.drive-page { display: block; min-height: 100vh; background: var(--bg); }
.drive-nav { position: sticky; top: 0; z-index: 200; min-height: 72px; padding: 0 4vw; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom: 1px solid var(--border-color); backdrop-filter: blur(18px); }
.drive-brand { display: flex; align-items: center; gap: 11px; color: var(--text-main); text-decoration: none; font-size: 1.05rem; }
.drive-brand .logo { width: 38px; height: 38px; margin: 0; border-radius: 12px; object-fit: cover; }
.drive-brand strong { color: var(--accent); letter-spacing: -.03em; }
.drive-nav-actions, .user-bar-top { display: flex; align-items: center; gap: 10px; }
.drive-nav .theme-toggle, .drive-nav .btn-login-top, .drive-nav .user-bar-top { position: static; width: auto; margin: 0; box-shadow: none; }
.drive-nav .theme-toggle { width: 42px; height: 42px; }
.drive-nav .btn-login-top { padding: 10px 18px; }
.user-pill { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.nav-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--card-bg); }
.drive-hero { position: relative; isolation: isolate; min-height: 330px; margin: 0; padding: 70px max(5vw, calc((100vw - 1320px)/2)); display: flex; align-items: center; justify-content: space-between; overflow: hidden; text-align: left; background: radial-gradient(circle at 78% 40%, rgba(59,130,246,.20), transparent 31%), linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--card-bg) 78%, var(--bg))); }
.drive-hero h1 { margin: 0; font-size: clamp(2.8rem, 5vw, 5rem); line-height: 1; letter-spacing: -.06em; }
.drive-hero h1 span { color: var(--accent); }
.drive-hero p:not(.section-eyebrow) { max-width: 590px; margin: 20px 0 0; color: var(--text-muted); font-size: 1.05rem; line-height: 1.7; }
.drive-hero-art { position: relative; width: 310px; height: 220px; flex: 0 0 auto; }
.floating-file { position: absolute; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); background: rgba(30,41,59,.75); box-shadow: 0 24px 55px rgba(0,0,0,.28); backdrop-filter: blur(12px); }
.floating-file-main { inset: 20px 55px; border-radius: 42px; font-size: 4.8rem; transform: rotate(-4deg); }
.floating-file-one, .floating-file-two { width: 64px; height: 64px; border-radius: 20px; font-size: 1.7rem; }
.floating-file-one { left: 8px; bottom: 5px; transform: rotate(-10deg); }
.floating-file-two { right: 8px; top: 0; transform: rotate(11deg); }
.drive-workspace { width: min(92%, 1320px); margin: -34px auto 0; padding-bottom: 70px; position: relative; z-index: 2; display: grid; grid-template-columns: minmax(280px, 360px) 1fr; align-items: start; gap: 22px; }
.drive-workspace .upload-card, .drive-workspace .explorer-card { margin: 0; padding: 26px; border-radius: 20px; background: color-mix(in srgb, var(--card-bg) 94%, transparent); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.card-heading h2, .explorer-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
.card-heading .section-eyebrow, .explorer-heading .section-eyebrow { margin-bottom: 5px; }
.card-heading-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: white; font-size: 1.4rem; font-weight: 800; }
.upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 14px; }
.drive-workspace .custom-file-upload { min-height: 115px; padding: 18px 10px; justify-content: center; gap: 4px; border-radius: 14px; }
.custom-file-upload small { color: var(--text-muted); font-size: .72rem; font-weight: 500; }
.upload-option-icon { font-size: 1.8rem; }
.explorer-heading { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 20px; }
.drive-search-wrap { position: relative; width: min(100%, 360px); }
.drive-search-wrap span { position: absolute; left: 16px; top: 10px; z-index: 1; color: var(--text-muted); font-size: 1.35rem; }
.drive-search-wrap .search-bar { margin: 0; padding-left: 44px; }
.drive-workspace #file-list { min-height: 250px; }
.drive-workspace .file-item-container { min-height: 58px; padding-right: 12px; border-radius: 13px; }

/* FORMULARIOS DE SUBIDA AKKFLIX */
.media-upload-card { width: min(92vw, 520px); max-width: 520px; padding: 34px; text-align: left; border-radius: 22px; }
.media-upload-card h2 { margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -.04em; }
.upload-helper { margin: 0 0 22px; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.media-upload-card .custom-input { width: 100%; }
.media-type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 18px; }
.media-type-picker label { cursor: pointer; }
.media-type-picker input { position: absolute; opacity: 0; }
.media-type-picker span { display: block; padding: 12px; text-align: center; border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-muted); font-weight: 700; transition: .2s ease; }
.media-type-picker input:checked + span { border-color: #e50914; background: rgba(229,9,20,.13); color: #fff; box-shadow: inset 0 0 0 1px #e50914; }
.upload-field-label { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0 7px; color: var(--text-main); font-size: .82rem; font-weight: 700; }
.upload-field-label span { color: var(--text-muted); font-weight: 400; }
.styled-file-input { padding: 7px; color: var(--text-muted); }
.styled-file-input::file-selector-button { margin-right: 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: var(--card-hover); color: var(--text-main); font-weight: 700; cursor: pointer; }

@media (max-width: 920px) {
    .drive-hero-art { display: none; }
    .drive-workspace { grid-template-columns: 1fr; margin-top: -20px; }
    .drive-workspace .upload-card { order: 2; }
    .drive-workspace .explorer-card { order: 1; }
}

@media (max-width: 680px) {
    .drive-nav { padding: 10px 14px; align-items: flex-start; }
    .drive-brand span { display: none; }
    .drive-nav-actions, .user-bar-top { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .user-pill { display: none; }
    .drive-nav .btn-akkflix-nav { padding: 9px; font-size: .72rem; }
    .drive-nav .btn-logout { padding: 7px; font-size: .72rem; }
    .drive-hero { min-height: 280px; padding: 55px 6vw 65px; }
    .drive-workspace { width: 94%; }
    .drive-workspace .upload-card, .drive-workspace .explorer-card { padding: 19px; }
    .explorer-heading { align-items: stretch; flex-direction: column; }
    .drive-search-wrap { width: 100%; }
    .upload-options { grid-template-columns: 1fr; }
    .media-upload-card { padding: 27px 20px; }
    .upload-field-label { flex-direction: column; gap: 3px; }
}

/* SISTEMA VISUAL V12 — SOBRIO Y CONSISTENTE */
:root {
    --bg: #0a0d12;
    --card-bg: #11161e;
    --card-hover: #171e28;
    --accent: #4f7cff;
    --accent-hover: #3c68e8;
    --text-main: #f2f4f7;
    --text-muted: #929ba8;
    --border-color: #252c36;
    --shadow: 0 18px 45px rgba(0,0,0,.26);
}
body.light-mode {
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --card-hover: #f0f3f6;
    --text-main: #171a1f;
    --text-muted: #69727f;
    --border-color: #dfe3e8;
    --shadow: 0 16px 38px rgba(25,32,44,.10);
}
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { letter-spacing: 0; }
.section-eyebrow { color: var(--accent); font-size: .68rem; letter-spacing: .16em; }
.drive-nav, .akkflix-nav { min-height: 68px; background: color-mix(in srgb, var(--bg) 93%, transparent); }
.drive-brand { font-size: .95rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border-color)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--card-bg)); color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .04em; }
.brand-logo { width: 36px; height: 36px; display: block; border-radius: 9px; object-fit: cover; border: 1px solid var(--border-color); }
.login-emphasis { border-color: var(--accent) !important; background: var(--accent) !important; color: #fff !important; font-weight: 750; }
.login-emphasis:hover { background: var(--accent-hover) !important; }
.drive-nav .user-bar-top { padding: 0; border: 0; background: transparent; }
.user-pill { padding-right: 12px; color: var(--text-muted); font-size: .82rem; }
.btn-akkflix-nav, .btn-akkflix { border-radius: 8px; background: #e31b23; padding: 10px 15px; box-shadow: none; font-size: .78rem; letter-spacing: .04em; }
.nav-icon { width: auto; height: 36px; padding: 0 11px; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-muted); font-size: .72rem; }
.nav-icon:hover { color: var(--text-main); border-color: #3a4350; }
.btn-login-top, .btn-back, .btn-logout { border-radius: 8px; box-shadow: none; }
.theme-toggle, .drive-nav .theme-toggle, .akkflix-nav .theme-toggle { width: auto; min-width: 54px; height: 36px; padding: 0 11px; border-radius: 8px; color: var(--text-muted); font-size: .7rem; box-shadow: none; }
.theme-toggle:hover { transform: none; }
.drive-hero { min-height: 300px; background: linear-gradient(135deg, var(--bg) 0%, color-mix(in srgb, var(--accent) 7%, var(--bg)) 100%); border-bottom: 1px solid var(--border-color); }
.drive-hero h1 { max-width: 760px; font-size: clamp(2.6rem, 5vw, 4.7rem); letter-spacing: -.055em; }
.drive-hero-art { width: 280px; height: 230px; }
.storage-core { position: absolute; inset: 55px 78px; display: grid; place-items: center; border: 1px solid rgba(79,124,255,.42); border-radius: 50%; background: radial-gradient(circle, rgba(79,124,255,.22), rgba(79,124,255,.04)); color: #8ca9ff; font-weight: 800; letter-spacing: .1em; }
.storage-orbit { position: absolute; inset: 20px 42px; border: 1px solid rgba(79,124,255,.20); border-radius: 50%; transform: rotate(-18deg); }
.storage-orbit::after { content: ''; position: absolute; top: 12px; left: 38px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px rgba(79,124,255,.75); }
.orbit-two { inset: 8px 78px; transform: rotate(58deg); }
.orbit-two::after { top: auto; bottom: 15px; left: auto; right: 22px; width: 6px; height: 6px; }
.drive-workspace { margin-top: -26px; grid-template-columns: minmax(285px, 345px) 1fr; }
.drive-workspace .upload-card, .drive-workspace .explorer-card { border-radius: 12px; background: var(--card-bg); box-shadow: var(--shadow); }
.card-heading-icon { width: 38px; height: 38px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--card-bg)); color: var(--accent); font-size: .62rem; letter-spacing: .08em; }
.drive-workspace .badge { border-radius: 5px; background: var(--card-hover); color: var(--text-muted); font-size: .7rem; }
.drive-workspace .custom-file-upload { min-height: 105px; border-radius: 8px; border: 1px solid var(--border-color); background: transparent; }
.drive-workspace .custom-file-upload:hover { background: var(--card-hover); border-color: color-mix(in srgb, var(--accent) 60%, var(--border-color)); }
.upload-option-icon { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 5px; background: var(--card-hover); color: var(--text-muted); font-size: .57rem; font-weight: 800; letter-spacing: .06em; }
.btn-primary { border-radius: 8px; background: var(--accent); box-shadow: none; }
.btn-primary:hover { transform: none; background: var(--accent-hover); box-shadow: none; }
.btn-secondary { border-width: 1px; border-radius: 8px; }
.search-bar, .custom-input, textarea, select { border-radius: 8px; background: color-mix(in srgb, var(--bg) 70%, var(--card-bg)); border-color: var(--border-color); }
.explorer-heading { padding-bottom: 18px; border-bottom: 1px solid var(--border-color); }
.explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 14px; border-bottom: 1px solid var(--border-color); }
.drive-breadcrumb { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.drive-breadcrumb button { padding: 3px 5px; border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.drive-breadcrumb button:disabled { color: var(--text-muted); cursor: default; }
.explorer-controls { display: flex; align-items: center; gap: 6px; }
.explorer-controls select { width: auto; margin: 0; padding: 7px 28px 7px 9px; font-size: .68rem; }
.view-toggle { padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: var(--text-muted); font-size: .66rem; cursor: pointer; }
.view-toggle.active { border-color: var(--accent); color: var(--accent); background: rgba(79,124,255,.08); }
.file-item-container { background: transparent; border-width: 0 0 1px; border-radius: 0 !important; }
.file-item-container:hover { background: var(--card-hover); border-color: var(--border-color); }
.file-item-main { display: flex; align-items: center; gap: 12px; }
.file-type-mark { width: 36px; flex: 0 0 36px; padding: 8px 0; border-radius: 6px; background: var(--card-hover); color: var(--text-muted); text-align: center; font-size: .55rem; font-weight: 800; letter-spacing: .04em; }
.file-type-mark.is-folder { background: rgba(79,124,255,.12); color: #87a6ff; }
.file-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-metadata { margin-left: auto; padding-left: 12px; color: var(--text-muted); font-size: .66rem; white-space: nowrap; }
#file-list.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding-top: 14px; }
#file-list.grid-view .file-item-container { min-height: 145px; padding: 14px; flex-direction: column; align-items: stretch; border: 1px solid var(--border-color); border-radius: 8px !important; }
#file-list.grid-view .file-item-main { flex: 1; padding: 8px; flex-direction: column; align-items: flex-start; white-space: normal; }
#file-list.grid-view .file-type-mark { width: 42px; flex-basis: auto; }
#file-list.grid-view .file-metadata { margin: 0; padding: 0; white-space: normal; }
#file-list.grid-view .file-actions { justify-content: flex-end; flex-wrap: wrap; }
.file-actions .btn-icon { padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-muted); font-size: .68rem; }
.file-actions .btn-icon:hover { color: var(--text-main); background: var(--card-hover); }
.file-actions .action-danger { color: #e16a6a; }
.switch-label { font-size: .65rem; }

/* Modales del Drive */
.modal-overlay { background: rgba(2,4,8,.78); backdrop-filter: blur(9px); }
.login-card, .dashboard-card, .viewer-card, .media-upload-card, .player-card { border-radius: 12px; background: var(--card-bg); border: 1px solid var(--border-color); }
.login-card { padding: 30px; }
.login-card h2, .dashboard-card h2 { margin: 0 0 22px; letter-spacing: -.035em; }
.professional-modal { width: min(92vw, 760px); max-width: 760px; padding: 32px; }
.stats-grid { gap: 12px; }
.stat-box { padding: 20px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 58%, var(--card-bg)); text-align: left; }
.stat-box h3 { font-size: .72rem; font-weight: 600; }
.stat-box p { margin-top: 8px; font-size: 1.8rem; }
.top-movies { border-radius: 8px; }
.top-movies h3, .section-heading h3 { margin: 0; font-size: .95rem; }
.top-movies li { align-items: center; gap: 16px; }
.top-movies li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-value { color: var(--text-muted); font-size: .72rem; white-space: nowrap; }
.section-heading { margin: 22px 0 14px; }
.create-user-box { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: start; }
.create-user-box .custom-input, .create-user-box .btn-primary { width: 100%; margin: 0; }
.create-user-box .btn-primary { padding: 12px 18px; white-space: nowrap; }
.user-item { min-height: 50px; border-radius: 7px; }
.user-info { display: flex; flex-direction: column; gap: 4px; }
.user-info small { color: var(--text-muted); font-size: .7rem; }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); text-align: center; }
.empty-state strong { color: var(--text-main); }

/* AKKFLIX refinado */
.akkflix-brand { font-family: inherit; font-size: 1.45rem; letter-spacing: -.055em; }
.akkflix-hero { min-height: 350px; background: radial-gradient(circle at 75% 45%, rgba(229,9,20,.14), transparent 32%), linear-gradient(120deg, #080a0e, #101318); }
.akkflix-hero h1 { font-size: clamp(2.7rem, 5.5vw, 5rem); }
.genre-filters { justify-content: flex-start; max-width: none; }
.btn-genre { border-radius: 7px; padding: 8px 14px; background: transparent; box-shadow: none; font-size: .76rem; font-weight: 600; }
.btn-genre.active { background: #e31b23; border-color: #e31b23; }
.movie-card, .movie-poster-wrap { border-radius: 8px; }
.movie-poster-wrap { box-shadow: 0 12px 32px rgba(0,0,0,.24); }
.movie-badge { border-radius: 5px; background: rgba(7,9,12,.84); font-size: .62rem; letter-spacing: .04em; }
.movie-card-play { border-radius: 8px; background: #e31b23; }
.movie-detail-modal-card { border-radius: 12px; }
.media-upload-card { border-radius: 12px; }
.media-type-picker span, .styled-file-input::file-selector-button { border-radius: 7px; }
.continue-section { margin-bottom: 42px; }
.continue-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 360px); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.continue-card { display: grid; grid-template-columns: 86px 1fr; gap: 13px; min-height: 105px; padding: 9px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); color: var(--text-main); text-align: left; cursor: pointer; }
.continue-card img { width: 86px; height: 86px; border-radius: 5px; object-fit: cover; }
.continue-card > span { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 7px; }
.continue-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-card small { color: var(--text-muted); }
.continue-card i { height: 3px; overflow: hidden; border-radius: 2px; background: var(--border-color); }
.continue-card i b { display: block; height: 100%; background: #e31b23; }

.season-group { margin: 10px 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: color-mix(in srgb, var(--card-bg) 88%, black); }
.season-group summary { display: flex; justify-content: space-between; gap: 18px; padding: 14px 16px; cursor: pointer; font-weight: 700; }
.season-group summary small { color: var(--text-muted); font-weight: 500; }
.season-episodes { border-top: 1px solid var(--border-color); }
.episode-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.episode-item:last-child { border-bottom: 0; }
.episode-info { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.episode-info span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-actions { display: flex; align-items: center; gap: 8px; }
.episode-watched { padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.episode-item.is-watched .episode-watched { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.12); color: #4ade80; }
.episode-item.is-watched .episode-info { opacity: .72; }

.admin-monitor { margin-top: 22px; }
.health-warning { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid rgba(245,158,11,.45); border-radius: 8px; background: rgba(245,158,11,.1); color: #fbbf24; }
.health-warning[hidden] { display: none; }
.health-warning span { font-size: .75rem; color: var(--text-muted); }
.live-indicator { color: #4ade80; font-size: .7rem; }
.live-indicator::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.health-card { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 13px; border: 1px solid var(--border-color); border-radius: 8px; background: color-mix(in srgb, var(--bg) 58%, var(--card-bg)); }
.health-card small, .health-card span { color: var(--text-muted); font-size: .68rem; }
.health-card strong { font-size: .86rem; }
.admin-live-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.admin-live-panel { min-width: 0; padding: 14px; border: 1px solid var(--border-color); border-radius: 8px; }
.admin-live-panel h3 { display: flex; justify-content: space-between; margin: 0 0 10px; font-size: .82rem; }
.admin-feed { max-height: 190px; overflow-y: auto; }
.feed-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-color); }
.feed-item:last-child { border-bottom: 0; }
.feed-item > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.feed-item strong { font-size: .72rem; }
.feed-item small { color: var(--text-muted); font-size: .62rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item time { flex: 0 0 auto; color: var(--text-muted); font-size: .58rem; }
.session-close { padding: 6px 8px; border: 1px solid rgba(239,68,68,.35); border-radius: 5px; background: transparent; color: #f87171; cursor: pointer; font-size: .62rem; }
.feed-empty { color: var(--text-muted); font-size: .72rem; }

.akkflix-spotlight { position: relative; padding: 11px 18px; background: linear-gradient(135deg, #ff2632, #c4000a); box-shadow: 0 8px 24px rgba(229,9,20,.3); }
.akkflix-spotlight::after { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 11px; background: rgba(229,9,20,.22); animation: akkflixPulse 2.4s ease-in-out infinite; }
.play-mark { display: inline-grid; width: 20px; height: 20px; margin-right: 4px; place-items: center; border-radius: 50%; background: white; color: #d20b15; font-size: .58rem; }
@keyframes akkflixPulse { 50% { transform: scale(1.05); opacity: .15; } }

.login-premium { width: min(92vw, 430px); padding: 38px; background: radial-gradient(circle at 100% 0, rgba(59,130,246,.14), transparent 35%), var(--card-bg); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-weight: 750; }
.login-brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; }
.login-premium h2 { margin: 5px 0 8px; font-size: 2rem; }
.login-help { margin: 0 0 24px; color: var(--text-muted); font-size: .86rem; }
.login-field { display: block; margin-bottom: 14px; color: var(--text-muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.login-field .custom-input { width: 100%; margin: 7px 0 0; padding: 14px; font-size: .9rem; text-transform: none; letter-spacing: normal; }
.login-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; padding: 14px 17px; }
.login-submit span { font-size: 1.2rem; }
.login-security { display: block; margin-top: 14px; color: var(--text-muted); text-align: center; }

.profile-card { width: min(92vw, 560px); padding: 30px; border: 1px solid var(--border-color); border-radius: 13px; background: var(--card-bg); }
.profile-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }
.profile-heading img { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; border: 1px solid var(--border-color); }
.profile-heading h2 { margin: 3px 0; }
.profile-heading small { color: var(--text-muted); }
.profile-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 22px; padding: 4px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 65%, var(--card-bg)); }
.profile-tabs button { flex: 1; min-width: max-content; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 650; }
.profile-tabs button.active { background: var(--card-hover); color: var(--text-main); }
.profile-tab-content label { display: block; margin-bottom: 12px; color: var(--text-muted); font-size: .75rem; }
.profile-tab-content .custom-input { width: 100%; margin: 7px 0 0; }
.profile-tab-content textarea { min-height: 105px; resize: vertical; }
.profile-tab-content .btn-primary, .profile-tab-content .btn-secondary, .profile-tab-content .btn-danger-outline { width: 100%; margin-top: 9px; }
.admin-inbox { margin-top: 12px; }
.admin-message { padding: 12px; border-bottom: 1px solid var(--border-color); }
.admin-message.is-new { border-left: 3px solid #3b82f6; background: rgba(59,130,246,.06); }
.admin-message header { display: flex; justify-content: space-between; gap: 12px; }
.admin-message header > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.admin-message header small, .admin-message header span { color: var(--text-muted); font-size: .62rem; }
.admin-message header button { border: 0; background: transparent; color: #60a5fa; cursor: pointer; font-size: .66rem; }
.admin-message p { margin: 10px 0 0; color: var(--text-muted); font-size: .72rem; line-height: 1.5; white-space: pre-wrap; }
.mobile-bottom-nav { display: none; }
.mobile-bottom-nav[hidden] { display: none !important; }

@media (max-width: 820px) {
    .drive-workspace { grid-template-columns: minmax(0, 1fr); width: 94%; margin-top: 0; padding-top: 14px; }
    .drive-workspace .upload-card { order: 2; }
    .drive-workspace .explorer-card { order: 1; }
    .create-user-box { grid-template-columns: 1fr; }
    .professional-modal { padding: 24px 18px; }
    .health-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-live-columns { grid-template-columns: 1fr; }
    .explorer-toolbar { align-items: stretch; flex-direction: column; }
    .explorer-controls { overflow-x: auto; }
}

@media (max-width: 680px) {
    body.drive-page { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .drive-nav { align-items: center; }
    .drive-nav-actions { width: calc(100% - 44px); }
    .drive-nav .user-bar-top { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
    .nav-icon { width: auto; padding: 0 8px; font-size: .6rem; }
    .drive-nav .btn-logout { padding: 8px 10px; }
    .drive-hero { min-height: 265px; }
    .drive-workspace { margin-top: 0; padding-top: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .episode-item { align-items: flex-start; flex-direction: column; }
    .episode-actions { width: 100%; justify-content: flex-end; }
    .drive-nav .btn-akkflix-nav, .drive-nav .btn-logout, .drive-nav .nav-icon { display: none; }
    .drive-nav .user-pill { max-width: 120px; }
    .login-premium { padding: 30px 22px; }
    .profile-card { max-height: 88vh; overflow-y: auto; padding: 24px 18px; }
    .mobile-bottom-nav { position: fixed; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; z-index: 900; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border: 1px solid var(--border-color); border-radius: 16px; background: color-mix(in srgb, var(--card-bg) 92%, transparent); box-shadow: 0 18px 55px rgba(0,0,0,.45); backdrop-filter: blur(18px); }
    .mobile-bottom-nav button { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 4px; padding: 8px 3px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font-size: .61rem; font-weight: 700; cursor: pointer; }
    .mobile-bottom-nav button span { font-size: 1.05rem; }
    .mobile-bottom-nav button.active { background: var(--card-hover); color: var(--text-main); }
    .mobile-bottom-nav .mobile-akkflix { color: #ff3943; }
    .mobile-bottom-nav .mobile-akkflix span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #e31b23; color: white; font-size: .7rem; box-shadow: 0 5px 16px rgba(229,9,20,.35); }
}
