/* =========================================================
   MD Afiliados — Stylesheet
   Dark theme: #111214 bg + neon green #0cf80e
   Font: Poppins 18px (white) / 32px Bold (green values)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Reset within plugin scope ─────────────────────────── */
.md-painel-wrap *,
.md-auth-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 50;
}

/* =========================================================
   AUTH PAGES (Login / Register)
   ========================================================= */
.md-auth-wrap {
    min-height: 100vh;
    background: #111214;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.md-auth-wrap::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 20%, rgba(12, 248, 14, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 80%, rgba(12, 248, 14, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.md-auth-box {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 0 40px rgba(12, 248, 14, 0.08), 0 30px 80px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
}

.md-auth-box--register {
    max-width: 520px;
}

.md-auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.md-auth-logo img {
    max-width: 300px;
    height: auto;
}

.md-auth-title {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0cf80e;
    margin-bottom: 6px;
}

.md-auth-sub {
    color: #888;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 28px;
}

/* ── Form elements ── */
.md-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.md-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.md-field label {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.md-field label .req {
    color: #0cf80e;
}

.md-field input[type="text"],
.md-field input[type="email"],
.md-field input[type="password"],
.md-field input[type="number"] {
    background: #1a1c1e;
    border: 1.5px solid #2a2c2e;
    border-radius: 10px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    padding: 12px 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.md-field input:focus {
    border-color: #0cf80e;
    box-shadow: 0 0 0 3px rgba(12, 248, 14, 0.12);
}

.md-input-icon-wrap {
    position: relative;
}

.md-input-icon-wrap input {
    padding-right: 44px;
}

.md-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 16px;
    padding: 4px;
}

.md-eye-btn:hover {
    color: #0cf80e;
}

.md-field-row {
    display: flex;
    gap: 16px;
}

.md-field-row .md-field {
    flex: 1;
}

.md-btn-primary {
    background: #0cf80e;
    border: none;
    border-radius: 10px;
    color: #000;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 24px;
    transition: transform .15s, box-shadow .15s, opacity .2s;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.md-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity .2s;
}

.md-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(12, 248, 14, 0.35);
}

.md-btn-primary:hover:not(:disabled)::after {
    opacity: 1;
}

.md-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.md-strength-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1c1e;
    border-radius: 6px;
    padding: 6px 10px;
}

.md-strength-bar {
    height: 4px;
    border-radius: 4px;
    transition: all .3s;
    width: 0%;
    background: #333;
}

#md-strength-label {
    font-size: 12px;
    color: #aaa;
}

.md-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
}

.md-check-label input {
    margin-top: 2px;
    accent-color: #0cf80e;
}

.md-check-label a {
    color: #0cf80e;
}

.md-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 4px;
    font-family: 'Poppins', sans-serif;
}

.md-msg-success {
    background: rgba(12, 248, 14, 0.1);
    border: 1px solid rgba(12, 248, 14, 0.3);
    color: #0cf80e;
}

.md-msg-error {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.md-auth-footer {
    text-align: center;
    margin-top: 24px;
    color: #666;
    font-size: 14px;
}

.md-auth-footer a {
    color: #0cf80e;
    text-decoration: none;
    font-weight: 600;
}

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */
.md-painel-wrap {
    background: #111214;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: #fff;
}

/* ── NAVBAR ──────────────────────────────────────────────── */
.md-nav {
    background: #111214;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px 60px;
    min-height: 80px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.md-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.md-nav-brand img {
    max-height: 150px;
    width: auto;
}

.md-nav-brand-text {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}

.md-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    padding: 8px 16px;
    border-radius: 8px;
    transition: color .2s, background .2s;
    cursor: pointer;
}

.md-nav-link:hover {
    color: #0cf80e;
    background: rgba(12, 248, 14, 0.05);
}

.md-nav-link--active {
    color: #0cf80e;
    font-weight: 700;
}

.md-nav-logout {
    color: #e74c3c !important;
    margin-left: 8px;
}

.md-nav-logout:hover {
    background: rgba(231, 76, 60, 0.1) !important;
    color: #e74c3c !important;
}

.md-nav-burger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
}

/* ── TABS ─────────────────────────────────────────────────── */
.md-tab {
    display: none;
}

.md-tab--active {
    display: block;
}

.md-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

/* ── HERO CARD ───────────────────────────────────────────── */
.md-hero-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
}

.md-hero-card::before {
    display: none;
}

.md-hero-left {
    flex: 1;
}

