/* ================================================================
   Store MM — Designers Earnings  (designers-earnings.css)
   Palette: #0a0a0a (black) · #c0392b (red) · #ffffff (white)
   ================================================================ */

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

/* ---- Notice ----------------------------------------------------------- */
.smm-de-notice {
    background: #fff8f8;
    border: 1px solid #f5c6c6;
    border-left: 4px solid #c0392b;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: .9rem;
    color: #1a1a1a;
}
.smm-de-notice a { color: #c0392b; font-weight: 600; }

/* ================================================================
   Date Range Filter
   ================================================================ */
.smm-de-ranges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.smm-de-range {
    display: inline-block;
    padding: 7px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: #6b6b6b;
    text-decoration: none;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    background: #fff;
    transition: all .15s ease;
    white-space: nowrap;
}

.smm-de-range:hover {
    color: #1a1a1a;
    border-color: #c0c0c0;
    background: #f7f7f7;
    text-decoration: none;
}

.smm-de-range.is-active {
    color: #fff;
    background: #0a0a0a;
    border-color: #0a0a0a;
    font-weight: 700;
}

/* ================================================================
   KPI Strip
   ================================================================ */
.smm-de-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.smm-de-kpi {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.smm-de-kpi--primary {
    border-left: 4px solid #c0392b;
    background: linear-gradient(135deg, #fff8f8 0%, #fff 60%);
}

.smm-de-kpi--confirmed { border-left: 4px solid #1a7f4b; }
.smm-de-kpi--paid      { border-left: 4px solid #0a0a0a; }

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

.smm-de-kpi__sub {
    font-size: .7rem;
    font-weight: 400;
    color: #9a9a9a;
    text-transform: none;
    letter-spacing: 0;
}

.smm-de-kpi__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0a0a0a;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.smm-de-kpi--primary   .smm-de-kpi__value { color: #c0392b; }
.smm-de-kpi--confirmed .smm-de-kpi__value { color: #1a7f4b; }
.smm-de-kpi--paid      .smm-de-kpi__value { color: #0a0a0a; }

.smm-de-kpi__currency {
    font-size: .78rem;
    font-weight: 600;
    color: #9a9a9a;
}

.smm-de-kpi__split {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.smm-de-kpi__split-item {
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.smm-de-kpi__split--pending   { background: #fff5e0; color: #a05000; }
.smm-de-kpi__split--confirmed { background: #e8f7ee; color: #1a7f4b; }

/* ================================================================
   Section
   ================================================================ */
.smm-de-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

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

.smm-de-section__title .dashicons {
    color: #c0392b;
    font-size: 17px;
    width:  17px;
    height: 17px;
    line-height: 1;
}

/* ================================================================
   Main Table
   ================================================================ */
.smm-de-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.smm-de-table thead th {
    text-align: left;
    font-size: .74rem;
    font-weight: 700;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 9px 14px;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
    background: #fafafa;
}

.smm-de-th--num    { text-align: right; }
.smm-de-th--expand { width: 40px; text-align: center; }

.smm-de-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f7f7f7;
    vertical-align: middle;
    color: #1a1a1a;
}

.smm-de-table tbody tr.smm-de-row:last-of-type td { border-bottom: none; }
.smm-de-table tbody tr.smm-de-row:hover td        { background: #fafafa; }

/* Designer name cell */
.smm-de-td--name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #0a0a0a;
}

.smm-de-avatar {
    width:  28px !important;
    height: 28px !important;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Numeric cells */
.smm-de-td--num       { text-align: right; white-space: nowrap; }
.smm-de-td--total     { font-weight: 700; color: #c0392b; }
.smm-de-td--pending   { color: #a05000; }
.smm-de-td--confirmed { color: #1a7f4b; }
.smm-de-td--paid      { color: #0a0a0a; font-weight: 600; }

/* Expand button */
.smm-de-td--expand { text-align: center; }

.smm-de-expand-btn {
    background: none;
    border: 1px solid #e8e8e8;
    border-radius: 5px;
    padding: 4px 7px;
    cursor: pointer;
    color: #9a9a9a;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    line-height: 1;
}

.smm-de-expand-btn:hover,
.smm-de-expand-btn[aria-expanded="true"] {
    color: #c0392b;
    border-color: #c0392b;
    background: #fff8f8;
}

.smm-de-expand-btn .dashicons {
    font-size: 16px;
    width:  16px;
    height: 16px;
    line-height: 1;
    display: block;
}

/* ---- Mark as Paid button ------------------------------------------ */
.smm-de-mark-paid-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    background: #0a0a0a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
    white-space: nowrap;
}

.smm-de-mark-paid-btn:hover:not(:disabled) { background: #c0392b; }

.smm-de-mark-paid-btn:disabled {
    background: #d0d0d0;
    color: #8a8a8a;
    cursor: not-allowed;
}

.smm-de-mark-paid-btn.is-loading {
    opacity: .6;
    cursor: wait;
    pointer-events: none;
}

/* ================================================================
   Breakdown Row
   ================================================================ */
.smm-de-breakdown-row td {
    padding: 0;
    border-bottom: 2px solid #e8e8e8;
}

.smm-de-breakdown-cell { padding: 0 !important; }

.smm-de-breakdown-inner {
    padding: 16px 20px 16px 52px;
    background: #f7f7f7;
}

/* Loading spinner */
.smm-de-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: #9a9a9a;
}

.smm-de-spin {
    animation: smm-de-rotate .8s linear infinite;
}

@keyframes smm-de-rotate {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}

/* Breakdown sub-table */
.smm-de-breakdown-table {
    width: 100%;
    max-width: 760px;
    border-collapse: collapse;
    font-size: .82rem;
}

.smm-de-breakdown-table th {
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    color: #6b6b6b;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 6px 12px;
    border-bottom: 1px solid #e8e8e8;
}

.smm-de-breakdown-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #1a1a1a;
}

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

.smm-de-breakdown-product     { font-weight: 600; color: #0a0a0a; }
.smm-de-breakdown-prodnum     { font-size: .72rem; font-weight: 400; color: #9a9a9a; font-variant-numeric: tabular-nums; }

.smm-de-breakdown-empty,
.smm-de-breakdown-error {
    font-size: .82rem;
    color: #9a9a9a;
    margin: 0;
    padding: 4px 0;
}

.smm-de-breakdown-error { color: #8b1a1a; }

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

.smm-de-empty__icon.dashicons {
    font-size: 48px;
    width:  48px;
    height: 48px;
    color: #d0d0d0;
    margin-bottom: 12px;
}

.smm-de-empty__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.smm-de-empty__sub {
    font-size: .88rem;
    color: #8a8a8a;
    margin: 0;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1000px) {
    .smm-de-kpis { grid-template-columns: repeat(3, 1fr); }

    /* Hide Paid column */
    .smm-de-table th:nth-child(6),
    .smm-de-table td:nth-child(6) { display: none; }
}

@media (max-width: 760px) {
    .smm-de-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Hide pending/confirmed columns */
    .smm-de-table th:nth-child(4),
    .smm-de-table td:nth-child(4),
    .smm-de-table th:nth-child(5),
    .smm-de-table td:nth-child(5) { display: none; }

    .smm-de-breakdown-inner { padding-left: 16px; }
}

@media (max-width: 600px) {
    .smm-de-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .smm-de-kpi__value { font-size: 1.25rem; }

    .smm-de-ranges { gap: 4px; }
    .smm-de-range  { padding: 6px 12px; font-size: .75rem; }

    /* Also hide Sales column */
    .smm-de-table th:nth-child(3),
    .smm-de-table td:nth-child(3) { display: none; }
}
