/* ============================================
   Solutioo Customer Insights Dashboard
   ============================================ */

.ci-dashboard {
    max-width: 100%;
}

.ci-dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.ci-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
    flex: 1;
}

.ci-subtitle {
    flex-basis: 100%;
    color: #666;
    font-size: 14px;
    margin: 8px 0 0;
}

.ci-export-actions {
    margin-top: 10px;
}

.ci-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 13px;
    text-decoration: none;
}

/* ---- Sections ---- */

.ci-section {
    margin-bottom: 40px;
}

.ci-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.ci-section-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* ---- Tables ---- */

.table-ci-yearly-spend,
.table-ci-top-products,
.table-ci-purchase-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-ci-yearly-spend thead th,
.table-ci-top-products thead th,
.table-ci-purchase-history thead th {
    background: #f7f7f7;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.table-ci-yearly-spend tbody td,
.table-ci-top-products tbody td,
.table-ci-purchase-history tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.table-ci-yearly-spend tbody tr:hover,
.table-ci-top-products tbody tr:hover,
.table-ci-purchase-history tbody tr:hover {
    background: #fafafa;
}

.col.amount,
.col.tax,
.col.net,
.col.spent,
.col.total {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.col.orders,
.col.qty,
.col.rank {
    text-align: center;
}

/* ---- Rank Badge ---- */

.ci-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1979c3;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.ci-rank-badge:first-child {
    background: #e6a817;
}

/* ---- Year Group ---- */

.ci-year-group {
    margin-bottom: 25px;
}

.ci-year-label {
    font-size: 16px;
    font-weight: 600;
    color: #1979c3;
    margin: 0 0 10px;
}

/* ---- Status Badges ---- */

.ci-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.ci-status-posted,
.ci-status-completed,
.ci-status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.ci-status-open,
.ci-status-pending {
    background: #fff3e0;
    color: #e65100;
}

.ci-status-cancelled,
.ci-status-voided {
    background: #ffebee;
    color: #c62828;
}

/* ---- Reorder Suggestions Grid ---- */

.ci-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ci-suggestion-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.ci-suggestion-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ci-suggestion-header {
    margin-bottom: 12px;
}

.ci-suggestion-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.ci-suggestion-sku {
    font-size: 12px;
    color: #999;
    font-family: monospace;
}

.ci-suggestion-body {
    margin-bottom: 15px;
}

.ci-suggestion-reason {
    font-size: 13px;
    color: #555;
    margin: 0 0 10px;
    line-height: 1.4;
}

.ci-suggestion-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ci-meta-item {
    font-size: 13px;
    color: #666;
}

.ci-meta-item strong {
    color: #444;
}

.ci-suggestion-actions {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.ci-reorder-btn {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    text-decoration: none;
}

/* ---- Footer ---- */

.ci-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.ci-sync-info {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .ci-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ci-suggestions-grid {
        grid-template-columns: 1fr;
    }

    .table-ci-yearly-spend,
    .table-ci-top-products,
    .table-ci-purchase-history {
        display: block;
    }

    .table-ci-yearly-spend thead,
    .table-ci-top-products thead,
    .table-ci-purchase-history thead {
        display: none;
    }

    .table-ci-yearly-spend tbody,
    .table-ci-top-products tbody,
    .table-ci-purchase-history tbody {
        display: block;
    }

    .table-ci-yearly-spend tbody tr,
    .table-ci-top-products tbody tr,
    .table-ci-purchase-history tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 10px;
    }

    .table-ci-yearly-spend tbody td,
    .table-ci-top-products tbody td,
    .table-ci-purchase-history tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid #f5f5f5;
        text-align: right;
    }

    .table-ci-yearly-spend tbody td::before,
    .table-ci-top-products tbody td::before,
    .table-ci-purchase-history tbody td::before {
        content: attr(data-th);
        font-weight: 600;
        text-align: left;
        color: #555;
    }

    .col.amount,
    .col.tax,
    .col.net,
    .col.spent,
    .col.total,
    .col.orders,
    .col.qty,
    .col.rank {
        text-align: right;
    }
}