.md-hero-saudacao {
    color: #fff;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 0;
}

.md-hero-nome {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #fff;
    margin-bottom: 2px;
    letter-spacing: 0;
    display: inline;
}

.md-hero-tier-inline {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0cf80e;
    display: block;
    margin-top: 2px;
}

/* Tier progress bar */
.md-tier-bar-wrap {
    position: relative;
    padding-bottom: 14px;
    max-width: 400px;
}

.md-tier-labels {
    position: relative;
    height: 52px;
    margin-bottom: 10px;
}

.md-tier-point {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
}

.md-tier-point:first-child {
    left: 0;
    transform: none;
}

.md-tier-point:last-child {
    right: 0;
    left: auto;
    transform: none;
}

.md-tier-amount {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
}

.md-medal {
    cursor: default;
}

.md-medal--active svg {
    filter: drop-shadow(0 0 8px currentColor);
}

.md-tier-track {
    height: 8px;
    background: #2a2c2e;
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.md-tier-fill {
    height: 100%;
    background: #0cf80e;
    border-radius: 4px;
    transition: width 1s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 10px rgba(12, 248, 14, 0.3);
}

.md-tier-label-text {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
}

.md-hero-right {
    text-align: right;
    flex-shrink: 0;
    padding-left: 40px;
}

.md-hero-label {
    color: #fff;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.md-hero-value {
    font-family: 'Poppins', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #0cf80e;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 12px;
}

.md-tier-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Poppins', sans-serif;
}

/* ── CARDS ────────────────────────────────────────────────── */
.md-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.md-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 16px;
    padding: 24px 26px;
}

.md-card-header {
    margin-bottom: 6px;
}

.md-card-title {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.md-card-value-big {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0cf80e;
    margin: 6px 0 16px;
}

.md-chart-wrap {
    position: relative;
    height: 180px;
}

.md-divider {
    height: 1px;
    background: #2a2c2e;
    margin: 16px 0;
}

/* Product list */
.md-product-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.md-product-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
}

.md-product-name {
    flex: 1;
    color: #fff;
    font-size: 18px;
}

.md-product-qty {
    color: #fff;
    font-size: 18px;
    white-space: nowrap;
}

.md-product-rev {
    color: #0cf80e;
    font-weight: 700;
    font-size: 18px;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* Affiliate links list */
.md-link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.md-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.md-link-name {
    color: #fff;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    flex: 1;
}

.md-copy-btn {
    background: transparent;
    border: 1.5px solid #0cf80e;
    border-radius: 8px;
    color: #0cf80e;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.md-copy-btn:hover {
    background: rgba(12, 248, 14, 0.1);
}

.md-codigo-wrap {
    margin-top: 16px;
    font-size: 14px;
    color: #888;
    font-family: 'Poppins', sans-serif;
}

.md-codigo {
    color: #0cf80e;
    font-family: monospace;
    font-size: 15px;
}

.md-empty {
    color: #555;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    padding: 24px 0;
}

/* ── SECTION PAGES ───────────────────────────────────────── */
.md-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0cf80e;
    margin-bottom: 6px;
}

.md-section-sub {
    color: #888;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 28px;
}

/* Stats row */
.md-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.md-stat-box {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 14px;
    padding: 20px 26px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.md-stat-box--gold {
    border-color: #0cf80e;
}

.md-stat-label {
    color: #fff;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    text-transform: none;
    letter-spacing: 0;
}

.md-stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0cf80e;
}

.md-stat-box--gold .md-stat-value {
    color: #0cf80e;
}

/* Bottom Cards — Pagamentos + Saque */
.md-bottom-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.md-bottom-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 16px;
    padding: 24px 28px;
}

.md-bottom-card-title {
    color: #fff;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    margin-bottom: 16px;
}

.md-bottom-card-value {
    font-family: 'Poppins', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #0cf80e;
    text-align: right;
}

.md-bottom-card .md-divider {
    margin: 12px 0;
}

/* Products grid */
.md-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.md-product-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s;
}

.md-product-card:hover {
    border-color: #0cf80e;
    box-shadow: 0 0 20px rgba(12, 248, 14, 0.15);
}

.md-product-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.md-product-card-info {
    padding: 18px;
}

.md-product-card-info h3 {
    font-size: 18px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 6px;
}

.md-product-price {
    color: #0cf80e;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
}

.md-product-commission {
    color: #888;
    font-size: 14px;
    margin-bottom: 14px;
}

.md-link-input-wrap {
    display: flex;
    gap: 6px;
}

