/* ================================================================
   VDO Player – Mobile-First Dark Theme
   ================================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    /* ── Ultra Dark Palette ── */
    --bg:          #08080e;
    --surface:     #0e0e18;
    --card:        #141420;
    --card-hover:  #1c1c2c;
    --accent:      #8b5cf6;
    --accent2:     #6366f1;
    --accent-glow: rgba(139,92,246,.28);
    --text:        #eeeef5;
    --text-muted:  #9898b8;
    --text-dim:    #484868;
    --border:      rgba(255,255,255,.08);
    --border-soft: rgba(255,255,255,.04);
    --radius-sm:   10px;
    --radius:      14px;
    --radius-lg:   20px;
    --shadow:      0 8px 32px rgba(0,0,0,.7);
    --transition:  .18s ease;

    /* ── Dark gradient palette for thumbnails ── */
    --g0: linear-gradient(135deg, #2d1b69, #4c1d95);
    --g1: linear-gradient(135deg, #5b21b6, #3730a3);
    --g2: linear-gradient(135deg, #1e3a8a, #1e40af);
    --g3: linear-gradient(135deg, #064e3b, #065f46);
    --g4: linear-gradient(135deg, #7f1d1d, #831843);
    --g5: linear-gradient(135deg, #1c2541, #1e3a8a);
    --g6: linear-gradient(135deg, #3b1a04, #78350f);
    --g7: linear-gradient(135deg, #1e1b4b, #312e81);

    /* ── Nav height ── */
    --nav-h: 62px;
    --header-h: 56px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, button { font-size: 16px; } /* prevent iOS zoom */
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e1e32; border-radius: 4px; }

/* ── Thumbnail image (replaces gradient) ───────────────────── */
.video-thumb .thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    opacity: 0;
    transition: opacity .35s ease;
    z-index: 1;
}
.video-thumb.has-thumb .thumb-img { opacity: 1; }
.video-thumb.has-thumb .play-circle { z-index: 2; }
.video-thumb.has-thumb .ext-badge   { z-index: 2; }

/* Shimmer while loading thumbnail */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.video-thumb.thumb-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,.0)  0%,
        rgba(255,255,255,.06) 50%,
        rgba(255,255,255,.0)  100%
    );
    background-size: 400px 100%;
    animation: shimmer 1.2s infinite linear;
    z-index: 3;
    pointer-events: none;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top, 24px)) 20px
             max(24px, env(safe-area-inset-bottom, 24px));
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.login-bg {
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% -5%, rgba(139,92,246,.3) 0%, transparent 65%),
        radial-gradient(ellipse 50% 35% at 90% 100%, rgba(99,102,241,.18) 0%, transparent 60%);
    pointer-events: none;
}

.login-container { width: 100%; max-width: 420px; position: relative; z-index: 1; }

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px 32px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(124,58,237,.15);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .logo-icon {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}
.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.3px;
    background: linear-gradient(135deg, #c4b5fd, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-logo p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-error {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.22);
    color: #fca5a5;
}

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
    letter-spacing: .2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
    flex-shrink: 0;
}
.input-wrapper input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 42px 13px 44px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrapper input::placeholder { color: var(--text-dim); }
.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.toggle-pass {
    position: absolute;
    right: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    padding: 4px;
}
.toggle-pass:hover { color: var(--text-muted); }

.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    transition: opacity var(--transition), transform var(--transition);
    letter-spacing: .2px;
    box-shadow: 0 4px 20px rgba(139,92,246,.45);
}
.btn-login:hover  { opacity: .9; }
.btn-login:active { transform: scale(.98); opacity: .85; }

/* ================================================================
   APP LAYOUT (videos + player pages)
   ================================================================ */
