/* ================================================================
   Store MM — My Earnings  (my-earnings.css)
   ================================================================ */

/* ---- Wrapper ---------------------------------------------------------- */
.smm-earn-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 56px;
    font-family: inherit;
    color: #111827;
    box-sizing: border-box;
}
.smm-earn-wrap *, .smm-earn-wrap *::before, .smm-earn-wrap *::after { box-sizing: inherit; }

/* ---- Notice (login / permission) -------------------------------------- */
.smm-earn-notice {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: .9rem;
    color: #374151;
}
.smm-earn-notice a { color: #d97706; font-weight: 600; }

/* ================================================================
   KPI Strip
   ================================================================ */
.smm-earn-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.smm-earn-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.smm-earn-kpi--primary {
    border-left: 4px solid #6d28d9;
    background: linear-gradient(135deg, #faf5ff 0%, #fff 60%);
}

.smm-earn-kpi__label {
    font-size: .78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smm-earn-kpi__sub {
    font-size: .72rem;
    font-weight: 400;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
}

.smm-earn-kpi__value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.smm-earn-kpi--primary .smm-earn-kpi__value { color: #6d28d9; }

.smm-earn-kpi__currency {
    font-size: .82rem;
    font-weight: 600;
    color: #6b7280;
}

.smm-earn-kpi__trend {
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 12px;
    align-self: flex-start;
}
.smm-earn-kpi__trend--up   { background: #dcfce7; color: #15803d; }
.smm-earn-kpi__trend--down { background: #fee2e2; color: #b91c1c; }

/* ================================================================
   Sections
   ================================================================ */
.smm-earn-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.smm-earn-section__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .82rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.smm-earn-section__title .dashicons {
    color: #6d28d9;
    font-size: 17px;
    width: 17px;
    height: 17px;
    line-height: 1;
}

/* ================================================================
   Monthly Bar Chart
   ================================================================ */
.smm-earn-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 160px;
}

.smm-earn-chart__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.smm-earn-chart__amount {
    font-size: .68rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.2;
    min-height: 24px;
    display: flex;
    align-items: flex-end;
}

.smm-earn-chart__bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.smm-earn-chart__bar {
    width: 100%;
    background: linear-gradient(180deg, #a78bfa 0%, #6d28d9 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: opacity .2s ease;
    cursor: default;
}

.smm-earn-chart__bar:hover { opacity: .75; }

.smm-earn-chart__label {
    font-size: .7rem;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* ================================================================
   Tables
   ================================================================ */
.smm-earn-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.smm-earn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.smm-earn-table th {
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 8px 12px;
    border-bottom: 2px solid #f3f4f6;
    white-space: nowrap;
}

.smm-earn-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f9fafb;
    color: #374151;
    vertical-align: middle;
}

.smm-earn-table tbody tr:last-child td { border-bottom: none; }

.smm-earn-table tbody tr:hover td { background: #fafafa; }

.smm-earn-table__num  { text-align: right; white-space: nowrap; }
.smm-earn-table__date { color: #9ca3af; font-size: .8rem; white-space: nowrap; }
.smm-earn-table__pct  { color: #6b7280; }
.smm-earn-table__amount { font-weight: 700; color: #111827; }

.smm-earn-table__product a {
    color: #374151;
    text-decoration: none;
    font-weight: 600;
}
.smm-earn-table__product a:hover { color: #6d28d9; text-decoration: underline; }

.smm-earn-order-link {
    font-weight: 700;
    color: #6d28d9;
    text-decoration: none;
}
.smm-earn-order-link:hover { text-decoration: underline; }

/* ---- Earnings status pills ------------------------------------------- */
.smm-earn-status {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 12px;
    text-transform: capitalize;
    white-space: nowrap;
}
.smm-earn-status--pending   { background: #fef9c3; color: #a16207; }
.smm-earn-status--confirmed { background: #dcfce7; color: #15803d; }
.smm-earn-status--cancelled { background: #fee2e2; color: #b91c1c; }
.smm-earn-status--paid      { background: #dbeafe; color: #1d4ed8; }

/* ================================================================
   Empty state
   ================================================================ */
.smm-earn-empty {
    text-align: center;
    padding: 52px 24px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
}

.smm-earn-empty__icon.dashicons {
    font-size: 52px;
    width:  52px;
    height: 52px;
    color: #d1d5db;
    margin-bottom: 14px;
}

.smm-earn-empty__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 8px;
}

.smm-earn-empty__sub {
    font-size: .88rem;
    color: #6b7280;
    margin: 0;
    max-width: 420px;
    margin-inline: auto;
    line-height: 1.6;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 680px) {
    .smm-earn-kpis { grid-template-columns: 1fr; gap: 12px; }

    .smm-earn-kpi__value { font-size: 1.3rem; }

    .smm-earn-chart { gap: 6px; height: 120px; }

    .smm-earn-chart__amount { font-size: .6rem; }

    .smm-earn-table--transactions th:nth-child(4),
    .smm-earn-table--transactions td:nth-child(4) { display: none; } /* hide Sale column on mobile */
}
