:root {
    --bg-color: #1a1514;
    --bg-gradient: linear-gradient(135deg, #1c1512 0%, #000000 100%);
    --card-bg: rgba(67, 30, 20, 0.4);
    --border-color: rgba(255, 120, 80, 0.15);
    --text-primary: #fff7ed;
    --text-secondary: #fed7aa;
    --accent-red: #ea580c;
    --accent-blue: #f97316;
    --accent-purple: #ef4444;
    --accent-cyan: #fbbf24;
    --font-family: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fb923c, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
}

.date-badge {
    margin-left: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    border: none;
    outline: none;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
}

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

.btn.outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.card-content h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out;
}

.chart-container {
    padding: 1.5rem;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Table Section */
.table-section {
    padding: 1.5rem;
    animation: fadeInUp 1.2s ease-out;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-filters {
    display: flex;
    gap: 1rem;
}

input, select {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

input {
    width: 250px;
}

select {
    cursor: pointer;
}

option {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Drilldown UI */
.drilldown-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.accordion-item {
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.accordion-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    display: none;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.accordion-item.active > .accordion-content {
    display: block;
}

.accordion-item.active > .accordion-header {
    background: rgba(249, 115, 22, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.level-1 > .accordion-header { font-weight: 700; color: var(--accent-cyan); font-size: 1.1rem; }
.level-2 > .accordion-header { font-weight: 600; color: #fca5a5; font-family: monospace; font-size: 0.95rem; line-height: 1.4; word-break: break-all; }
.level-3 > .accordion-header { font-weight: 600; color: var(--text-primary); }
.level-4 > .accordion-header { font-weight: 500; color: var(--text-secondary); }

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.task-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.badge-count {
    background: var(--accent-purple);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.accordion-item.active > .accordion-header .accordion-icon {
    transform: rotate(90deg);
}

.hash-key {
    font-family: monospace;
    color: #fdba74;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    input {
        width: 100%;
    }
}
