/* ══════════════════════════════════════════════
   Cloud167 — Design System
   Modern, Premium, Glassmorphism UI
   ══════════════════════════════════════════════ */

/* ─── CSS Variables ────────────────────────── */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242833;
    --bg-card: rgba(26, 29, 39, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f3f5;
    --text-secondary: #8b8fa3;
    --text-muted: #5c6073;

    --accent-primary: #6366f1;
    --accent-primary-glow: rgba(99, 102, 241, 0.3);
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --accent-info: #06b6d4;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-primary-glow);

    --sidebar-width: 260px;
    --topbar-height: 64px;

    --transition: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-secondary); }

img { max-width: 100%; height: auto; }

/* ─── Layout ───────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 10px; }

.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}
.logo-icon svg { width: 20px; height: 20px; }

.logo-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-primary);
}
.logo-text strong { font-weight: 700; }

.sidebar-toggle {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.sidebar-header .sidebar-toggle { display: none; }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text-primary); background: var(--bg-glass-hover); }
.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: var(--shadow-glow);
}

.nav-divider { height: 1px; background: var(--border-color); margin: 12px 14px; }
.nav-label {
    padding: 4px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

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

.user-info {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; margin-bottom: 4px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

.logout-btn { color: var(--accent-danger) !important; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.1) !important; }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    position: sticky; top: 0;
    height: var(--topbar-height);
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px; gap: 16px;
    z-index: 50;
}
.topbar .sidebar-toggle { display: none; }

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
}

.topbar-actions { display: flex; gap: 8px; }

.page-content { padding: 24px; max-width: 1200px; }

/* ─── Buttons ──────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 10px var(--accent-primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-primary-glow);
}

.btn-ghost {
    background: transparent; color: var(--accent-primary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover { background: var(--bg-glass-hover); border-color: var(--accent-primary); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; width: 100%; justify-content: center; }

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition);
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.btn-icon.btn-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); border-color: var(--accent-danger); }

/* ─── Cards ────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition);
}
.stat-card:hover { border-color: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent, var(--accent-primary)) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent, var(--accent-primary));
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stats-grid-sm { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.category-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 12px; gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    text-align: center;
}
.category-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-primary-glow);
}
.category-icon { color: var(--accent-primary); }
.category-icon svg { width: 28px; height: 28px; }
.category-name { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }

/* File Grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 32px; }

.file-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.file-card:hover { border-color: rgba(255, 255, 255, 0.1); }

.file-icon {
    width: 40px; height: 40px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}
.file-icon svg { width: 18px; height: 18px; }

.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 0.75rem; color: var(--text-muted); }

.file-actions { display: flex; gap: 4px; }

/* ─── Tables ───────────────────────────────── */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: auto;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-glass-hover); }

.file-name-cell { display: flex; align-items: center; gap: 8px; }
.file-name-cell svg { width: 16px; height: 16px; color: var(--accent-primary); flex-shrink: 0; }

.action-btns { display: flex; gap: 4px; }

.user-cell { display: flex; align-items: center; gap: 8px; }
.user-avatar-sm { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }

/* ─── Badges ───────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); border-color: rgba(99, 102, 241, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); border-color: rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); border-color: rgba(239, 68, 68, 0.3); }

/* ─── Forms ────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-primary-glow); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-select-sm { padding: 5px 30px 5px 10px; font-size: 0.78rem; width: auto; }

/* Filter Bar */
.filter-bar { margin-bottom: 20px; }
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.filter-form .form-select, .filter-form .form-input { width: auto; min-width: 150px; }

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search-box input { padding-left: 36px; width: 100%; }

/* ─── Upload / Dropzone ────────────────────── */
.upload-container { max-width: 600px; }

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 30px var(--accent-primary-glow);
}

.dropzone-icon { margin-bottom: 16px; color: var(--accent-primary); }
.dropzone-icon svg { width: 48px; height: 48px; }
.dropzone-text { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 6px; }
.dropzone-link { color: var(--accent-primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.dropzone-hint { font-size: 0.78rem; color: var(--text-muted); }
.file-input { display: none; }

.file-preview {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}
.preview-info { display: flex; align-items: center; gap: 12px; }
.preview-info svg { color: var(--accent-primary); width: 24px; height: 24px; }
.preview-name { display: block; font-weight: 600; font-size: 0.9rem; }
.preview-size { font-size: 0.78rem; color: var(--text-muted); }

.upload-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.progress-bar { flex: 1; height: 6px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); border-radius: var(--radius-full); transition: width 0.3s; width: 0; }
.progress-text { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); min-width: 36px; }

