:root {
    --gy-primary: #7c3aed;
    --gy-info: #a855f7;
    --gy-success: #16a34a;
    --gy-danger: #dc4c64;
    --gy-warning: #f59e0b;
    --gy-surface: #ffffff;
    --gy-surface-soft: rgba(255, 255, 255, 0.82);
    --gy-text: #1e1030;
    --gy-text-soft: #6b5a8a;
    --gy-border: rgba(124, 58, 237, 0.14);
}

html, body { font-family: "Inter", "Segoe UI", system-ui, sans-serif; color: var(--gy-text); margin: 0; }

body {
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.1), transparent 24%),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.06), transparent 24%),
        #f3eef8;
}

a, .btn-link { color: var(--gy-primary); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; }
h1:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.app-shell main { flex: 1; overflow-y: auto; }
.app-shell article { padding: 1.5rem 2rem; }

/* Sidebar */
.sidebar {
    width: 280px; min-height: 100vh; position: sticky; top: 0;
    background: linear-gradient(180deg, #1e1030 0%, #2d1b4e 100%);
    box-shadow: 0 0 30px rgba(30, 16, 48, 0.14);
    display: flex; flex-direction: column; padding: 1.25rem 0.75rem;
}

.brand-shell { display: flex; align-items: center; gap: 0.9rem; padding: 0 0.75rem 1.25rem; }
.brand-mark {
    width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 1rem; background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white; font-weight: 800; font-size: 1.2rem;
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.24);
}
.navbar-brand { color: white; font-size: 1.15rem; font-weight: 800; text-decoration: none; display: block; }
.brand-caption { color: rgba(255, 255, 255, 0.68); font-size: 0.78rem; max-width: 14rem; }

.nav-links { flex: 1; }
.nav-section { margin: 0.8rem 0 0.35rem; padding: 0 0.75rem; color: rgba(200, 190, 230, 0.65); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }

.nav-link {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.5rem;
    padding: 0.8rem 1rem; border-radius: 1rem; color: rgba(255, 255, 255, 0.82);
    text-decoration: none; transition: transform 0.18s, background 0.18s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.nav-link.active { background: rgba(255, 255, 255, 0.12); color: white; transform: translateX(4px); }
.nav-link-copy { display: grid; gap: 0.12rem; }
.nav-link-copy strong { font-size: 0.92rem; }
.nav-link-copy small { color: rgba(255, 255, 255, 0.58); font-size: 0.75rem; }

.sidebar-footer {
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem; color: rgba(255, 255, 255, 0.82); font-size: 0.8rem;
    line-height: 1.5; padding: 1rem; margin: 0.75rem 0 0;
}

/* Cards & panels */
.hero-panel, .dashboard-card, .page-section {
    background: var(--gy-surface-soft); border: 1px solid var(--gy-border);
    border-radius: 28px; box-shadow: 0 22px 60px rgba(30, 16, 48, 0.06);
}
.hero-panel { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); margin-bottom: 1.5rem; overflow: hidden; padding: 1.75rem; }
.dashboard-card, .page-section { padding: 1.4rem; }
.card-header { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.hero-copy p, .card-header p, .page-section p { color: var(--gy-text-soft); }

.hero-eyebrow, .section-pill {
    align-items: center; background: rgba(124, 58, 237, 0.1); border-radius: 999px;
    color: var(--gy-primary); display: inline-flex; font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.03em; padding: 0.45rem 0.75rem; text-transform: uppercase;
}

.hero-summary {
    background: linear-gradient(160deg, #1e1030, #2d1b4e 55%, #7c3aed);
    border-radius: 24px; color: white; padding: 1.25rem;
}
.summary-kpi { margin-bottom: 1rem; }
.summary-kpi span, .mini-kpi span { display: block; font-size: 0.85rem; opacity: 0.82; }
.summary-kpi strong, .mini-kpi strong { display: block; font-size: 1.45rem; margin-top: 0.35rem; }
.summary-kpi small { display: block; margin-top: 0.25rem; opacity: 0.7; }

.summary-grid, .quick-actions, .dashboard-grid { display: grid; gap: 1rem; }
.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mini-kpi, .action-tile { border-radius: 20px; padding: 1rem; }
.mini-kpi.income, .action-tile.income { background: rgba(22, 163, 74, 0.12); color: #116934; }
.mini-kpi.expense, .action-tile.expense { background: rgba(239, 91, 91, 0.14); color: #a11f1f; }
.mini-kpi.neutral, .action-tile.neutral { background: rgba(245, 158, 11, 0.16); color: #7a5200; }
.mini-kpi.accent, .action-tile.accent { background: rgba(124, 58, 237, 0.12); color: #5b21b6; }
.action-links a { color: inherit; text-decoration: none; }

.hero-chip-row, .toolbar-chips { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-chip { border-radius: 999px; font-size: 0.78rem; font-weight: 700; padding: 0.5rem 0.85rem; }
.hero-chip.success { background: rgba(22, 163, 74, 0.12); color: #116934; }
.hero-chip.info { background: rgba(124, 58, 237, 0.12); color: #5b21b6; }
.hero-chip.warning { background: rgba(245, 158, 11, 0.16); color: #7a5200; }

.insight-list { display: grid; gap: 0.9rem; }
.insight-item, .empty-state {
    background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 18px; padding: 1rem;
}
.insight-item strong { display: block; margin-bottom: 0.25rem; }
.insight-item span, .empty-state { color: var(--gy-text-soft); }
.insight-item.success { box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.1); }
.insight-item.danger { box-shadow: inset 0 0 0 1px rgba(239, 91, 91, 0.12); }
.insight-item.info { box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.1); }
.insight-item.warning { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.14); }
.insight-item.accent { box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.14); }

.status-banner { border-radius: 18px; border: 1px solid transparent; font-weight: 600; padding: 0.95rem 1rem; }
.status-banner.danger { background: rgba(239, 91, 91, 0.12); border-color: rgba(239, 91, 91, 0.18); color: #a11f1f; }
.status-banner.success { background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.18); color: #116934; }
.page-stack { display: grid; gap: 1.25rem; }

/* Tables */
.data-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th { background: rgba(124, 58, 237, 0.06); color: var(--gy-text-soft); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.85rem 0.75rem; text-align: left; text-transform: uppercase; white-space: nowrap; }
tbody td { border-top: 1px solid rgba(124, 58, 237, 0.08); padding: 0.85rem 0.75rem; vertical-align: middle; }
tbody tr:hover { background: rgba(124, 58, 237, 0.04); }
.mono { font-family: monospace; font-size: 0.8rem; }

/* Status badges */
.badge-status { border-radius: 999px; font-size: 0.72rem; font-weight: 700; padding: 0.35rem 0.65rem; white-space: nowrap; }
.badge-status.badge-pending, .badge-status.badge-PENDING { background: rgba(245, 158, 11, 0.16); color: #7a5200; }
.badge-status.badge-paid, .badge-status.badge-PAID, .badge-status.badge-confirmed, .badge-status.badge-CONFIRMED { background: rgba(22, 163, 74, 0.12); color: #116934; }
.badge-status.badge-free { background: rgba(124, 58, 237, 0.1); color: #5b21b6; }
.badge-status.badge-premium { background: rgba(245, 158, 11, 0.16); color: #7a5200; }
.badge-status.badge-tarot { background: rgba(124, 58, 237, 0.12); color: #5b21b6; }

/* Chips */
.chip {
    background: rgba(255, 255, 255, 0.72); border: 1px solid var(--gy-border); border-radius: 999px;
    color: var(--gy-text-soft); cursor: pointer; font-size: 0.82rem; font-weight: 600;
    padding: 0.5rem 1rem; transition: all 0.15s;
}
.chip:hover { background: rgba(124, 58, 237, 0.08); }
.chip.active { background: var(--gy-primary); border-color: var(--gy-primary); color: white; }

/* Blazor */
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

.skip-nav {
    position: absolute; left: -9999px; top: 0; z-index: 9999;
    padding: 0.75rem 1.5rem; background: #7c3aed;
    color: #fff; border-radius: 0 0 0.5rem 0; font-weight: 600; text-decoration: none;
}
.skip-nav:focus { left: 0; color: #fff; }

@media (max-width: 900px) {
    .hero-panel, .dashboard-grid { grid-template-columns: 1fr; }
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; position: relative; }
    .app-shell article { padding: 1rem; }
}