.app-body  { background: var(--bg);  min-height: 100vh; }
.player-body { background: #000; min-height: 100vh; }

/* ── Header ─────────────────────────────────────────────────── */
.app-header, .player-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(8,8,14,.93);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    /* total height = base + safe-area-top */
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.header-app-name {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #c4b5fd, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-user svg { flex-shrink: 0; }

.btn-logout {
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.btn-logout:hover { color: #f87171; background: rgba(239,68,68,.1); }

/* ── User Info Bar ──────────────────────────────────────────── */
.user-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.user-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}
.user-greeting {
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
}
.user-greeting strong { font-weight: 600; }
.user-stats {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}
.user-stats .dot { color: var(--text-dim); }

/* ── Search ─────────────────────────────────────────────────── */
.search-wrap {
    padding: 10px 16px 8px;
    background: var(--bg);
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 100;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
}
.search-box input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 40px 10px 44px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-clear {
    position: absolute;
    right: 12px;
    color: var(--text-dim);
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 50%;
}
.search-clear:hover { background: rgba(255,255,255,.08); color: var(--text); }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 16px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb a { color: #a5b4fc; }
.breadcrumb a:hover { text-decoration: underline; }
.bc-sep { color: var(--text-dim); }

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-dim);
}
.stats-bar span { display: flex; align-items: center; gap: 5px; }

/* ── List Layout ────────────────────────────────────────────── */
.main-content { padding: 0 0 8px; }

.media-list { display: flex; flex-direction: column; }

.video-card, .folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    background: transparent;
    transition: background var(--transition);
    position: relative;
    overflow: hidden;
}
.video-card:hover,  .folder-card:hover  { background: rgba(255,255,255,.025); }
.video-card:active, .folder-card:active { background: rgba(255,255,255,.05); }

/* Thumbnail */
.video-thumb {
    position: relative;
    width: 110px;
    height: 62px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gradient-0 { background: var(--g0); }
.gradient-1 { background: var(--g1); }
.gradient-2 { background: var(--g2); }
.gradient-3 { background: var(--g3); }
.gradient-4 { background: var(--g4); }
.gradient-5 { background: var(--g5); }
.gradient-6 { background: var(--g6); }
.gradient-7 { background: var(--g7); }

.play-circle {
    width: 34px; height: 34px;
    background: rgba(0,0,0,.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background var(--transition), transform var(--transition);
    position: relative;
    z-index: 2;
}
.video-card:active .play-circle { background: rgba(139,92,246,.8); transform: scale(.92); }

.ext-badge {
    position: absolute;
    bottom: 4px;
    right: 5px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: .5px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Folder icon */
.folder-icon {
    width: 48px; height: 48px;
    flex-shrink: 0;
    background: rgba(139,92,246,.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    transition: background var(--transition);
}
.folder-card:active .folder-icon { background: rgba(139,92,246,.2); }

/* List info */
.list-info { flex: 1; min-width: 0; }
.list-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.list-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-chevron { flex-shrink: 0; color: var(--text-dim); }

/* Divider between folders and videos */
.list-section-header {
    padding: 10px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    background: var(--surface);
}

/* Back button in app header (when inside a folder) */
.header-back-home {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--transition), background var(--transition);
}
.header-back-home:hover { color: var(--text); background: rgba(255,255,255,.06); }
.header-folder-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-dim);
}
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }
.empty-state code {
    background: rgba(255,255,255,.07);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #a5b4fc;
}

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
    font-size: 15px;
}
.no-results .empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ================================================================
   PLAYER PAGE
   ================================================================ */
/* player-body already defined above */

.player-header {
    background: rgba(0,0,0,.93);
    border-bottom-color: rgba(255,255,255,.05);
    gap: 12px;
}
.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #c4b5fd;
    padding: 7px 12px 7px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--transition), background var(--transition);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(196,181,253,.2);
    background: rgba(139,92,246,.1);
}
.back-btn:hover  { background: rgba(139,92,246,.2); border-color: rgba(196,181,253,.35); }
.back-btn:active { transform: scale(.96); }
.back-label { white-space: nowrap; }

.player-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.player-header-right { flex-shrink: 0; }

/* Plyr wrapper */
.player-video-wrap {
    background: #000;
    width: 100%;
}
.player-video-wrap .plyr {
    width: 100%;
    --plyr-color-main: var(--accent);
    --plyr-video-control-color: rgba(255,255,255,.9);
    --plyr-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Video info */
.video-info-section {
    background: var(--surface);
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.video-info-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text);
}
.video-info-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
}
.badge-ext {
    background: rgba(139,92,246,.2);
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,.35);
}
.badge-sm {
    background: rgba(255,255,255,.08);
    color: var(--text-dim);
    font-size: 10px;
    padding: 1px 6px;
}

/* Prev / Next navigation */
.video-nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    transition: background var(--transition), border-color var(--transition);
    overflow: hidden;
}
.nav-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-btn:hover { background: var(--card-hover); border-color: rgba(124,58,237,.3); }
.nav-next { justify-content: flex-end; text-align: right; }
.nav-btn svg { flex-shrink: 0; }

