/* ═══════════════════════════════════════════
           TOKENS
        ═══════════════════════════════════════════ */
        :root {
            --bg: #080b0f;
            --bg2: #0e1318;
            --bg3: #141a22;
            --bg4: #1b242f;
            --border: rgba(255,255,255,.07);
            --border2: rgba(255,255,255,.12);
            --green: #85ea2d;
            --green-dim: rgba(133,234,45,.12);
            --green-glow: rgba(133,234,45,.25);
            --text: #e8edf3;
            --text2: #8a96a3;
            --text3: #4a5568;
            --red: #ff4757;
            --red-dim: rgba(255,71,87,.12);
            --yellow: #ffd32a;
            --blue: #3d9eff;
            --radius: 10px;
            --radius-lg: 16px;
            --font: 'Syne', sans-serif;
            --mono: 'DM Mono', monospace;
        }

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

        html, body {
            height: 100%;
            background: var(--bg);
            color: var(--text);
            font-family: var(--font);
            font-size: 14px;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }
        /* ── Scrollbar ── */
        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--bg4);
            border-radius: 4px;
        }
        /* ── Utilities ── */
        .hidden {
            display: none !important;
        }

        .mono {
            font-family: var(--mono);
        }
        /* ═══════════════════════════════════════════
           AUTH SCREENS
        ═══════════════════════════════════════════ */
        #auth-screen {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            position: relative;
            overflow: hidden;
        }

            #auth-screen::before {
                content: '';
                position: fixed;
                inset: 0;
                background: radial-gradient(ellipse 60% 50% at 20% 50%, rgba(133,234,45,.06) 0%, transparent 60%), radial-gradient(ellipse 40% 60% at 80% 20%, rgba(61,158,255,.04) 0%, transparent 60%);
                pointer-events: none;
            }
            /* Grid pattern */
            #auth-screen::after {
                content: '';
                position: fixed;
                inset: 0;
                background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
                background-size: 60px 60px;
                pointer-events: none;
                opacity: .5;
            }

        .auth-card {
            width: 100%;
            max-width: 420px;
            background: var(--bg2);
            border: 1px solid var(--border2);
            border-radius: var(--radius-lg);
            padding: 40px;
            position: relative;
            z-index: 1;
            box-shadow: 0 32px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(133,234,45,.05);
            animation: cardIn .4s cubic-bezier(.22,1,.36,1);
        }

        @keyframes cardIn {
            from {
                opacity: 0;
                transform: translateY(24px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .auth-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 32px;
        }

        .auth-logo-icon {
            width: 38px;
            height: 38px;
            background: var(--green-dim);
            border: 1px solid var(--green-glow);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .auth-logo-icon svg {
                width: 20px;
                height: 20px;
                stroke: var(--green);
                fill: none;
                stroke-width: 1.8;
                stroke-linecap: round;
            }

        .auth-logo-text {
            font-size: 18px;
            font-weight: 700;
            letter-spacing: -.02em;
        }

            .auth-logo-text span {
                color: var(--green);
            }

        .auth-title {
            font-size: 22px;
            font-weight: 700;
            letter-spacing: -.02em;
            margin-bottom: 6px;
        }

        .auth-sub {
            color: var(--text2);
            font-size: 13px;
            margin-bottom: 28px;
        }
        /* ── Form elements ── */
        .field {
            margin-bottom: 16px;
        }

            .field label {
                display: block;
                font-size: 12px;
                font-weight: 600;
                color: var(--text2);
                margin-bottom: 7px;
                letter-spacing: .04em;
                text-transform: uppercase;
            }

            .field input {
                width: 100%;
                background: var(--bg3);
                border: 1px solid var(--border2);
                border-radius: var(--radius);
                color: var(--text);
                font-family: var(--font);
                font-size: 14px;
                padding: 11px 14px;
                outline: none;
                transition: border-color .2s, box-shadow .2s;
            }

                .field input:focus {
                    border-color: rgba(133,234,45,.4);
                    box-shadow: 0 0 0 3px rgba(133,234,45,.08);
                }

                .field input::placeholder {
                    color: var(--text3);
                }

        .field-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }
        /* ── Buttons ── */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: none;
            border-radius: var(--radius);
            font-family: var(--font);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all .18s;
            white-space: nowrap;
            padding: 10px 16px;
        }

        .btn-primary {
            background: var(--green);
            color: #080b0f;
            width: 100%;
            padding: 13px;
            font-size: 15px;
            box-shadow: 0 4px 20px rgba(133,234,45,.2);
        }

            .btn-primary:hover {
                background: #9bff35;
                transform: translateY(-1px);
                box-shadow: 0 6px 24px rgba(133,234,45,.3);
            }

            .btn-primary:active {
                transform: none;
            }

        .btn-ghost {
            background: transparent;
            color: var(--text2);
            border: 1px solid var(--border2);
        }

            .btn-ghost:hover {
                background: var(--bg3);
                color: var(--text);
                border-color: var(--border2);
            }

        .btn-danger {
            background: var(--red-dim);
            color: var(--red);
            border: 1px solid rgba(255,71,87,.2);
        }

            .btn-danger:hover {
                background: rgba(255,71,87,.2);
            }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            background: var(--bg3);
            color: var(--text2);
            border: 1px solid var(--border);
            border-radius: 8px;
        }

            .btn-icon:hover {
                background: var(--bg4);
                color: var(--text);
            }

        .btn svg {
            width: 16px;
            height: 16px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
            flex-shrink: 0;
        }

        .btn:disabled {
            opacity: .45;
            pointer-events: none;
        }
        /* ── Auth links ── */
        .auth-link {
            text-align: center;
            margin-top: 20px;
            font-size: 13px;
            color: var(--text2);
        }

            .auth-link a {
                color: var(--green);
                text-decoration: none;
                font-weight: 600;
                cursor: pointer;
            }

                .auth-link a:hover {
                    text-decoration: underline;
                }
        /* ── Error/Success banners ── */
        .banner {
            padding: 11px 14px;
            border-radius: var(--radius);
            font-size: 13px;
            margin-bottom: 16px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .banner-error {
            background: var(--red-dim);
            border: 1px solid rgba(255,71,87,.2);
            color: #ff7b87;
        }

        .banner-success {
            background: var(--green-dim);
            border: 1px solid rgba(133,234,45,.2);
            color: var(--green);
        }

        .banner svg {
            width: 15px;
            height: 15px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            flex-shrink: 0;
            margin-top: 1px;
        }
        /* ═══════════════════════════════════════════
           MAIN APP LAYOUT
        ═══════════════════════════════════════════ */
        #app {
            display: grid;
            grid-template-columns: 240px 1fr;
            grid-template-rows: 56px 1fr;
            height: 100vh;
            overflow: hidden;
        }
        /* ── Top bar ── */
        #topbar {
            grid-column: 1 / -1;
            background: var(--bg2);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            padding: 0 20px;
            gap: 16px;
        }

        .topbar-logo {
            display: flex;
            align-items: center;
            gap: 9px;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -.02em;
            flex-shrink: 0;
            width: 200px;
        }

        .topbar-logo-dot {
            width: 8px;
            height: 8px;
            background: var(--green);
            border-radius: 50%;
            box-shadow: 0 0 8px var(--green);
        }

        .topbar-logo span {
            color: var(--green);
        }

        .topbar-search {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 0 12px;
            max-width: 400px;
        }

            .topbar-search svg {
                width: 14px;
                height: 14px;
                stroke: var(--text3);
                fill: none;
                stroke-width: 2;
                stroke-linecap: round;
                flex-shrink: 0;
            }

            .topbar-search input {
                background: none;
                border: none;
                outline: none;
                color: var(--text);
                font-family: var(--font);
                font-size: 13px;
                width: 100%;
                padding: 8px 0;
            }

                .topbar-search input::placeholder {
                    color: var(--text3);
                }

        .topbar-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .user-pill {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 5px 12px 5px 6px;
            cursor: pointer;
            transition: border-color .2s;
        }

            .user-pill:hover {
                border-color: var(--border2);
            }

        .user-avatar {
            width: 26px;
            height: 26px;
            background: var(--green-dim);
            border: 1px solid var(--green-glow);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            color: var(--green);
            letter-spacing: 0;
        }

        .user-name {
            font-size: 13px;
            font-weight: 600;
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* ── Sidebar ── */
        #sidebar {
            background: var(--bg2);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .sidebar-section {
            padding: 16px 12px 8px;
        }

        .sidebar-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .1em;
            text-transform: uppercase;
            color: var(--text3);
            padding: 0 8px;
            margin-bottom: 6px;
        }

        .sidebar-item {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            color: var(--text2);
            font-size: 13px;
            font-weight: 500;
            transition: all .15s;
            position: relative;
        }

            .sidebar-item:hover {
                background: var(--bg3);
                color: var(--text);
            }

            .sidebar-item.active {
                background: var(--green-dim);
                color: var(--green);
            }

                .sidebar-item.active::before {
                    content: '';
                    position: absolute;
                    left: 0;
                    top: 25%;
                    bottom: 25%;
                    width: 2px;
                    background: var(--green);
                    border-radius: 2px;
                }

            .sidebar-item svg {
                width: 16px;
                height: 16px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.8;
                stroke-linecap: round;
                flex-shrink: 0;
            }

        .sidebar-divider {
            height: 1px;
            background: var(--border);
            margin: 8px 12px;
        }
        /* Folders tree */
        #folders-tree {
            flex: 1;
            overflow-y: auto;
            padding: 8px 12px;
        }

        .folder-tree-item {
            display: flex;
            align-items: center;
            gap: 7px;
            padding: 6px 8px;
            border-radius: 7px;
            cursor: pointer;
            color: var(--text2);
            font-size: 12px;
            font-weight: 500;
            transition: all .15s;
        }

            .folder-tree-item:hover {
                background: var(--bg3);
                color: var(--text);
            }

            .folder-tree-item.active {
                background: var(--green-dim);
                color: var(--green);
            }

            .folder-tree-item svg {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.8;
                flex-shrink: 0;
            }

        .sidebar-bottom {
            padding: 12px;
            border-top: 1px solid var(--border);
        }

        .menu-toggle {
            display: none;
            background: none;
            border: none;
            color: var(--text);
            font-size: 22px;
            cursor: pointer;
        }
