/* === BELLA OBSIDIAN Dashboard — Purple/Black/White/Red === */

:root {
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --purple-dark: #6d28d9;
    --purple-bg: #f5f3ff;
    --red: #ef4444;
    --red-light: #fca5a5;
    --black: #0f0f0f;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

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

body {
    font-family: var(--font-main);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, var(--black) 0%, var(--purple-dark) 100%);
    color: var(--white);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--white);
    letter-spacing: -0.02em;
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    background: rgba(255,255,255,0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    backdrop-filter: blur(4px);
}

.btn-outline {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.35rem 1rem;
    border-radius: 8px;
    color: var(--white);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* === KPI Cards === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.kpi-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--gray-100);
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--black);
    line-height: 1.1;
    font-family: var(--font-mono);
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

/* === Cards === */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--purple-bg);
}

/* === Charts === */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* === Tag Cloud === */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
}

.tag-item {
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: default;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.tag-item:hover { opacity: 0.7; }
.tag-item sup {
    font-size: 0.6em;
    opacity: 0.5;
    margin-left: 1px;
}

/* === Table === */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--purple-bg);
}

.category-badge {
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--gray-600);
    white-space: nowrap;
}

.tag-badge {
    display: inline-block;
    background: var(--purple-bg);
    color: var(--purple);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 500;
    margin: 0.1rem;
}

.date-cell {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* === Sync Timeline === */
.sync-timeline { padding: 0.5rem 0; }

.sync-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    align-items: flex-start;
}

.sync-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    background: var(--purple);
    border-radius: 50%;
    margin-top: 0.35rem;
}

.sync-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

.sync-stats {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.sync-stats strong { color: var(--purple); }
.sync-stats .warn { color: var(--red); font-weight: 600; }

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 2rem;
    font-style: italic;
}

/* === Footer === */
.footer {
    background: var(--black);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.8rem;
}
.footer strong { color: var(--purple-light); }
.footer-sub {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.5;
}

/* === Responsive === */
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; text-align: center; }
    .header-actions { justify-content: center; }
    .kpi-value { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .kpi-card { padding: 0.75rem; }
    .kpi-value { font-size: 1.3rem; }
    .card { padding: 1rem; }
    .container { padding: 0 0.75rem; }
    .data-table { font-size: 0.75rem; }
}
