:root {
    --bg-dark: #0a0b10;
    --card-bg: #151821;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #2d313e;
    --success: #10b981;
    --error: #ef4444;
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #0d0f17;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(0.95); opacity: 0.7; }
    70% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Main Content */
.content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}

.top-bar {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-value.small { font-size: 1.2rem; }

.stat-change {
    font-size: 0.8rem;
}

.positive { color: var(--success); }

/* Upload View */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

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

.drop-zone {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    cursor: pointer;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.drop-icon {
    width: 60px;
    height: 60px;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Forms & UI Elements */
.sleek-select {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    width: 300px;
    font-family: inherit;
    outline: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.secondary {
    background: #2d313e;
    color: var(--text-primary);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    width: 450px;
}

.hidden { display: none !important; }

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    background: #0a0b10;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: white;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.log-container {
    background: #0d0f17;
    border-radius: 12px;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
}

.log-entry {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.log-time { color: var(--text-secondary); margin-right: 1rem; }
.log-msg { color: var(--text-primary); }

.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

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

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { color: var(--text-secondary); font-weight: 600; }
