/* ================================================================
   Store MM — Designers Earnings  (designers-earnings.css)
   Admin platform-wide earnings overview
   ================================================================ */

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

/* ---- Notice ----------------------------------------------------------- */
.smm-de-notice {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: .9rem;
    color: #374151;
}
.smm-de-notice a { color: #d97706; 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: #6b7280;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    transition: all .15s ease;
    white-space: nowrap;
}

.smm-de-range:hover {
    color: #374151;
    border-color: #d1d5db;
    background: #f9fafb;
    text-decoration: none;
}

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

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

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

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

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

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

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

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

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

.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: #fef9c3; color: #a16207; }
.smm-de-kpi__split--confirmed { background: #dcfce7; color: #15803d; }

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

.smm-de-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 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.smm-de-section__title .dashicons {
    color: #6d28d9;
    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: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 9px 14px;
    border-bottom: 2px solid #f3f4f6;
    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 #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.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: #111827;
}

.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: #6d28d9; }
.smm-de-td--pending  { color: #a16207; }
.smm-de-td--confirmed { color: #15803d; }

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

.smm-de-expand-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    padding: 4px 7px;
    cursor: pointer;
    color: #9ca3af;
    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: #6d28d9;
    border-color: #6d28d9;
    background: #faf5ff;
}

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

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

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

.smm-de-breakdown-inner {
    padding: 16px 20px 16px 52px; /* indent to align with content */
    background: #f9fafb;
}

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

.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: 700px;
    border-collapse: collapse;
    font-size: .82rem;
}

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

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

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

.smm-de-breakdown-product { font-weight: 600; color: #111827; }

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

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

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

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

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

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

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

    /* Hide pending/confirmed split 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: 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; }
}
