/* ============================================================================
   DASHBOARD — SaaS Command Center
   ============================================================================ */

.dashboard-page {
    animation: fadeIn 0.3s ease-out;
}

/* ── Header strip ── */
.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.dashboard-hero-left h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-1);
}

.dashboard-hero-left p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    max-width: 520px;
}

.dashboard-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.dashboard-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-light);
}

.dashboard-live-pill.loading {
    background: var(--bg-sunken);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.dashboard-live-pill.error {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-light);
}

.dashboard-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

.dashboard-updated {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.dashboard-error-banner {
    margin-bottom: var(--space-5);
}
.dashboard-error-banner.hidden { display: none !important; }
.dashboard-error-banner.visible { display: flex !important; }

/* ── KPI row — always 4 columns on desktop ── */
.dashboard-page .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.dashboard-page .kpi-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-base), box-shadow var(--duration-base), border-color var(--duration-base);
}

.dashboard-page .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    border-color: var(--border-default);
}

.dashboard-page .kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 0.85;
}

.dashboard-page .kpi-card:nth-child(1)::before { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.dashboard-page .kpi-card:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.dashboard-page .kpi-card:nth-child(3)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.dashboard-page .kpi-card:nth-child(4)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.dashboard-page .kpi-trend-badge {
    font-size: 10px;
    white-space: nowrap;
}

.dashboard-page .kpi-value {
    min-height: 2rem;
}

.skeleton-kpi {
    height: 2rem;
    width: 5.5rem;
    border-radius: var(--radius-md);
    display: inline-block;
}

.kpi-value:not(.skeleton) {
    animation: fadeIn 0.25s ease-out;
}

/* ── Section label ── */
.dashboard-section-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

/* ── Activity row ── */
.dashboard-activity-row,
.dashboard-charts-row {
    display: grid;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.dashboard-activity-row { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.dashboard-charts-row   { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Activity feed cards (Stripe / Clerk style) ── */
.dashboard-feed-card {
    padding: 24px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow var(--duration-base), border-color var(--duration-base), transform var(--duration-base);
}

.dashboard-feed-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    border-color: var(--border-default);
}

:root.dark-mode .dashboard-feed-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

:root.dark-mode .dashboard-feed-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.dashboard-feed-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.dashboard-activity-card,
.dashboard-chart-card,
.dashboard-health-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-page .dashboard-chart-card:hover,
.dashboard-page .dashboard-health-card:hover {
    transform: none;
}

/* ── Feed list ── */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 280px;
    max-height: 400px;
    overflow-y: auto;
}

.feed-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background-color var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.feed-row + .feed-row {
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    margin-top: 0;
}

.feed-row:first-child {
    padding-top: 4px;
}

.feed-row:hover {
    background: var(--bg-sunken);
    border-color: var(--border-subtle);
}

.feed-col-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.feed-col-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.feed-col-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

/* Avatar — subtle circle, no solid color bars */
.feed-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    border: 1.5px solid var(--border-default);
    background: var(--bg-sunken);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.feed-identity {
    min-width: 0;
    flex: 1;
}

.feed-name {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-email {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-amount {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.feed-date {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.feed-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
    flex-shrink: 0;
}

.feed-action-btn:hover {
    background: var(--brand-50);
    border-color: var(--brand-200);
    color: var(--brand-600);
    transform: translateX(2px);
}

:root.dark-mode .feed-action-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--brand-400);
}

.feed-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Dashboard pill badges */
.dash-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Plan badges */
.dash-badge-plan--free {
    background: var(--bg-sunken);
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.dash-badge-plan--monthly {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.dash-badge-plan--yearly {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.dash-badge-plan--enterprise {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

:root.dark-mode .dash-badge-plan--monthly {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.25);
}

:root.dark-mode .dash-badge-plan--yearly {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.25);
}

:root.dark-mode .dash-badge-plan--enterprise {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.25);
}

/* Payment method badges */
.dash-badge-method--stripe {
    background: #f0f4ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.dash-badge-method--card {
    background: var(--bg-sunken);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.dash-badge-method--paypal {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

:root.dark-mode .dash-badge-method--stripe {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.25);
}

/* Payment status badges */
.dash-badge-status--success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border-color: var(--color-success-light);
}

.dash-badge-status--failed {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-light);
}

.dash-badge-status--pending {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-color: var(--color-warning-light);
}

/* Skeleton rows */
.feed-skeleton-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
}

.feed-skeleton-row + .feed-skeleton-row {
    border-top: 1px solid var(--border-subtle);
}

.feed-skeleton-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feed-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    min-height: 240px;
    flex: 1;
}

.feed-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-tertiary);
}

.feed-empty-title {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.feed-empty-desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

.feed-empty.feed-empty--error .feed-empty-title {
    color: var(--color-danger);
}

.dashboard-activity-card .card-header,
.dashboard-chart-card .card-header {
    margin-bottom: var(--space-4);
}

.dashboard-feed-card .card-header {
    margin-bottom: 0;
}

/* Legacy activity classes removed — kept empty state alias */
.activity-error { color: var(--color-danger); }

/* ── Charts ── */
.chart-wrap {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 240px;
    height: 240px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-wrap-donut {
    min-height: 260px;
    height: 260px;
}

.chart-state-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    transition: opacity var(--duration-base);
    z-index: 2;
}

.chart-state-overlay.is-dismissed {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.chart-state-overlay.is-error {
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-danger);
    text-align: center;
    padding: var(--space-4);
}

/* ── System health ── */
.dashboard-health-card {
    margin-bottom: var(--space-4);
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-base), box-shadow var(--duration-base), transform var(--duration-base);
}

