:root {
    /* Colors */
    --bg-body: #050505;
    --bg-card: #0f0f11;
    --bg-card-hover: #18181b;
    --bg-input: #0a0a0a;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    --border-color: #27272a;
    --border-hover: #3f3f46;
    
    --primary-color: #22d3ee; /* Bright Cyan */
    --primary-hover: #06b6d4;
    --secondary-color: #a855f7; /* Bright Purple */
    --accent-color: #3b82f6; /* Blue */
    --danger-color: #ef4444;
    --success-color: #10b981;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mt-lg { margin-top: var(--spacing-lg); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: 'JetBrains Mono', monospace; }

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

.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: var(--spacing-xl);
    width: calc(100% - 280px);
    max-width: 1600px;
}

/* Logo & Branding */
.brand-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

.logo-icon::before {
    content: "C";
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

/* User Profile in Sidebar */
.user-profile {
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3f3f46, #27272a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, border-color 0.2s;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hover);
}

.card.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

/* Upload Area */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    background: rgba(24, 24, 27, 0.5);
    transition: all 0.2s;
    cursor: pointer;
}

.dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(6, 182, 212, 0.05);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

/* Data Visualization */
.stat-card {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: var(--spacing-sm);
}
.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.stat-change {
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.chart-container {
    height: 300px;
    width: 100%;
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

/* Mock Bars for Charts */
.chart-bar {
    width: 12%;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 4px 4px 0 0;
    transition: height 1s ease-out;
    opacity: 0.8;
}
.chart-bar:hover { opacity: 1; }

/* Mock Line Chart */
.chart-line-svg {
    width: 100%;
    height: 100%;
}
.chart-path {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--primary-color));
}

/* Table */
.table-container {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.table th, .table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
    padding: 4px 8px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-primary { background: rgba(6, 182, 212, 0.2); color: var(--primary-color); }
.badge-secondary { background: rgba(139, 92, 246, 0.2); color: var(--secondary-color); }
.badge-muted { background: rgba(113, 113, 122, 0.2); color: var(--text-muted); }

/* History List */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.history-item:hover { background: rgba(255,255,255,0.02); }
.history-item:last-child { border-bottom: none; }
.file-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-right: var(--spacing-md);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .app-layout { flex-direction: column; }
    .sidebar { 
        position: relative; 
        width: 100%; 
        height: auto; 
        border-right: none; 
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing-md);
    }
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: var(--spacing-md);
    }
    .brand-container { margin-bottom: var(--spacing-md); padding-bottom: 0; border: none; }
    .nav-menu { flex-direction: row; overflow-x: auto; padding-bottom: var(--spacing-sm); }
    .nav-link { white-space: nowrap; padding: var(--spacing-sm) var(--spacing-md); }
    .user-profile { display: none; }
    h1 { font-size: 1.75rem; }
}

/* Auth Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #111113 0%, #000000 100%);
    position: relative;
    overflow: hidden;
    padding: var(--spacing-md);
}

.auth-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.05) 30%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    background: rgba(24, 24, 27, 0.9);
    padding: 0 !important; /* Remove padding to allow header to be full width */
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
    text-align: center;
    position: relative;
}

.auth-header h1, .auth-header .logo-text {
    color: white !important;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.auth-body {
    padding: 32px;
}

/* PDF Report Styles */
.paper {
    background: white;
    color: #000;
    width: 100%;
    max-width: 800px;
    min-height: 1000px;
    margin: 0 auto;
    padding: 48px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    position: relative;
}
.paper h1 { color: #000; margin-bottom: 24px; }
.paper h2 { color: #333; font-size: 1.5rem; margin-top: 32px; margin-bottom: 16px; border-bottom: 2px solid #eee; padding-bottom: 8px;}
.paper p { color: #444; margin-bottom: 16px; }
.paper-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.paper-table th { text-align: left; border-bottom: 2px solid #000; padding: 8px; font-weight: bold; }
.paper-table td { border-bottom: 1px solid #ddd; padding: 8px; color: #333; }
.paper-chart-placeholder {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-bottom: 24px;
}

/* Brand Assets Page */
.logo-display-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.05) 0%, rgba(0,0,0,0) 70%);
    border-bottom: 1px solid var(--border-color);
}

.logo-icon-lg {
    width: 120px;
    height: 120px;
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.logo-icon-lg::before {
    font-size: 3.5rem;
}

.color-swatch {
    height: 100px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    position: relative;
}

.color-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: transform 0.2s;
}

.color-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}
