:root {
    --bg-primary: #08090a;
    --bg-secondary: #111214;
    --bg-tertiary: #1a1b1e;
    --bg-card: #131417;
    --border-color: #1f2128;
    --border-hover: #2d2f3a;
    --text-primary: #f0f0f2;
    --text-secondary: #6b7084;
    --text-muted: #454858;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-emerald: #34d399;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Glass Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: var(--border-hover);
}

/* Hero KPI Cards - Large */
.kpi-hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(19, 20, 23, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.kpi-hero:hover {
    border-color: var(--accent-color, var(--accent-blue));
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-color, var(--accent-blue));
}

.kpi-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color, var(--accent-blue)), transparent);
    border-radius: 20px 20px 0 0;
}

.kpi-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-color, var(--accent-blue)) 0%, transparent 70%);
    opacity: 0.04;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.kpi-hero .value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

/* Small KPI Cards */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.875rem 1rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.kpi-card:hover {
    border-color: var(--accent-color, var(--accent-blue));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color, var(--accent-blue));
    border-radius: 14px 14px 0 0;
}

/* Static KPI */
.kpi-static {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.875rem 1rem;
    position: relative;
    overflow: hidden;
}

.kpi-static::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color, var(--accent-blue));
    border-radius: 14px 14px 0 0;
}

/* File status dots */
.file-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s ease;
}

.file-dot.loaded {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.file-upload-compact {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.file-upload-compact:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.04);
}

.file-upload-compact.has-file {
    border-color: var(--accent-green);
    border-style: solid;
    background: rgba(16, 185, 129, 0.04);
}

/* Tab buttons */
.tab-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Input */
.input-field {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.2s;
    font-size: 0.875rem;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: var(--bg-tertiary);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table td {
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Modal */
.modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* Debug */
.debug-console {
    background: #0a0a0a;
    border-top: 1px solid var(--border-color);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    display: none !important;
}

/* Signature */
.signature {
    position: fixed;
    bottom: 12px;
    right: 16px;
    text-align: right;
    font-size: 10px;
    color: #333;
    z-index: 100;
    pointer-events: none;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.35s ease-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.loading-pulse {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* Two-column layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}