/* ─── Activity Timeline ────────────────────── */
.activity-list { margin-bottom: 32px; }
.activity-item {
    display: flex; gap: 12px;
    padding: 10px 0;
    position: relative;
}
.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px; top: 28px; bottom: -4px;
    width: 2px;
    background: var(--border-color);
}
.activity-dot {
    width: 12px; height: 12px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 4px;
}
.activity-content { flex: 1; }
.activity-action { display: block; font-size: 0.88rem; color: var(--text-secondary); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Section Headers ──────────────────────── */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-header h2 { font-size: 1.05rem; font-weight: 600; }

/* ─── Empty State ──────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }
.empty-state a { color: var(--accent-primary); font-weight: 600; }

/* ─── Alerts ───────────────────────────────── */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; margin: 0 24px 0;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    animation: slideDown 0.3s ease;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert span { flex: 1; }
.alert-close {
    background: none; border: none; color: inherit; cursor: pointer; opacity: 0.7;
    padding: 4px;
}
.alert-close:hover { opacity: 1; }
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* ─── Toast Notification ───────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideUp 0.3s ease;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}
.toast-success { background: var(--accent-success); color: white; }
.toast-error { background: var(--accent-danger); color: white; }

/* ─── Profile ──────────────────────────────── */
.profile-container { max-width: 700px; }

.profile-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary-glow);
}
.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-email { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 6px; }

/* ─── Pagination ───────────────────────────── */
.pagination-wrapper { display: flex; justify-content: center; padding: 16px 0; }
.pagination-wrapper ul { display: flex; gap: 4px; list-style: none; }
.pagination-wrapper li a, .pagination-wrapper li span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.pagination-wrapper li a:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.pagination-wrapper li.active span {
    background: var(--accent-primary); color: white; border-color: var(--accent-primary);
}

/* ─── Login Page ───────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    position: relative;
}

.login-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: url('../img/bg-login.jpg') center/cover no-repeat;
}
.login-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(15, 17, 23, 0.85), rgba(26, 29, 39, 0.8));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.bg-circle { display: none; }
.bg-circle-1 { width: 500px; height: 500px; background: var(--accent-primary); top: -10%; right: -10%; }
.bg-circle-2 { width: 400px; height: 400px; background: var(--accent-secondary); bottom: -10%; left: -10%; animation-delay: -7s; }
.bg-circle-3 { width: 300px; height: 300px; background: var(--accent-info); top: 40%; left: 50%; animation-delay: -14s; }

.login-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    text-align: center;
    z-index: 1;
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 36px;
    box-shadow: var(--shadow-lg);
}

.login-logo { margin-bottom: 20px; }
.logo-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: var(--shadow-glow);
}

.login-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 1rem; color: var(--accent-primary); font-weight: 600; margin-bottom: 12px; }
.login-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 28px; line-height: 1.5; }

.login-alert {
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-danger);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: white;
    color: #333;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #333;
}

.login-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 20px; line-height: 1.6; }
.login-note strong { color: var(--text-secondary); }

.login-footer {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
/* ─── Modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

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

/* ─── Animations ───────────────────────────── */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(-10px); }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

/* ─── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-header .sidebar-toggle { display: flex; }
    .topbar .sidebar-toggle { display: flex; }

    .main-content { margin-left: 0; }
    .page-content { padding: 16px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .file-grid { grid-template-columns: 1fr; }

    .filter-form { flex-direction: column; }
    .filter-form .form-select, .filter-form .form-input, .search-box { width: 100%; min-width: 0; }

    .profile-header { flex-direction: column; text-align: center; }

    .topbar-actions .btn span { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }

    .login-card { padding: 36px 24px; }
    .login-title { font-size: 1.5rem; }

    .data-table { font-size: 0.8rem; }
    .data-table thead th, .data-table tbody td { padding: 8px 10px; }
}