.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width:768px) {

    #app {
        grid-template-columns: 1fr;
    }

    #sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 240px;
        z-index: 200;
        transition: left .3s;
    }

        #sidebar.open {
            left: 0;
        }

    .menu-toggle {
        display: block;
        margin-right: 10px;
    }

    #topbar {
        padding: 0 10px;
        gap: 10px;
    }

    .topbar-logo {
        width: auto;
        font-size: 14px;
    }

    .topbar-search {
        display: none;
    }

    .user-name {
        display: none;
    }
    .sidebar-close {
        display: block;
    }
}


        /* ── Main content ── */
        #main {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--bg);
        }
        /* Breadcrumb */
        #breadcrumb {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 14px 24px;
            border-bottom: 1px solid var(--border);
            background: var(--bg);
            flex-shrink: 0;
        }

        .breadcrumb-item {
            font-size: 13px;
            color: var(--text2);
            cursor: pointer;
            transition: color .15s;
        }

            .breadcrumb-item:hover {
                color: var(--text);
            }

            .breadcrumb-item.current {
                color: var(--text);
                font-weight: 600;
                cursor: default;
            }

        .breadcrumb-sep {
            color: var(--text3);
            font-size: 12px;
        }
        /* Toolbar */
        #toolbar {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 24px;
            flex-shrink: 0;
        }

        .toolbar-left {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .toolbar-right {
            margin-left: auto;
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .view-toggle {
            display: flex;
            background: var(--bg2);
            border: 1px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
        }

        .view-btn {
            padding: 6px 10px;
            cursor: pointer;
            color: var(--text3);
            border: none;
            background: none;
            display: flex;
            align-items: center;
            transition: all .15s;
        }

            .view-btn:hover {
                color: var(--text2);
                background: var(--bg3);
            }

            .view-btn.active {
                background: var(--bg4);
                color: var(--text);
            }

            .view-btn svg {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.8;
            }
        /* ── File grid ── */
        #content-area {
            flex: 1;
            overflow-y: auto;
            padding: 20px 24px;
        }

        .section-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: .08em;
            text-transform: uppercase;
            color: var(--text3);
            margin-bottom: 14px;
            margin-top: 8px;
        }
        /* Grid view */
        .files-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 28px;
        }

        .file-card {
            background: var(--bg2);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 16px;
            cursor: pointer;
            transition: all .2s;
            position: relative;
            group: true;
        }

            .file-card:hover {
                border-color: var(--border2);
                background: var(--bg3);
                transform: translateY(-2px);
                box-shadow: 0 8px 24px rgba(0,0,0,.3);
            }

        .file-card-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
        }

            .file-card-icon.folder {
                background: rgba(255,211,42,.08);
                border: 1px solid rgba(255,211,42,.15);
            }

            .file-card-icon.video {
                background: rgba(61,158,255,.08);
                border: 1px solid rgba(61,158,255,.15);
            }

            .file-card-icon svg {
                width: 22px;
                height: 22px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.5;
            }

            .file-card-icon.folder svg {
                stroke: var(--yellow);
            }

            .file-card-icon.video svg {
                stroke: var(--blue);
            }

        .file-card-name {
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 4px;
        }

        .file-card-meta {
            font-size: 11px;
            color: var(--text3);
            font-family: var(--mono);
        }

        .file-card-menu {
            position: absolute;
            top: 10px;
            right: 10px;
            opacity: 0;
            transition: opacity .15s;
        }

        .file-card:hover .file-card-menu {
            opacity: 1;
        }
        /* Status badges */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .05em;
            padding: 3px 8px;
            border-radius: 20px;
            margin-top: 6px;
        }

        .badge-processing {
            background: rgba(255,211,42,.1);
            color: var(--yellow);
            border: 1px solid rgba(255,211,42,.2);
        }

        .badge-ready {
            background: var(--green-dim);
            color: var(--green);
            border: 1px solid rgba(133,234,45,.2);
        }

        .badge-error {
            background: var(--red-dim);
            color: var(--red);
            border: 1px solid rgba(255,71,87,.2);
        }

