:root {
    /* Dark Theme (Default) */
    --bg-main: #020617;
    --bg-sidebar: #0b0f1a;
    --bg-card: rgba(15, 23, 42, 0.7);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(0, 0, 0, 0.05);
}

:root {
    --success: #10b981;
    --error: #ef4444;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 48px;
    padding-left: 12px;
}

.logo i {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
}

.nav-section {
    margin-bottom: 32px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.menu-item i {
    width: 18px;
    transition: var(--transition);
}

.menu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.menu-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

.profile-actions {
    display: none;
    gap: 6px;
    margin-left: auto;
}

.menu-item:hover .profile-actions {
    display: flex;
}

.btn-sidebar-add {
    width: 100%;
    margin-bottom: 32px;
    justify-content: center;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 48px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-muted);
}

/* --- Dashboard --- */
.dashboard {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.dashboard.active { display: block; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 32px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
}

.stat-value {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.stat-label {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
}

.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.quick-action-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.2), 0 0 16px var(--accent-glow);
}

/* --- File Browser --- */
.browser-view {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
}

.browser-view.active { display: flex; }

.browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.breadcrumbs {
    padding: 16px 24px;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

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

/* --- Table --- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 16px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: var(--transition);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.file-item i {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.file-item i.folder { color: #fbbf24; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    padding: 10px;
    border-radius: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transform: translateY(-1px);
}

.icon-btn i {
    width: 16px;
    height: 16px;
}

/* --- Dropdown Menu --- */
.dropdown-menu {
    position: absolute;
    right: 24px;
    top: 60px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    min-width: 200px;
    overflow: hidden;
    z-index: 200;
    padding: 8px;
}

.dropdown-menu.active { display: flex; }

.dropdown-item {
    padding: 10px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-item.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-premium);
}

.modal h2 {
    font-size: 24px;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

/* --- Form Elements --- */
.form-group { margin-bottom: 24px; }

label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 15px;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- Progress Bar --- */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--accent);
}

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

.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Utility */
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-32 { margin-top: 32px; }
.clickable { cursor: pointer; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
