@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --primary: #8B5CF6; /* Violet */
    --primary-hover: #A855F7;
    --secondary: #06B6D4; /* Cyan */
    --accent: #EC4899; /* Pink */
    
    --bg-dark: #09090B; /* Deep Obsidian */
    --bg-panel: rgba(24, 24, 27, 0.65); /* Glass Base */
    --bg-glass-light: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --danger: #F43F5E;
    --warning: #F59E0B;
    --success: #10B981;
    
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Beautiful Aurora Background Gradients */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

body::before {
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
}

body::after {
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), transparent 70%);
}

h1, h2, h3, h4, h5, h6, .brand h2 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(24, 24, 27, 0.4) 0%, rgba(9, 9, 11, 0.8) 100%);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
    padding: 0 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 1rem 1.25rem;
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
    opacity: 0.7;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-main);
    border-color: rgba(255,255,255,0.05);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), transparent);
    color: var(--text-main);
    border-left: 3px solid var(--primary);
    border-radius: 4px 12px 12px 4px;
}

.nav-btn.active svg {
    color: var(--primary);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 3rem 4rem;
    overflow-y: auto;
    position: relative;
    z-index: 5;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 5rem 2rem;
    text-align: center;
    background: rgba(139, 92, 246, 0.03);
    transition: var(--transition);
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--primary-hover);
}

.upload-zone h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.5);
}

/* File List Array */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.file-item:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255,255,255,0.15);
}
.file-item-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

/* Review Section */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.actions-group {
    display: flex;
    gap: 1rem;
}

/* Beautiful Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
}

.card:hover::before {
    opacity: 1;
}

.card h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

/* Smart Insights Panel */
.smart-insights .card {
    flex: 1 1 300px;
    border-left: 4px solid var(--primary);
}

.smart-insights .card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-transform: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.smart-insights .card p {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.smart-insights .card p strong {
    color: var(--text-main);
    font-weight: 500;
}

/* Data Table (Airtable / Notion Style) */
.tabs-container {
    background: var(--bg-panel);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.table-container {
    overflow-x: auto;
    max-height: 55vh;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ai-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
    white-space: nowrap;
}

.ai-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    border-right: 1px solid rgba(255,255,255,0.02);
    transition: background 0.2s;
}

.ai-table td:last-child {
    border-right: none;
}

.ai-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.ai-table .editable-cell {
    outline: none;
    cursor: text;
}
.ai-table .editable-cell:focus {
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed var(--primary);
    border-radius: 4px;
}

.p-total-highlight {
    font-weight: 600;
    color: var(--secondary);
}

/* Skeleton Loading Animation */
.ai-loading {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

.loader-pulse {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
}

.loader-pulse::before, .loader-pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 3px solid var(--primary);
    animation: pulsate 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.loader-pulse::after {
    animation-delay: 1s;
    border-color: var(--accent);
}

@keyframes pulsate {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* History List Item */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.history-item:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
}

.history-info h3 {
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.25rem;
}

.history-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-tech { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.badge-admin { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }
.badge-fin { background: rgba(6, 182, 212, 0.15); color: #22D3EE; }

.score-high { color: #22D3EE; font-weight: 600; }

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
