/* Dashboard Components - Modular Design System */

/* Dashboard Container - Only Layout, No Styling */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* Dashboard Title (optional) */
.dashboard-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: #0a0a0a;
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.025em;
}

/* Box Component - Self-contained */
.dashboard .box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dashboard .box:hover {
    border-color: #d4d4d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Box Title */
.dashboard .box-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Metrics */
.dashboard .metric {
    margin-bottom: 1rem;
}

.dashboard .metric:last-child {
    margin-bottom: 0;
}

.dashboard .metric .box-title {
    font-size: 0.75rem;
    font-weight: 400;
    color: #737373;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0.25rem;
}

/* Metric Values */
.dashboard .metric-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #0a0a0a;
    line-height: 1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}

/* Status Modifiers */
.dashboard .metric.positive .metric-value {
    color: #16a34a;
}

.dashboard .metric.negative .metric-value {
    color: #dc2626;
}

.dashboard .metric.warning .metric-value {
    color: #ea580c;
}

/* Status Indicators */
.dashboard .metric.positive::before,
.dashboard .metric.negative::before,
.dashboard .metric.warning::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 3px;
    border-radius: 0 2px 2px 0;
}

.dashboard .metric.positive::before {
    background-color: #16a34a;
}

.dashboard .metric.negative::before {
    background-color: #dc2626;
}

.dashboard .metric.warning::before {
    background-color: #ea580c;
}

/* Chart Container */
.dashboard .chart-container {
    margin-top: 1rem;
}

/* Dashboard Tables */
.dashboard .table {
    margin-top: 0.5rem;
}

.dashboard .table table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.dashboard .table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
    color: #0a0a0a;
}

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

.dashboard .table tr:hover td {
    background-color: #fafafa;
}

.dashboard .table td:first-child {
    font-weight: 500;
}

.dashboard .table td:last-child {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Metrics Grid Layout */
.dashboard .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
}

/* Dashboard Variants */

/* Compact Version for Sidebars or Small Areas */
.dashboard.dashboard--compact {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.dashboard.dashboard--compact .box {
    padding: 1rem;
}

.dashboard.dashboard--compact .metric-value {
    font-size: 1.5rem;
}

/* Inline Version for Within Content */
.dashboard.dashboard--inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard.dashboard--inline .box {
    flex: 1 1 200px;
}

/* No Border Version */
.dashboard.dashboard--borderless .box {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard.dashboard--borderless .box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Dark Theme Support */
.dashboard.dashboard--dark .box {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #ffffff;
}

.dashboard.dashboard--dark .box-title {
    color: #a3a3a3;
}

.dashboard.dashboard--dark .metric-value {
    color: #ffffff;
}

.dashboard.dashboard--dark .table td {
    border-color: #2a2a2a;
    color: #ffffff;
}

/* Responsive Behavior */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .dashboard .box {
        padding: 1.25rem;
    }

    .dashboard .metric-value {
        font-size: 1.5rem;
    }

    .dashboard .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Large Screens Layout Options */
@media (min-width: 1024px) {
    /* Main dashboard with mixed content */
    .dashboard.dashboard--main {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard.dashboard--main .box:has(.chart-container) {
        grid-column: span 2;
    }

    /* Metrics only dashboard */
    .dashboard.dashboard--metrics {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Charts focused dashboard */
    .dashboard.dashboard--charts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation System (opt-in) */
.dashboard.dashboard--animated .box {
    animation: dashboardFadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.dashboard.dashboard--animated .box:nth-child(1) { animation-delay: 0.05s; }
.dashboard.dashboard--animated .box:nth-child(2) { animation-delay: 0.1s; }
.dashboard.dashboard--animated .box:nth-child(3) { animation-delay: 0.15s; }
.dashboard.dashboard--animated .box:nth-child(4) { animation-delay: 0.2s; }
.dashboard.dashboard--animated .box:nth-child(5) { animation-delay: 0.25s; }
.dashboard.dashboard--animated .box:nth-child(6) { animation-delay: 0.3s; }

@keyframes dashboardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.dashboard .text-right {
    text-align: right;
}

.dashboard .text-center {
    text-align: center;
}

.dashboard .mt-1 {
    margin-top: 0.5rem;
}

.dashboard .mt-2 {
    margin-top: 1rem;
}

.dashboard .mb-0 {
    margin-bottom: 0;
}