.file-card-icon.pdf {
    color: #e74c3c;
}

        .badge::before {
            content: '';
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: currentColor;
        }

        .badge-processing::before {
            animation: blink 1.2s infinite;
        }

        @keyframes blink {
            0%,100% {
                opacity: 1
            }

            50% {
                opacity: .3
            }
        }
        /* List view */
        .files-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 28px;
        }

        .file-row {
            display: grid;
            grid-template-columns: 32px 1fr 120px 100px 36px;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: var(--radius);
            cursor: pointer;
            transition: background .15s;
        }

            .file-row:hover {
                background: var(--bg2);
            }

        .file-row-icon {
            width: 28px;
            height: 28px;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .file-row-icon.folder {
                background: rgba(255,211,42,.08);
            }

            .file-row-icon.video {
                background: rgba(61,158,255,.08);
            }

            .file-row-icon svg {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.8;
            }

            .file-row-icon.folder svg {
                stroke: var(--yellow);
            }

            .file-row-icon.video svg {
                stroke: var(--blue);
            }

        .file-row-name {
            font-size: 13px;
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-row-date {
            font-size: 11px;
            color: var(--text3);
            font-family: var(--mono);
        }

        .file-row-status {
        }

        .file-row-actions {
            opacity: 0;
        }

        .file-row:hover .file-row-actions {
            opacity: 1;
        }
        /* ── Empty state ── */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 80px 24px;
            text-align: center;
            color: var(--text3);
            gap: 12px;
        }

            .empty-state svg {
                width: 48px;
                height: 48px;
                stroke: var(--bg4);
                fill: none;
                stroke-width: 1;
                opacity: .6;
            }

            .empty-state h3 {
                font-size: 15px;
                color: var(--text2);
                font-weight: 600;
            }

            .empty-state p {
                font-size: 13px;
                max-width: 280px;
                line-height: 1.7;
            }
        /* ── Loading ── */
        .spinner-sm {
            width: 16px;
            height: 16px;
            border: 2px solid var(--bg4);
            border-top-color: var(--green);
            border-radius: 50%;
            animation: spin .65s linear infinite;
            flex-shrink: 0;
        }

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

        .loading-overlay {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 60px;
            gap: 12px;
            color: var(--text3);
            font-size: 13px;
        }
        /* ═══════════════════════════════════════════
           MODALS
        ═══════════════════════════════════════════ */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,.7);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
            padding: 24px;
            animation: fadeIn .2s;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
        }

        .modal {
            background: var(--bg2);
            border: 1px solid var(--border2);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 460px;
            box-shadow: 0 40px 100px rgba(0,0,0,.6);
            animation: modalIn .25s cubic-bezier(.22,1,.36,1);
        }

        @keyframes modalIn {
            from {
                opacity: 0;
                transform: scale(.95) translateY(10px);
            }
        }

        .modal-lg {
            max-width: 560px;
        }

        .modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px 0;
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -.01em;
        }

        .modal-close {
            width: 28px;
            height: 28px;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: 7px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text2);
            transition: all .15s;
        }

            .modal-close:hover {
                background: var(--bg4);
                color: var(--text);
            }

            .modal-close svg {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                fill: none;
                stroke-width: 2;
                stroke-linecap: round;
            }

        .modal-body {
            padding: 0 24px 20px;
        }

        .modal-footer {
            display: flex;
            gap: 10px;
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            justify-content: flex-end;
        }
        /* ── Upload modal ── */
        .upload-drop {
            border: 2px dashed var(--border2);
            border-radius: var(--radius);
            padding: 40px 24px;
            text-align: center;
            cursor: pointer;
            transition: all .2s;
            margin-bottom: 16px;
        }

            .upload-drop:hover, .upload-drop.dragover {
                border-color: var(--green-glow);
                background: var(--green-dim);
            }

            .upload-drop svg {
                width: 40px;
                height: 40px;
                stroke: var(--text3);
                fill: none;
                stroke-width: 1;
                margin-bottom: 12px;
            }

            .upload-drop p {
                color: var(--text2);
                font-size: 13px;
                line-height: 1.8;
            }

            .upload-drop strong {
                color: var(--green);
            }

            .upload-drop input {
                display: none;
            }

        .upload-file-preview {
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px 14px;
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

            .upload-file-preview svg {
                width: 20px;
                height: 20px;
                stroke: var(--blue);
                fill: none;
                stroke-width: 1.8;
                flex-shrink: 0;
            }

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

        .upload-file-name {
            font-size: 13px;
            font-weight: 600;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .upload-file-size {
            font-size: 11px;
            color: var(--text3);
            font-family: var(--mono);
            margin-top: 2px;
        }

        .upload-progress-wrap {
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            margin-bottom: 16px;
        }

        .upload-progress-bar {
            height: 4px;
            background: var(--bg4);
            border-radius: 4px;
            overflow: hidden;
            margin-top: 8px;
        }

        .upload-progress-fill {
            height: 100%;
            background: var(--green);
            border-radius: 4px;
            transition: width .3s;
            box-shadow: 0 0 8px var(--green-glow);
        }
        /* ── Context menu ── */
        .ctx-menu {
            position: fixed;
            background: var(--bg2);
            border: 1px solid var(--border2);
            border-radius: var(--radius);
            padding: 6px;
            z-index: 200;
            box-shadow: 0 16px 48px rgba(0,0,0,.5);
            min-width: 160px;
            animation: fadeIn .12s;
        }

        .ctx-item {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            color: var(--text2);
            transition: all .12s;
        }

            .ctx-item:hover {
                background: var(--bg3);
                color: var(--text);
            }

            .ctx-item.danger {
                color: var(--red);
            }

                .ctx-item.danger:hover {
                    background: var(--red-dim);
                }

            .ctx-item svg {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                fill: none;
                stroke-width: 1.8;
                stroke-linecap: round;
                flex-shrink: 0;
            }

        .ctx-divider {
            height: 1px;
            background: var(--border);
            margin: 4px 0;
        }
        /* ── Access modal ── */
        .access-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 240px;
            overflow-y: auto;
            margin-bottom: 16px;
        }

        .access-row {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 10px 12px;
        }

        .access-avatar {
            width: 30px;
            height: 30px;
            background: var(--bg4);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            color: var(--text2);
            flex-shrink: 0;
        }

        .access-email {
            flex: 1;
            font-size: 12px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* ── Tags input ── */
        .tags-input-wrap {
            background: var(--bg3);
            border: 1px solid var(--border2);
            border-radius: var(--radius);
            padding: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            min-height: 44px;
            cursor: text;
            transition: border-color .2s;
        }

            .tags-input-wrap:focus-within {
                border-color: rgba(133,234,45,.4);
                box-shadow: 0 0 0 3px rgba(133,234,45,.08);
            }

        .tag-chip {
            display: flex;
            align-items: center;
            gap: 5px;
            background: var(--green-dim);
            border: 1px solid rgba(133,234,45,.2);
            border-radius: 6px;
            padding: 3px 8px;
            font-size: 12px;
            color: var(--green);
        }

        .tag-chip-remove {
            cursor: pointer;
            color: var(--green);
            opacity: .6;
            font-size: 14px;
            line-height: 1;
            font-weight: 700;
        }

            .tag-chip-remove:hover {
                opacity: 1;
            }

        .tags-input-wrap input {
            border: none;
            outline: none;
            background: none;
            color: var(--text);
            font-family: var(--font);
            font-size: 13px;
            min-width: 150px;
            flex: 1;
            padding: 2px 4px;
        }

            .tags-input-wrap input::placeholder {
                color: var(--text3);
            }
        /* ── Toast ── */
        #toast-container {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 300;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: none;
        }

        .toast {
            background: var(--bg2);
            border: 1px solid var(--border2);
            border-radius: var(--radius);
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            box-shadow: 0 8px 32px rgba(0,0,0,.4);
            animation: toastIn .3s cubic-bezier(.22,1,.36,1);
            pointer-events: all;
            min-width: 240px;
            max-width: 340px;
        }

        .toast-success {
            border-left: 3px solid var(--green);
        }

        .toast-error {
            border-left: 3px solid var(--red);
        }

        .toast svg {
            width: 16px;
            height: 16px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            flex-shrink: 0;
        }

        .toast-success svg {
            stroke: var(--green);
        }

        .toast-error svg {
            stroke: var(--red);
        }

        .toast-out {
            animation: toastOut .3s forwards;
        }

        @keyframes toastIn {
            from {
                opacity: 0;
                transform: translateX(20px);
            }
        }

        @keyframes toastOut {
            to {
                opacity: 0;
                transform: translateX(20px);
            }
        }
        /* ═══════════════════════════════════════════
           VIDEO PLAYER MODAL
        ═══════════════════════════════════════════ */
        #player-modal .modal {
            max-width: 720px;
        }

        .player-modal-video {
            background: #000;
            aspect-ratio: 16/9;
            width: 100%;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
            position: relative;
        }

            .player-modal-video video {
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        /* ═══════════════════════════════════════════
           CONFIRM MODAL
        ═══════════════════════════════════════════ */
        .confirm-icon {
            width: 48px;
            height: 48px;
            background: var(--red-dim);
            border: 1px solid rgba(255,71,87,.2);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 16px;
        }

            .confirm-icon svg {
                width: 24px;
                height: 24px;
                stroke: var(--red);
                fill: none;
                stroke-width: 1.8;
  
                }


.upload-floating-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 0.5px solid rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 320px;
    z-index: 9999;
}