/* ============================================
   DocVault — Futuristic Dark Glassmorphic UI
   ============================================ */

:root {
    --bg-primary: #06060f;
    --bg-secondary: #0c0c1e;
    --bg-card: rgba(15, 15, 35, 0.65);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-glass-active: rgba(255, 255, 255, 0.12);
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #e8e8f0;
    --text-secondary: rgba(232, 232, 240, 0.55);
    --text-muted: rgba(232, 232, 240, 0.35);
    
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-light: #a29bfe;
    --accent-secondary: #00cec9;
    --accent-secondary-glow: rgba(0, 206, 201, 0.3);
    
    --danger: #ff6b6b;
    --danger-glow: rgba(255, 107, 107, 0.3);
    --success: #00e676;
    --warning: #ffd93d;
    
    --icon-pdf: #ff6b6b;
    --icon-doc: #4fc3f7;
    --icon-xls: #66bb6a;
    --icon-ppt: #ff8a65;
    --icon-img: #ba68c8;
    --icon-zip: #ffd54f;
    --icon-folder: #ffd93d;
    
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    
    --glass-blur: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

input, select, button, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Honeypot (hidden from users, visible to bots)
   ============================================ */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(108, 92, 231, 0.06) 0%, transparent 50%);
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 8s ease-in-out infinite;
}
.login-orb-1 {
    width: 300px; height: 300px;
    background: rgba(108, 92, 231, 0.15);
    top: 10%; left: 10%;
    animation-duration: 10s;
}
.login-orb-2 {
    width: 200px; height: 200px;
    background: rgba(0, 206, 201, 0.12);
    top: 60%; right: 15%;
    animation-duration: 12s;
    animation-delay: -3s;
}
.login-orb-3 {
    width: 250px; height: 250px;
    background: rgba(108, 92, 231, 0.1);
    bottom: 10%; left: 40%;
    animation-duration: 9s;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    33% { transform: translateY(-20px) scale(1.05); }
    66% { transform: translateY(15px) scale(0.95); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    box-shadow:
        0 0 80px rgba(108, 92, 231, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: var(--radius);
    font-size: 28px;
    color: #fff;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.login-form {
    text-align: left;
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group label i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(232,232,240,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(108, 92, 231, 0.45);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}
.btn-glass:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-hover);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--danger);
}
.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.btn-block {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Alert ---- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

.alert-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: var(--success);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--border-glass);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-logo i {
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.72rem;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.sidebar-nav li a.active {
    background: var(--bg-glass-active);
    color: var(--accent-light);
    font-weight: 500;
}

.sidebar-nav li a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 30% 10%, rgba(108, 92, 231, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 206, 201, 0.03) 0%, transparent 50%);
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ---- Content ---- */
.content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stat-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
}
.stat-card:nth-child(2) .stat-icon {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-secondary);
}
.stat-card:nth-child(3) .stat-icon {
    background: rgba(255, 217, 61, 0.12);
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    margin-bottom: 20px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.search-form input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
}
.search-clear:hover {
    color: var(--text-primary);
}

/* ============================================
   ACTION BAR
   ============================================ */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ---- Breadcrumb ---- */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.breadcrumb-item {
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.breadcrumb-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}
.breadcrumb-item.active {
    color: var(--accent-light);
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-glass);
}

.section-title i {
    font-size: 0.9rem;
}

/* ============================================
   FOLDERS GRID
   ============================================ */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.folder-card:hover {
    border-color: var(--border-glass-hover);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.12);
}

.folder-icon {
    font-size: 1.6rem;
    color: var(--icon-folder);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(255, 217, 61, 0.2));
}

.folder-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.folder-name {
    font-weight: 500;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.folder-action {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0;
}

.folder-card:hover .folder-action {
    opacity: 1;
}

.folder-action:hover {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

/* ============================================
   DOCUMENTS LIST
   ============================================ */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.document-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.document-card:hover {
    border-color: var(--border-glass-hover);
    background: var(--bg-glass-hover);
}

.doc-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.doc-icon.pdf { background: rgba(255, 107, 107, 0.12); color: var(--icon-pdf); }
.doc-icon.doc, .doc-icon.docx { background: rgba(79, 195, 247, 0.12); color: var(--icon-doc); }
.doc-icon.xls, .doc-icon.xlsx { background: rgba(102, 187, 106, 0.12); color: var(--icon-xls); }
.doc-icon.ppt, .doc-icon.pptx { background: rgba(255, 138, 101, 0.12); color: var(--icon-ppt); }
.doc-icon.jpg, .doc-icon.jpeg, .doc-icon.png, .doc-icon.gif, .doc-icon.webp, .doc-icon.svg {
    background: rgba(186, 104, 200, 0.12); color: var(--icon-img);
}
.doc-icon.zip, .doc-icon.rar { background: rgba(255, 213, 79, 0.12); color: var(--icon-zip); }
.doc-icon.user-icon { background: rgba(108, 92, 231, 0.15); color: var(--accent-light); }

.doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.doc-name {
    font-weight: 500;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.doc-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.doc-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.doc-btn-danger:hover {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-glass);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.06);
    box-shadow: 0 0 40px var(--accent-glow);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--accent-light);
    display: block;
    margin-bottom: 12px;
}

.upload-zone h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-zone p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.72rem !important;
    color: var(--text-muted) !important;
    margin-top: 8px;
}

.upload-section {
    margin-bottom: 24px;
}

.upload-progress-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.upload-progress-item .progress-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-item .progress-status {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.upload-progress-item .progress-status.success {
    color: var(--success);
}

.upload-progress-item .progress-status.error {
    color: var(--danger);
}

.upload-progress-item .progress-bar-wrap {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-item .progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-glass);
}

/* ============================================
   ADMIN TABS
   ============================================ */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    margin-bottom: -1px;
}
.admin-tab:hover {
    color: var(--text-primary);
}
.admin-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    pointer-events: all;
    animation: toastIn 0.3s ease-out;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

.toast i { font-size: 1rem; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--accent-light); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

/* ============================================
   UTILITIES
   ============================================ */
.d-desktop {
    display: inline;
}

/* ============================================
   RESPONSIVE — MOBILE FIRST
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .content {
        padding: 16px;
    }
    
    .topbar {
        padding: 0 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px 16px;
    }
    
    .folders-grid {
        grid-template-columns: 1fr;
    }
    
    .document-card {
        padding: 12px 14px;
    }
    
    .doc-actions {
        gap: 2px;
    }
    
    .doc-btn {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
    }
    
    .btn-text {
        display: none;
    }
    
    .action-bar {
        gap: 8px;
    }
    
    .breadcrumb-nav {
        font-size: 0.78rem;
    }
    
    .d-desktop {
        display: none;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .upload-zone {
        padding: 28px 16px;
    }
    
    .modal-card {
        max-width: 100%;
    }
    
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 16px;
        right: 16px;
    }
    
    .toast {
        max-width: 100%;
    }
    
    .folder-action {
        opacity: 1;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .doc-info .doc-name {
        max-width: 140px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .folders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ANIMATED GLOW (subtle)
   ============================================ */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow); }
}

.login-logo {
    animation: glowPulse 4s ease-in-out infinite;
}

/* Scan line effect on login page */
.login-page::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.003) 2px,
        rgba(255, 255, 255, 0.003) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.login-container {
    z-index: 1;
}
