/* ---- P&L Dashboard ---- */
.dashboard-page { max-width: 1400px; }

/* P&L Hero Section */
.pnl-hero {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.pnl-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-cyan), var(--accent-green), var(--brand-purple));
}

.pnl-hero__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.pnl-hero__title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.pnl-hero__period {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pnl-hero__summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.pnl-hero__column {
    text-align: center;
}

.pnl-hero__column-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.pnl-hero__column-value {
    font-size: var(--text-3xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pnl-hero__column-value--revenue { color: var(--accent-green); }
.pnl-hero__column-value--expense { color: #EF4444; }
.pnl-hero__column-value--profit { color: var(--brand-cyan); }

.pnl-hero__operator {
    font-size: var(--text-2xl);
    font-weight: 300;
    color: var(--text-tertiary);
    text-align: center;
}

.pnl-hero__trend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 500;
}

.pnl-hero__trend--up { color: var(--accent-green); }
.pnl-hero__trend--down { color: #EF4444; }

/* Metrics Grid (5 cards) */
.dashboard__metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

/* Charts Area */
.dashboard__charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.dashboard__chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.dashboard__chart-card h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard__chart-placeholder {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* Revenue breakdown mini chart */
.revenue-breakdown { display: flex; flex-direction: column; gap: var(--space-md); }

.revenue-breakdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.revenue-breakdown__bar-wrapper {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.revenue-breakdown__bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.revenue-breakdown__label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 90px;
}

.revenue-breakdown__value {
    font-size: var(--text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 70px;
    text-align: right;
}

/* Sections Grid */
.dashboard__sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.dashboard__section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.dashboard__section h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Recent items list */
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); transition: background var(--transition-fast); cursor: pointer; }
.recent-item:hover { background: var(--bg-tertiary); }
.recent-item__icon { flex-shrink: 0; color: var(--text-tertiary); display: flex; }
.recent-item__title { flex: 1; font-size: var(--text-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item__amount { font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-item__date { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }

/* Donut Chart */
.donut-chart { display: flex; align-items: center; justify-content: center; }
.donut-legend { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-md); }
.donut-legend__item { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-xs); }
.donut-legend__swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.donut-legend__label { color: var(--text-secondary); flex: 1; }
.donut-legend__value { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Revenue stream cards */
.revenue-streams {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.revenue-stream-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.revenue-stream-card:hover {
    border-color: var(--border-default);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.revenue-stream-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.revenue-stream-card__icon svg { width: 22px; height: 22px; }
.revenue-stream-card__icon--invoices { background: rgba(6, 182, 212, 0.12); color: var(--brand-cyan); }
.revenue-stream-card__icon--merch { background: rgba(139, 92, 246, 0.12); color: var(--brand-purple); }
.revenue-stream-card__icon--memberships { background: rgba(217, 70, 239, 0.12); color: var(--brand-magenta); }

.revenue-stream-card__info { flex: 1; min-width: 0; }
.revenue-stream-card__label { font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.revenue-stream-card__value { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Responsive */
@media (max-width: 1400px) {
    .dashboard__metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1200px) {
    .dashboard__metrics { grid-template-columns: repeat(2, 1fr); }
    .revenue-streams { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .dashboard__charts { grid-template-columns: 1fr; }
    .dashboard__sections { grid-template-columns: 1fr; }
    .pnl-hero__summary { grid-template-columns: 1fr; gap: var(--space-md); }
    .pnl-hero__operator { display: none; }
}

@media (max-width: 640px) {
    .dashboard__metrics { grid-template-columns: 1fr; }
}