.health-item:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.health-item-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.health-dot.healthy {
    background-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
    animation: pulse 2.5s ease-in-out infinite;
}

.health-dot.warning {
    background-color: var(--color-warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.health-dot.error {
    background-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

.health-dot.gray {
    background-color: var(--text-tertiary);
}

.health-item-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.health-item-detail {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* ── Responsive ── */
@media (max-width: 1280px) {
    .dashboard-page .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .dashboard-charts-row {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-charts-row .dashboard-chart-card:last-child {
        grid-column: 1 / -1;
    }
    .health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-activity-row,
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
    .dashboard-charts-row .dashboard-chart-card:last-child {
        grid-column: auto;
    }
    .health-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-page .kpi-grid {
        grid-template-columns: 1fr;
    }
    .feed-row,
    .feed-skeleton-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px 8px;
    }
    .feed-col-center {
        justify-content: flex-start;
    }
    .feed-col-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
}

/* ============================================================================
   REDESIGNED DASHBOARD LAYOUT & DESIGN TOKENS
   ============================================================================ */

.kpi-grid-8 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (max-width: 1200px) {
    .kpi-grid-8 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.clickable-kpi-card {
    cursor: pointer;
}

.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.kpi-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-wrap.indigo { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.kpi-icon-wrap.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.kpi-icon-wrap.green  { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-icon-wrap.amber  { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.kpi-icon-wrap.blue   { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.kpi-icon-wrap.red    { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.kpi-icon-wrap.teal   { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.kpi-icon-wrap.emerald { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.kpi-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    letter-spacing: -0.02em;
}

.kpi-footer {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.system-alerts-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.system-alert-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-sm);
}

.system-alert-banner.danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-light);
}

.system-alert-banner.warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-color: var(--color-warning-light);
}

.system-alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.system-alert-message {
    flex: 1;
    line-height: 1.4;
}

.system-alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    padding: 0 var(--space-1);
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.system-alert-close:hover {
    opacity: 1;
}

.charts-two-col,
.analytics-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
    .charts-two-col,
    .analytics-two-col {
        grid-template-columns: 1fr;
    }
}

.chart-wrap-compact {
    position: relative;
    width: 100%;
    height: 180px;
    margin-top: var(--space-2);
}

.analytics-sub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

@media (max-width: 640px) {
    .analytics-sub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sub-stat-card {
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sub-stat-label {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-stat-val {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.activity-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
    .activity-actions-row {
        grid-template-columns: 1fr;
    }
}

.feed-row-unified {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 0.8fr) minmax(0, 0.3fr);
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.feed-row-unified:last-child {
    border-bottom: none;
}

.feed-event-desc {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

.feed-event-meta {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ============================================================================
   EXECUTIVE DASHBOARD — Compact 70/30 Layout
   ============================================================================ */

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.dashboard-page .dashboard-kpi-grid .kpi-card {
    padding: var(--space-5);
    min-height: 0;
}

.dashboard-page .dashboard-kpi-grid .kpi-value {
    font-size: var(--font-size-xl);
    margin-bottom: 0;
}

.dashboard-page .dashboard-kpi-grid .kpi-card-top {
    margin-bottom: var(--space-2);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: var(--space-4);
    align-items: start;
    width: 100%;
    visibility: visible;
    opacity: 1;
}

.dashboard-main-left,
.dashboard-main-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.dashboard-panel-card {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.dashboard-panel-header .card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.dashboard-compact-table th {
    text-align: left;
    font-size: var(--font-size-sm); /* 13px */
    font-weight: var(--font-weight-semibold); /* 600 */
    text-transform: none; /* consistently capitalized */
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-4); /* py-3 py-4 / px-4 px-6 density */
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg-sunken);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    vertical-align: middle;
}

.dashboard-compact-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    white-space: nowrap;
}

.dashboard-compact-table tbody tr {
    transition: background-color var(--duration-fast) ease;
}

.dashboard-compact-table tbody tr:hover {
    background-color: var(--bg-sunken);
}

.dashboard-compact-table tr:last-child td {
    border-bottom: none;
}

/* Explicit column widths to ensure perfect alignment and prevent layout shifting */
.dashboard-compact-table .col-name {
    min-width: 220px;
}

.dashboard-compact-table .col-plan {
    width: 140px;
    min-width: 140px;
}

.dashboard-compact-table .col-status {
    width: 120px;
    min-width: 120px;
}

.dashboard-compact-table .col-date {
    width: 160px;
    min-width: 160px;
}

.dashboard-user-name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.3;
}

.dashboard-user-email {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: 2px;
}

.plan-progress-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.plan-progress-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.plan-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.plan-progress-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    text-transform: capitalize;
}

.plan-progress-meta {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.plan-progress-track {
    height: 6px;
    background: var(--bg-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.plan-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.system-alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.system-alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    line-height: 1.4;
    border: 1px solid transparent;
}

.system-alert-item.danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-light);
}

.system-alert-item.warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-color: var(--color-warning-light);
}

.system-alert-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    margin-top: 4px;
}

.activity-feed-list {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
}

.activity-feed-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.activity-feed-row:last-child {
    border-bottom: none;
}

.activity-feed-main {
    min-width: 0;
    flex: 1;
}

.activity-feed-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.activity-feed-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.35;
}

.activity-feed-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.activity-skeleton,
.plan-progress-skeleton {
    padding: var(--space-2) 0;
}

.dashboard-empty-inline {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-4) 0;
}

.dashboard-main-right .quick-actions-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.dashboard-main-right .btn-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-weight-semibold);
}

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .activity-feed-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

