/* ============================================================
   Roberto MLM – Dashboard Styles
   ============================================================ */

:root {
    --rd-primary:    #2c3e50;
    --rd-accent:     #e74c3c;
    --rd-green:      #27ae60;
    --rd-gold:       #f39c12;
    --rd-light:      #ecf0f1;
    --rd-border:     #dde1e7;
    --rd-radius:     8px;
    --rd-shadow:     0 2px 12px rgba(0,0,0,0.08);
    --rd-font:       'Segoe UI', system-ui, sans-serif;
}

.roberto-dashboard {
    font-family: var(--rd-font);
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
    color: var(--rd-primary);
}

/* Header */
.rd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px;
    background: var(--rd-primary);
    color: #fff;
    border-radius: var(--rd-radius);
    margin-bottom: 24px;
}
.rd-header h2 { margin: 0 0 8px; font-size: 1.5rem; }
.rd-logout {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.rd-logout:hover { color: #fff; border-color: #fff; }

/* Badges */
.rd-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
.rd-badge--mlm          { background: var(--rd-accent);  color: #fff; }
.rd-badge--best-customer{ background: var(--rd-gold);    color: #fff; }
.rd-badge--fast-start   { background: var(--rd-green);   color: #fff; }
.rd-rank { font-size: 0.85rem; opacity: 0.85; }

/* Stats Row */
.rd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.rd-stat-card {
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    padding: 20px 22px;
    box-shadow: var(--rd-shadow);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rd-stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: #7f8c8d; }
.rd-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--rd-primary); }

/* Tabs */
.rd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--rd-border);
    margin-bottom: 24px;
}
.rd-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #7f8c8d;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.rd-tab:hover  { color: var(--rd-primary); }
.rd-tab.active { color: var(--rd-accent); border-bottom-color: var(--rd-accent); font-weight: 600; }

/* Section */
.rd-section {
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    padding: 24px 28px;
    box-shadow: var(--rd-shadow);
    margin-bottom: 20px;
}
.rd-section h3 { margin: 0 0 18px; font-size: 1.05rem; border-bottom: 1px solid var(--rd-border); padding-bottom: 10px; }

/* Info Table */
.rd-info-table { width: 100%; border-collapse: collapse; }
.rd-info-table td { padding: 9px 6px; border-bottom: 1px solid var(--rd-border); font-size: 0.9rem; }
.rd-info-table td:first-child { color: #7f8c8d; width: 38%; }

/* Data Table */
.rd-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rd-table thead th { background: var(--rd-light); padding: 10px 12px; text-align: left; font-weight: 600; }
.rd-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rd-border); }
.rd-table tbody tr:last-child td { border-bottom: none; }

/* Buttons */
.rd-btn {
    display: inline-block;
    background: var(--rd-accent);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--rd-radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.rd-btn:hover { opacity: 0.88; color: #fff; }
.rd-btn--secondary { background: var(--rd-primary); }

/* Referral */
.rd-referral-block { margin-bottom: 20px; }
.rd-referral-block label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: #7f8c8d; }
.rd-copy-row { display: flex; gap: 8px; }
.rd-copy-row input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    font-size: 0.875rem;
    background: var(--rd-light);
}
.rd-copy-row button {
    padding: 9px 16px;
    background: var(--rd-primary);
    color: #fff;
    border: none;
    border-radius: var(--rd-radius);
    cursor: pointer;
    font-size: 0.85rem;
}

/* Commission info */
.rd-commission-info p { color: #7f8c8d; font-size: 0.9rem; margin-bottom: 16px; }

/* Address grid */
.rd-address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.rd-address-grid > div { font-size: 0.9rem; line-height: 1.7; }
.rd-address-grid strong { display: block; margin-bottom: 6px; }

/* Admin type badges in orders */
.roberto-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}
.roberto-type-mlm_member    { background: #e74c3c; color: #fff; }
.roberto-type-best_customer { background: #f39c12; color: #fff; }
.roberto-type-end_customer  { background: #7f8c8d; color: #fff; }

/* Responsive */
@media (max-width: 600px) {
    .rd-address-grid { grid-template-columns: 1fr; }
    .rd-header { flex-direction: column; gap: 12px; }
    .rd-stats { grid-template-columns: 1fr 1fr; }
    .rd-stat-value { font-size: 1.2rem; }
}

/* ============================================================
   WooCommerce — Role-specific UI
   ============================================================ */

/* ── Shop & Product notices ─────────────────────────────────── */
.roberto-shop-notice,
.roberto-product-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 20px;
}
.roberto-notice-icon { font-size: 1.1rem; flex-shrink: 0; }

.roberto-notice--best-customer {
    background: #fef9e7;
    border: 1px solid #f39c12;
    color: #7d5a00;
}
.roberto-notice--best-customer .roberto-notice-icon { color: #f39c12; }

.roberto-notice--mlm {
    background: #eaf4fd;
    border: 1px solid #2980b9;
    color: #1a5276;
}
.roberto-notice--mlm .roberto-notice-icon { color: #2980b9; }

/* ── Best Customer price badge ───────────────────────────────── */
.roberto-bc-badge {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
}

/* ── MLM affiliate block on product pages ────────────────────── */
.roberto-affiliate-block {
    margin: 18px 0;
    padding: 14px 16px;
    background: #eaf4fd;
    border: 1px solid #aed6f1;
    border-radius: 6px;
}
.roberto-affiliate-block label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a5276;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.roberto-copy-row {
    display: flex;
    gap: 8px;
}
.roberto-copy-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #aed6f1;
    border-radius: 4px;
    font-size: 0.82rem;
    background: #fff;
    color: #333;
}
.roberto-copy-row button {
    padding: 8px 14px;
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.roberto-copy-row button:hover { background: #1a5276; }

/* ── WooCommerce My Account nav — role styling ───────────────── */
/* MLM Member nav accent */
.roberto-role-mlm_member .woocommerce-MyAccount-navigation ul li a {
    border-left: 3px solid var(--rd-accent, #e74c3c);
}
.roberto-role-mlm_member .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #fdf0ef;
    color: var(--rd-accent, #e74c3c);
}

/* Best Customer nav accent */
.roberto-role-best_customer .woocommerce-MyAccount-navigation ul li a {
    border-left: 3px solid #f39c12;
}
.roberto-role-best_customer .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #fef9e7;
    color: #c87f0a;
}

/* End Customer nav accent */
.roberto-role-end_customer .woocommerce-MyAccount-navigation ul li a {
    border-left: 3px solid #7f8c8d;
}

/* ── Body class per role (injected via PHP) ──────────────────── */
/* Used by the nav rules above */

/* ============================================================
   MLM Bundle — Grouped Product Display
   Individual child prices are hidden; a running total is shown
   below the table and updates as the user adjusts quantities.
   ============================================================ */

/* Clean up the grouped product table for bundles */
.woocommerce-grouped-product-list.group_table {
    border-collapse: collapse;
    width: 100%;
}
.woocommerce-grouped-product-list.group_table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eaecf0;
    vertical-align: middle;
}
.woocommerce-grouped-product-list.group_table tr:last-child td {
    border-bottom: none;
}
.woocommerce-grouped-product-list-item__quantity {
    width: 90px;
    text-align: center;
}
.woocommerce-grouped-product-list-item__label {
    padding-left: 14px !important;
    font-size: 0.95rem;
    font-weight: 500;
}
.woocommerce-grouped-product-list-item__label a {
    color: inherit;
    text-decoration: none;
}
.woocommerce-grouped-product-list-item__label a:hover {
    color: var(--rd-accent, #e74c3c);
}

/* Running total block */
.mlm-bundle-total {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 22px;
    padding: 14px 20px;
    background: #f0f7ff;
    border: 1px solid #aed6f1;
    border-radius: 6px;
}
.mlm-bundle-total-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a5276;
}
.mlm-bundle-total-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a5276;
}

@media (max-width: 480px) {
    .mlm-bundle-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
