:root {
    --bg-body: #09090b;
    --bg-surface: #18181b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent-primary: #a3e635; /* Lime/green */
    --accent-purple: #c084fc;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --nav-height: 72px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(163, 230, 53, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(192, 132, 252, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

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

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
}

/* Typography Gradient */
.text-gradient {
    background: linear-gradient(135deg, #a3e635, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 4px 14px 0 rgba(163, 230, 53, 0.39);
}

.btn-primary:hover {
    background: #bbf7d0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 230, 53, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.1);
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.25rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* App Layout Structure */
.app-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-height));
}

.sidebar {
    width: 260px;
    background: rgba(24, 24, 27, 0.4);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(163, 230, 53, 0.1);
    color: var(--accent-primary);
}

.main-content {
    flex: 1;
    min-width: 0; /* important for preventing flex blowouts */
}

/* Custom Table for Dashboard */
table {
    border-spacing: 0;
}

table th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Upload UI Enhancements */
#upload-box:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(163, 230, 53, 0.02) !important;
}

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

.glass-panel {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-item {
        white-space: nowrap;
        margin-bottom: 0;
        margin-right: 8px;
    }
    
    .navbar {
        padding: 0 16px;
    }
    
    table thead {
        display: none;
    }
    
    table, table tbody, table tr, table td {
        display: block;
        width: 100%;
    }
    
    table tr {
        margin-bottom: 16px;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px;
        padding: 16px;
    }
    
    table td {
        padding: 8px 0 !important;
        text-align: left !important;
    }
}
