/* ============================================================
   DASHBOARD - OLD BLINKR STYLE
   Modular card-based layout matching www.blinkrquotes.com
   ============================================================ */

:root[data-theme="old-blinkr"] {
    /* Dashboard specific colors */
    --dashboard-card-bg: rgba(31, 41, 55, 0.5);
    --dashboard-card-border: #374151;
    --dashboard-kpi-bg: #1f2937;
    --dashboard-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-layout {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 24px;
}

:root[data-theme="old-blinkr"] .dashboard-header {
    margin-bottom: 32px;
}

:root[data-theme="old-blinkr"] .dashboard-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

:root[data-theme="old-blinkr"] .dashboard-header h2::before {
    content: "📊 ";
}

:root[data-theme="old-blinkr"] .dashboard-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============================================================
   KPI METRIC BOXES - TOP ROW
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

:root[data-theme="old-blinkr"] .dashboard-kpi {
    background: var(--dashboard-kpi-bg);
    border: 1px solid var(--dashboard-card-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--dashboard-shadow);
    transition: all 0.3s ease;
}

:root[data-theme="old-blinkr"] .dashboard-kpi:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0, 168, 232, 0.3);
    border-color: var(--accent-primary);
}

:root[data-theme="old-blinkr"] .dashboard-kpi-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

:root[data-theme="old-blinkr"] .dashboard-kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Add icons to KPI labels */
:root[data-theme="old-blinkr"] .dashboard-kpi:nth-child(1) .dashboard-kpi-label::before {
    content: "📥 ";
}

:root[data-theme="old-blinkr"] .dashboard-kpi:nth-child(2) .dashboard-kpi-label::before {
    content: "📝 ";
}

:root[data-theme="old-blinkr"] .dashboard-kpi:nth-child(3) .dashboard-kpi-label::before {
    content: "🚀 ";
}

:root[data-theme="old-blinkr"] .dashboard-kpi:nth-child(4) .dashboard-kpi-label::before {
    content: "💰 ";
}

/* Highlight positive values */
:root[data-theme="old-blinkr"] .dashboard-kpi-value[data-trend="positive"] {
    color: var(--button-teal);
}

:root[data-theme="old-blinkr"] .dashboard-kpi-value[data-trend="negative"] {
    color: var(--button-danger);
}

/* ============================================================
   DASHBOARD MAIN GRID - PANELS
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

@media (max-width: 1200px) {
    :root[data-theme="old-blinkr"] .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="old-blinkr"] .dashboard-panel {
    background: var(--dashboard-card-bg);
    border: 1px solid var(--dashboard-card-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--dashboard-shadow);
}

:root[data-theme="old-blinkr"] .dashboard-panel h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--dashboard-card-border);
}

:root[data-theme="old-blinkr"] .dashboard-panel h3::before {
    content: "📈 ";
    margin-right: 8px;
}

/* ============================================================
   PIPELINE SNAPSHOT TABLE
   ============================================================ */

:root[data-theme="old-blinkr"] #dashboard-pipeline-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table thead {
    background: var(--bg-darkest);
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--dashboard-card-border);
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--dashboard-card-border);
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table tbody tr {
    transition: background 0.2s ease;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table tbody tr:hover {
    background: rgba(0, 168, 232, 0.1);
}

/* Status badges in table */
:root[data-theme="old-blinkr"] #dashboard-pipeline-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table .status-badge.status-new {
    background: var(--status-info);
    color: #fff;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table .status-badge.status-sent {
    background: var(--button-teal);
    color: #fff;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table .status-badge.status-production {
    background: var(--status-success);
    color: #fff;
}

:root[data-theme="old-blinkr"] #dashboard-pipeline-table .status-badge.status-draft {
    background: var(--status-warning);
    color: #000;
}

/* ============================================================
   RECENT ACTIVITY LIST
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

:root[data-theme="old-blinkr"] .dashboard-activity-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--dashboard-card-border);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

:root[data-theme="old-blinkr"] .dashboard-activity-list li:last-child {
    border-bottom: none;
}

:root[data-theme="old-blinkr"] .dashboard-activity-list li::before {
    content: "• ";
    color: var(--accent-primary);
    font-weight: 700;
    margin-right: 8px;
}

:root[data-theme="old-blinkr"] .dashboard-activity-list .activity-time {
    color: var(--text-muted);
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

:root[data-theme="old-blinkr"] .dashboard-activity-list .activity-highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ============================================================
   CHARTS & GRAPHS AREA
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 32px;
}

@media (max-width: 1200px) {
    :root[data-theme="old-blinkr"] .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="old-blinkr"] .dashboard-chart-container {
    background: var(--dashboard-card-bg);
    border: 1px solid var(--dashboard-card-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--dashboard-shadow);
}

:root[data-theme="old-blinkr"] .dashboard-chart-container h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

:root[data-theme="old-blinkr"] .dashboard-chart-container h3::before {
    content: "📊 ";
}

:root[data-theme="old-blinkr"] .dashboard-chart {
    width: 100%;
    height: 300px;
    min-height: 300px;
}

/* ============================================================
   WORKFLOW SNAPSHOT CARDS
   ============================================================ */

:root[data-theme="old-blinkr"] .workflow-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

:root[data-theme="old-blinkr"] .workflow-card {
    background: var(--dashboard-card-bg);
    border: 1px solid var(--dashboard-card-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--dashboard-shadow);
    transition: all 0.3s ease;
}

:root[data-theme="old-blinkr"] .workflow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0, 168, 232, 0.3);
}

:root[data-theme="old-blinkr"] .workflow-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

:root[data-theme="old-blinkr"] .workflow-card .workflow-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

:root[data-theme="old-blinkr"] .workflow-card .workflow-label {
    font-size: 13px;
    color: var(--text-secondary);
}

:root[data-theme="old-blinkr"] .workflow-card .workflow-action {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--dashboard-card-border);
}

:root[data-theme="old-blinkr"] .workflow-card .workflow-action a {
    font-size: 13px;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

:root[data-theme="old-blinkr"] .workflow-card .workflow-action a:hover {
    color: var(--link-hover);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

:root[data-theme="old-blinkr"] .dashboard-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

:root[data-theme="old-blinkr"] .dashboard-empty-state::before {
    content: "📭";
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

:root[data-theme="old-blinkr"] .dashboard-empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* ============================================================
   LOADING STATES
   ============================================================ */

@keyframes pulse-dashboard {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

:root[data-theme="old-blinkr"] .dashboard-loading {
    animation: pulse-dashboard 1.5s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    :root[data-theme="old-blinkr"] .dashboard-kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    :root[data-theme="old-blinkr"] .dashboard-kpi-value {
        font-size: 28px;
    }

    :root[data-theme="old-blinkr"] .workflow-snapshot-grid {
        grid-template-columns: 1fr;
    }
}