.md-link-input {
    flex: 1;
    background: #1a1c1e;
    border: 1px solid #2a2c2e;
    border-radius: 8px;
    color: #aaa;
    font-size: 12px;
    padding: 8px 10px;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

.md-copy-btn--inline {
    background: rgba(12, 248, 14, 0.1);
    border: 1.5px solid #0cf80e;
    border-radius: 8px;
    color: #0cf80e;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    white-space: nowrap;
    transition: background .2s;
    font-family: 'Poppins', sans-serif;
}

.md-copy-btn--inline:hover {
    background: rgba(12, 248, 14, 0.2);
}

/* Table */
.md-table-wrap {
    overflow-x: auto;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
}

.md-table th {
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1.5px solid #0cf80e;
    font-weight: 600;
}

.md-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #1e2022;
    color: #fff;
    font-size: 18px;
}

.md-table tr:hover td {
    background: rgba(12, 248, 14, 0.03);
}

.md-status {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.md-status-success,
.md-status-aprovado,
.md-status-pago {
    background: rgba(12, 248, 14, 0.12);
    color: #0cf80e;
}

.md-status-warn,
.md-status-pendente {
    background: rgba(255, 165, 0, 0.12);
    color: #ffa500;
}

.md-status-error,
.md-status-cancelado {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.md-loading,
.md-empty {
    text-align: center;
    color: #555;
    padding: 40px;
    font-family: 'Poppins', sans-serif;
}

/* Account */
.md-account-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.md-account-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.md-account-avatar {
    width: 72px;
    height: 72px;
    background: #0cf80e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #000;
    flex-shrink: 0;
}

.md-account-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.md-account-info p {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
}

.md-account-code {
    color: #888 !important;
    margin-top: 8px !important;
}

.md-form-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 16px;
    padding: 32px;
}

.md-form-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

/* Empty state */
.md-empty-state {
    text-align: center;
    padding: 60px 0;
}

.md-empty-state p {
    color: #888;
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
}

.md-empty-sub {
    color: #555 !important;
    font-size: 14px !important;
    margin-top: 8px;
}

/* Toast */
.md-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #111214;
    border: 1.5px solid #0cf80e;
    color: #0cf80e;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(12, 248, 14, 0.15);
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .md-cards-row {
        grid-template-columns: 1fr 1fr;
    }

    .md-cards-row .md-card:first-child {
        grid-column: 1/-1;
    }
}

@media (max-width: 768px) {
    .md-nav {
        padding: 0 20px;
        height: 64px;
    }

    .md-nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #111214;
        flex-direction: column;
        padding: 12px 0;
        border-bottom: 1.5px solid #0cf80e;
    }

    .md-nav-links.open {
        display: flex;
    }

    .md-nav-burger {
        display: block;
    }

    .md-content {
        padding: 20px 16px 48px;
    }

    .md-hero-card {
        flex-direction: column;
        gap: 24px;
    }

    .md-hero-right {
        text-align: left;
        padding-left: 0;
    }

    .md-hero-nome {
        font-size: 20px;
    }

    .md-hero-value {
        font-size: 30px;
    }

    .md-cards-row {
        grid-template-columns: 1fr;
    }

    .md-cards-row .md-card:first-child {
        grid-column: auto;
    }

    .md-bottom-cards {
        grid-template-columns: 1fr;
    }

    .md-account-wrap {
        grid-template-columns: 1fr;
    }

    .md-stats-row {
        flex-direction: column;
    }

    .md-auth-box {
        padding: 32px 24px;
    }

    .md-field-row.md-2col {
        flex-direction: column;
    }

    .md-tier-bar-wrap {
        max-width: 100%;
    }

    .md-nav-brand img {
        max-height: 50px;
    }

    .md-nav-link {
        font-size: 16px;
    }
}

/* =========================================================
   EXTERNAL ADMIN PANEL — additions
   ========================================================= */

/* Admin nav badge */
.md-nav-badge-admin {
    background: #0cf80e;
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 4px;
}

.md-nav-wp-link {
    color: #0cf80e !important;
    font-weight: 600;
}

.md-nav-wp-link:hover {
    background: rgba(12, 248, 14, 0.1) !important;
}

/* Hero admin variant */
.md-hero-card--admin {
    background: transparent;
    border: none;
}

.md-hero-role {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif;
}

.md-admin-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.md-btn-ghost {
    background: transparent;
    border: 1.5px solid #0cf80e;
    border-radius: 10px;
    color: #0cf80e;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
}