/* Playlist */
.playlist-section {
    background: var(--surface);
    padding-bottom: 24px;
}
.playlist-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.playlist-items {
    max-height: 380px;
    overflow-y: auto;
}
.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    transition: background var(--transition);
}
.playlist-item:hover   { background: var(--card); }
.playlist-item.active  { background: rgba(139,92,246,.1); }
.playlist-num {
    font-size: 12px;
    color: var(--text-dim);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.playlist-item.active .playlist-num { color: #a5b4fc; font-weight: 700; }
.playlist-item-info { flex: 1; overflow: hidden; }
.playlist-item-name {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.playlist-item.active .playlist-item-name { color: #c4b5fd; font-weight: 500; }

/* Playing animation bars */
.playlist-playing-icon {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    flex-shrink: 0;
}
.playlist-playing-icon span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: barBounce .8s ease-in-out infinite;
}
.playlist-playing-icon span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.playlist-playing-icon span:nth-child(2) { height: 14px; animation-delay: .15s; }
.playlist-playing-icon span:nth-child(3) { height: 10px; animation-delay: .3s; }
@keyframes barBounce {
    0%,100% { transform: scaleY(1); }
    50%      { transform: scaleY(.35); }
}

/* ================================================================
   RESPONSIVE TWEAKS
   ================================================================ */
@media (min-width: 768px) {
    .player-video-wrap .plyr { max-height: 70vh; }
    .login-card { padding: 44px 40px; }
    .video-info-title { font-size: 18px; }
    .app-header, .player-header {
        height: calc(64px + env(safe-area-inset-top, 0px));
    }
    .search-wrap { top: calc(64px + env(safe-area-inset-top, 0px)); }
    .header-app-name { font-size: 18px; }
}

/* Landscape mobile: maximise player */
@media (max-height: 500px) and (orientation: landscape) {
    .app-header, .player-header { height: 48px; padding-top: 0; }
    .search-wrap { top: 48px; }
    .player-video-wrap { max-height: calc(100vh - 48px); }
    .bottom-nav { height: calc(52px + env(safe-area-inset-bottom, 0px)); }
}

/* ================================================================
   MOBILE APP / WEBVIEW – BOTTOM NAVIGATION
   ================================================================ */

/* ── Mobile overrides ── */
@media (max-width: 767px) {
    .app-body,
    .player-body {
        padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    }
    .app-header    .btn-logout,
    .player-header .btn-logout { display: none; }
    .video-card, .folder-card  { min-height: 72px; }
}

/* ── Bottom Nav Bar ── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 300;
    display: none;           /* hidden on desktop */
    flex-direction: row;
    align-items: stretch;
    background: rgba(8,8,14,.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255,255,255,.1);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 767px) { .bottom-nav { display: flex; } }

/* Nav tab */
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 2px;
    position: relative;
    letter-spacing: .2px;
    text-decoration: none;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.nav-item.active   { color: #c4b5fd; }
.nav-item.disabled { opacity: .25; pointer-events: none; }
.nav-item:active   { opacity: .5; }

/* Active top pill */
.nav-item-indicator {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 3px;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: opacity .15s ease;
}
.nav-item.active .nav-item-indicator { opacity: 1; }
.nav-item.active svg { filter: drop-shadow(0 0 7px rgba(196,181,253,.5)); }

/* Dot badge */
.nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 19px);
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    border: 1.5px solid #08080e;
}

/* ── Profile Bottom Sheet ───────────────────────────────────── */
.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.profile-overlay.open { opacity: 1; pointer-events: auto; }

.profile-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,1.25,.6,1);
}
.profile-overlay.open .profile-sheet { transform: translateY(0); }

.sheet-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,.18);
    border-radius: 2px;
    margin: 14px auto 0;
}

.sheet-user-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.sheet-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}
.sheet-user-name { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3; }
.sheet-user-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.sheet-actions { padding: 6px 0; }

.sheet-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .14s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.sheet-action-btn:active { background: rgba(255,255,255,.05); }
.sheet-action-btn.danger { color: #f87171; }

.sheet-action-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sheet-action-icon.icon-danger { background: rgba(239,68,68,.15); }
.sheet-action-icon.icon-info   { background: rgba(99,102,241,.15); color: #a5b4fc; }