.md-btn-ghost:hover {
    color: #000;
    background: #0cf80e;
}

/* Stats grid - 3×2 */
.md-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.md-stat-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateY(8px);
    opacity: 0;
    transition: transform .4s, opacity .4s, border-color .2s;
}

.md-stat-card--loaded {
    transform: translateY(0);
    opacity: 1;
}

.md-stat-card--warn {
    border-left: 3px solid #ffa500;
}

.md-stat-card--gold {
    border-left: 3px solid #0cf80e;
}

.md-stat-card--success {
    border-left: 3px solid #0cf80e;
}

.md-stat-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.md-stat-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.md-stat-card-label {
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.md-stat-card-value {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.md-stat-card--gold .md-stat-card-value {
    color: #0cf80e;
}

.md-stat-card--warn .md-stat-card-value {
    color: #ffa500;
}

.md-stat-card--success .md-stat-card-value {
    color: #0cf80e;
}

/* Chart card */
.md-chart-card {
    margin-bottom: 0;
}

/* Section header with filters */
.md-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.md-section-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.md-select {
    background: #1a1c1e;
    border: 1.5px solid #2a2c2e;
    border-radius: 10px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    padding: 9px 14px;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    min-width: 180px;
}

.md-select:focus {
    border-color: #0cf80e;
}

.md-select option {
    background: #1a1c1e;
}

.md-search-wrap {
    position: relative;
}

.md-search-input {
    background: #1a1c1e;
    border: 1.5px solid #2a2c2e;
    border-radius: 10px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    padding: 9px 14px;
    outline: none;
    width: 280px;
    transition: border-color .2s;
}

.md-search-input:focus {
    border-color: #0cf80e;
}

/* Affiliate cards grid */
.md-aff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.md-aff-card {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all .2s;
}

.md-aff-card:hover {
    box-shadow: 0 0 20px rgba(12, 248, 14, 0.1);
}

.md-aff-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.md-aff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.md-aff-info {
    flex: 1;
    min-width: 0;
}

.md-aff-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-aff-info p {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-aff-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding: 14px;
    background: rgba(12, 248, 14, 0.03);
    border-radius: 10px;
}

.md-aff-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-aff-meta-label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.md-aff-meta-item span,
.md-aff-meta-item code {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.md-aff-meta-item code {
    font-family: monospace;
    color: #0cf80e;
    background: rgba(12, 248, 14, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.md-aff-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.md-btn-success {
    background: rgba(12, 248, 14, 0.1);
    border: 1.5px solid #0cf80e;
    border-radius: 8px;
    color: #0cf80e;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    transition: all .2s;
    flex: 1;
}

.md-btn-success:hover:not(:disabled) {
    background: rgba(12, 248, 14, 0.2);
}

.md-btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.md-btn-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 8px;
    color: #e74c3c;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    transition: all .2s;
    flex: 1;
}

.md-btn-danger:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* Payments summary */
.md-payments-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

/* Loading + empty states */
.md-loading-state {
    text-align: center;
    color: #555;
    font-size: 14px;
    padding: 60px 0;
    animation: md-pulse 1.5s ease-in-out infinite;
    font-family: 'Poppins', sans-serif;
}

@keyframes md-pulse {

    0%,
    100% {
        opacity: .4
    }

    50% {
        opacity: 1
    }
}

/* Modal */
.md-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.md-modal {
    background: #111214;
    border: 1.5px solid #0cf80e;
    border-radius: 20px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(12, 248, 14, 0.1), 0 30px 80px rgba(0, 0, 0, 0.7);
}

.md-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid #2a2c2e;
}

.md-modal-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.md-modal-close {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .2s;
}

.md-modal-close:hover {
    color: #0cf80e;
}

.md-modal-body {
    padding: 24px 28px;
}

/* Pagination */
.md-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.md-page-btn {
    background: #111214;
    border: 1.5px solid #2a2c2e;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 14px;
    transition: all .2s;
    font-family: 'Poppins', sans-serif;
}

.md-page-btn:hover {
    color: #0cf80e;
    border-color: #0cf80e;
}

.md-page-btn--active {
    background: rgba(12, 248, 14, 0.1);
    border-color: #0cf80e;
    color: #0cf80e;
}

/* ── ADMIN RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .md-admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .md-admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .md-aff-grid {
        grid-template-columns: 1fr;
    }

    .md-section-header {
        flex-direction: column;
    }

    .md-payments-summary {
        flex-direction: column;
    }

    .md-search-input {
        width: 100%;
    }
}