/* ==========================================================================
   TF MEMBERSHIP - IMPROVED DESIGN SYSTEM (v5.0)
   Based on ui-ux-pro-max analysis & WCAG AA compliance
   Changes from v4.2:
   · Better color contrast (WCAG AA compliant)
   · Stone palette — warmer, more readable than cold gray
   · Amber-500 (#CA8A04) CTA replaces old gold (#B08D57)
   · Unified semantic status palette
   · Layered shadow system (xs/sm/md/lg/xl)
   · Consistent 4px spacing grid
   · prefers-reduced-motion support
   · Improved focus-visible states
   · Ghost button & card-interactive variants
   · Cleaner radius scale (sm/md/lg/xl/full)
   ========================================================================== */

:root {
    /* === PRIMARY NEUTRALS — Stone (warm, readable) === */
    --tf-stone-950: #0C0A09;   /* text primary */
    --tf-stone-900: #1C1917;   /* headings, strong emphasis */
    --tf-stone-800: #292524;   /* secondary backgrounds */
    --tf-stone-700: #44403C;   /* body text */
    --tf-stone-600: #57534E;   /* placeholder text */
    --tf-stone-500: #78716C;   /* disabled, muted */
    --tf-stone-400: #A8A29E;   /* borders, dividers */
    --tf-stone-300: #D6D3D1;   /* subtle borders */
    --tf-stone-200: #E7E5E4;   /* card borders */
    --tf-stone-100: #F5F5F4;   /* page background */
    --tf-stone-50:  #FAFAF9;   /* surface white */
    --tf-white:     #FFFFFF;

    /* === AMBER ACCENT — refined gold with better contrast === */
    --tf-amber-600: #A16207;   /* text on light bg */
    --tf-amber-500: #CA8A04;   /* primary CTA */
    --tf-amber-400: #EAB308;   /* hover accent */
    --tf-amber-200: #FDE047;   /* highlight */
    --tf-amber-100: #FEF9C3;   /* subtle tint */
    --tf-amber-50:  #FFFBEB;   /* warm background */

    /* === FUNCTIONAL STATUS — unified semantic palette === */
    --tf-status-baru:     #1E293B;  /* neutral */
    --tf-status-proses:   #4338CA;  /* purple */
    --tf-status-kirim:    #0369A1;  /* info */
    --tf-status-terkirim: #CA8A04;  /* amber */
    --tf-status-selesai:  #059669;  /* success */
    --tf-status-retur:    #D97706;  /* warning */
    --tf-status-batal:    #DC2626;  /* error */

    /* === STATUS BACKGROUNDS — muted variants for badges === */
    --tf-bg-baru:     #E2E8F0;
    --tf-bg-proses:   #EEF2FF;
    --tf-bg-kirim:    #E0F2FE;
    --tf-bg-terkirim: #FEF9C3;
    --tf-bg-selesai:  #D1FAE5;
    --tf-bg-retur:    #FEF3C7;
    --tf-bg-batal:    #FEE2E2;

    /* === SPACING SCALE (4px base grid) === */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;

    /* === RADIUS SYSTEM === */
    --tf-radius-sm:    6px;
    --tf-radius-md:    10px;
    --tf-radius-lg:    14px;
    --tf-radius-xl:    20px;
    --tf-radius-badge: 999px;

    /* === LAYERED SHADOWS === */
    --tf-shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --tf-shadow-sm: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.04);
    --tf-shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --tf-shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --tf-shadow-xl: 0 16px 40px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.04);

    /* === TYPOGRAPHY === */
    --tf-font-family: 'Satoshi', sans-serif;
    --tf-font-mono: 'Satoshi', sans-serif;

    /* Type scale */
    --text-xs:   11px;
    --text-sm:   13px;
    --text-base: 14px;
    --text-md:   15px;
    --text-lg:   16px;
    --text-xl:   18px;
    --text-2xl:  20px;
    --text-3xl:  24px;
    --text-4xl:  30px;

    /* Line heights */
    --leading-tight:   1.25;
    --leading-normal:  1.5;
    --leading-relaxed: 1.65;

    /* === TRANSITIONS === */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast:   150ms;
    --duration-normal: 250ms;
    --duration-slow:   350ms;
    --tf-transition:        all var(--duration-normal) var(--ease-out);
    --tf-transition-smooth: all var(--duration-normal) var(--ease-in-out);

    /* === Z-INDEX SCALE === */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    9999;
    --z-toast:    10000;

    /* === BACKWARD COMPAT ALIASES (v4.x) === */
    --tf-black-950: var(--tf-stone-950);
    --tf-black-900: var(--tf-stone-900);
    --tf-black-800: var(--tf-stone-800);
    --tf-gray-700:  var(--tf-stone-700);
    --tf-gray-500:  var(--tf-stone-500);
    --tf-gray-400:  var(--tf-stone-400);
    --tf-gray-300:  var(--tf-stone-300);
    --tf-gray-200:  var(--tf-stone-200);
    --tf-gray-100:  var(--tf-stone-100);
    --tf-gold-500:  var(--tf-amber-500);
    --tf-gold-300:  var(--tf-amber-100);
    --tf-gold-100:  var(--tf-amber-50);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: var(--duration-fast) !important;
    }
}

/* ── Focus state global ── */
*:focus-visible {
    outline: 2px solid var(--tf-amber-500);
    outline-offset: 2px;
}

a:focus,
a:active {
    outline: none;
    box-shadow: none;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--tf-stone-100); }
::-webkit-scrollbar-thumb { background: var(--tf-stone-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--tf-amber-500); }


/* --- [ 1. TYPOGRAPHY & BASE ] --- */
.tf-wrap,
.tf-member-container,
.admin-tf {
    font-family: var(--tf-font-family);
    color: var(--tf-stone-700);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
}

.tf-title,
h1, h2, h3, h4 {
    color: var(--tf-stone-900);
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.01em;
}

.tf-wrap h4 {
    margin-top: 0;
}


/* --- [ 2. UTILITY CLASSES ] --- */
.tf-text-gold   { color: var(--tf-amber-500); }
.tf-text-black  { color: var(--tf-stone-900); }
.tf-text-muted  { color: var(--tf-stone-500); }
.tf-bg-black    { background-color: var(--tf-stone-900); color: var(--tf-white); }
.tf-bg-gold     { background-color: var(--tf-amber-500); color: var(--tf-white); }

.tf-flex         { display: flex; }
.tf-flex-between { display: flex; justify-content: space-between; align-items: center; }
.tf-flex-center  { display: flex; justify-content: center; align-items: center; }
.tf-gap-1 { gap: var(--space-2); }
.tf-gap-2 { gap: var(--space-4); }
.tf-gap-3 { gap: var(--space-6); }
.tf-mt-2  { margin-top: var(--space-4); }
.tf-mb-2  { margin-bottom: var(--space-4); }
.tf-mb-3  { margin-bottom: var(--space-6); }

/* Utility 5-kolom dashboard */
.tf-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
@media screen and (max-width: 1024px) { .tf-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media screen and (max-width: 600px)  { .tf-grid-5 { grid-template-columns: 1fr; } }


/* --- [ 3. LAYOUT & ELEVATION ] --- */
.tf-wrap,
.tf-inner,
.tf-catalog-container {
    background: var(--tf-white);
    border-radius: var(--tf-radius-lg);
    padding: var(--space-8);
    border: 1px solid var(--tf-stone-200);
    box-shadow: var(--tf-shadow-sm);
}

.tf-inner-box {
    border-radius: var(--tf-radius-md);
    margin-bottom: var(--space-6);
    border: 1px solid var(--tf-stone-200);
    padding: var(--space-6);
    background: var(--tf-stone-50);
}

/* Card interactive — subtle 2px lift */
.tf-card-lift {
    transition: var(--tf-transition);
}
.tf-card-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--tf-shadow-lg);
    border-color: var(--tf-stone-300);
}


/* --- [ 3b. FORM SECTION LAYOUT ] --- */
.tf-form-section {
    margin-bottom: var(--space-6);
}

/* Section title */
.tf-form-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tf-stone-500);
    background: var(--tf-stone-100);
    border-left: 3px solid var(--tf-amber-500);
    padding: var(--space-2) 14px;
    border-radius: 0 var(--tf-radius-sm) var(--tf-radius-sm) 0;
    margin: 0 0 var(--space-5) 0;
}

.tf-form-group {
    margin-bottom: var(--space-5);
}

.tf-form-group:last-child {
    margin-bottom: 0;
}

.tf-required {
    color: var(--tf-status-batal);
    margin-left: 2px;
}

.tf-help-text {
    font-size: var(--text-xs);
    color: var(--tf-stone-500);
    margin: var(--space-1) 0 0 0;
    line-height: var(--leading-normal);
}

/* Input alias */
.tf-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--tf-white);
    border: 1.5px solid var(--tf-stone-300);
    border-radius: var(--tf-radius-md);
    padding: 10px 14px;
    color: var(--tf-stone-900);
    font-family: var(--tf-font-family);
    font-size: var(--text-base);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.tf-input::placeholder { color: var(--tf-stone-400); }

.tf-input:focus {
    outline: none;
    border-color: var(--tf-amber-500);
    background: var(--tf-white);
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.15);
}

/* Two-column field row */
.tf-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 600px) {
    .tf-form-row-2 { grid-template-columns: 1fr; }
}


/* --- [ 4. FORMS & INPUTS ] --- */
.tf-wrap input[type="text"],
.tf-wrap input[type="number"],
.tf-wrap input[type="email"],
.tf-wrap input[type="password"],
.tf-wrap select,
.tf-wrap textarea {
    background: var(--tf-white);
    border: 1.5px solid var(--tf-stone-300);
    border-radius: var(--tf-radius-md);
    padding: 10px 14px;
    color: var(--tf-stone-900);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    width: 100%;
    box-sizing: border-box;
    font-family: var(--tf-font-family);
    font-size: var(--text-base);
}

.tf-wrap input::placeholder,
.tf-wrap textarea::placeholder {
    color: var(--tf-stone-400);
}

.tf-wrap input:focus,
.tf-wrap select:focus,
.tf-wrap textarea:focus {
    outline: none;
    border-color: var(--tf-amber-500);
    background: var(--tf-white);
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.15);
}

.tf-input-error {
    border-color: var(--tf-status-batal) !important;
    background-color: #FEF2F2 !important;
}

.tf-input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.tf-input-success {
    border-color: var(--tf-status-selesai) !important;
    background-color: #ECFDF5 !important;
}

.tf-input-disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: var(--tf-stone-100) !important;
    color: var(--tf-stone-400) !important;
    cursor: not-allowed;
}

.tf-input-readonly,
input[readonly],
select[readonly] {
    background: var(--tf-stone-50) !important;
    border-style: dashed;
    color: var(--tf-stone-600);
}

.tf-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--tf-stone-800);
    font-size: var(--text-sm);
}


/* --- [ 5. BUTTONS ] --- */

/* Primary — dark stone with amber hover */
.tf-btn-primary,
.checkout,
.button-primary,
.tf-add-cart .active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background-color: var(--tf-stone-900);
    color: var(--tf-white);
    border: none;
    border-radius: var(--tf-radius-md);
    padding: 10px var(--space-5);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--tf-transition);
    white-space: nowrap;
    box-shadow: var(--tf-shadow-xs);
}

.tf-btn-primary:hover,
.checkout:hover,
.button-primary:hover,
.tf-add-cart .active:hover {
    background-color: var(--tf-amber-500);
    color: var(--tf-white);
    transform: translateY(-1px);
    box-shadow: var(--tf-shadow-md);
}

.tf-btn-primary:focus-visible,
.checkout:focus-visible,
.button-primary:focus-visible {
    outline: 2px solid var(--tf-amber-500);
    outline-offset: 2px;
}

/* Secondary */
.tf-btn-secondary,
.update-cart {
    background-color: var(--tf-stone-100);
    color: var(--tf-stone-800);
    border: 1px solid var(--tf-stone-300);
    border-radius: var(--tf-radius-md);
    padding: 10px var(--space-5);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--tf-transition);
}

.tf-btn-secondary:hover,
.update-cart:hover {
    background-color: var(--tf-stone-200);
    border-color: var(--tf-stone-400);
}

/* Ghost */
.tf-btn-ghost {
    background: transparent;
    color: var(--tf-stone-700);
    border: none;
    border-radius: var(--tf-radius-md);
    padding: 10px var(--space-5);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--tf-transition);
}

.tf-btn-ghost:hover {
    background: var(--tf-stone-100);
    color: var(--tf-stone-900);
}

/* Danger */
.tf-btn-danger {
    background-color: #FEE2E2;
    color: var(--tf-status-batal);
    border: 1px solid #FECACA;
    border-radius: var(--tf-radius-md);
    padding: 10px var(--space-5);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--tf-transition);
}

.tf-btn-danger:hover {
    background-color: var(--tf-status-batal);
    color: var(--tf-white);
    border-color: var(--tf-status-batal);
}

/* Disabled */
.tf-btn-disabled,
.tf-add-cart .disabled {
    background: var(--tf-stone-200);
    color: var(--tf-stone-400);
    cursor: not-allowed;
    border: none;
    padding: 10px var(--space-5);
    border-radius: var(--tf-radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: none;
}

/* Loading state */
.tf-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.tf-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
}


/* --- [ 6. BADGES & STATUS ] --- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--tf-radius-badge);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}

/* Member status */
.badge-status-aktif    { background: var(--tf-bg-baru);   color: var(--tf-status-baru); }
.badge-status-suspend  { background: var(--tf-bg-batal);  color: var(--tf-status-batal); }
.badge-status-nonaktif { background: var(--tf-bg-retur);  color: var(--tf-status-retur); }

/* Order status */
.badge-status-baru,
.badge-status-Baru                { background: var(--tf-bg-baru);     color: var(--tf-status-baru); }
.badge-status-proses,
.badge-status-Proses              { background: var(--tf-bg-proses);   color: var(--tf-status-proses); }
.badge-status-kirim,
.badge-status-Kirim               { background: var(--tf-bg-kirim);    color: var(--tf-status-kirim); }
.badge-status-terkirim,
.badge-status-Terkirim            { background: var(--tf-bg-terkirim); color: var(--tf-amber-600); }
.badge-status-selesai,
.badge-status-Selesai             { background: var(--tf-bg-selesai);  color: var(--tf-status-selesai); }
.badge-status-retur,
.badge-status-Retur               { background: var(--tf-bg-retur);    color: var(--tf-status-retur); }
.badge-status-batal,
.badge-status-Batal               { background: var(--tf-bg-batal);    color: var(--tf-status-batal); }
.badge-status-dibatalkan,
.badge-status-Dibatalkan          { background: var(--tf-bg-batal);    color: var(--tf-status-batal); }

/* DO status — Dibuat */
.badge-status-dibuat,
.badge-status-Dibuat              { background: var(--tf-stone-200); color: var(--tf-stone-600); }

/* Sales assist — menunggu konfirmasi */
.badge-status-menunggu,
.badge-status-menunggu-konfirmasi { background: var(--tf-bg-proses); color: var(--tf-status-proses); }

/* Return status */
.badge-return-pending  { background: var(--tf-bg-retur);   color: var(--tf-status-retur);   border: 1px solid #FDE68A; }
.badge-return-partial  { background: var(--tf-bg-kirim);   color: var(--tf-status-kirim);   border: 1px solid #BAE6FD; }
.badge-return-approved { background: var(--tf-bg-selesai); color: var(--tf-status-selesai); border: 1px solid #A7F3D0; }
.badge-return-rejected { background: var(--tf-bg-batal);   color: var(--tf-status-batal);   border: 1px solid #FECACA; }

/* Payment status */
.tf-badge-pending { background: var(--tf-bg-retur);   color: var(--tf-status-retur); }
.tf-badge-success { background: var(--tf-bg-selesai); color: var(--tf-status-selesai); }
.tf-badge-partial { background: var(--tf-bg-kirim);   color: var(--tf-status-kirim); border: 1px solid #BAE6FD; }

/* Type badges */
.tf-badge-sales   { background: var(--tf-stone-800); color: var(--tf-white); }
.tf-badge-mandiri { background: var(--tf-amber-100); color: var(--tf-amber-600); border: 1px solid #FDE68A; }

/* Role badges */
.tf-acc-role-badge,
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--tf-radius-badge);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--tf-white);
    background: var(--tf-stone-600);
}
.tf-acc-role-badge.manager,    .role-badge.manager    { background: #0369A1; }
.tf-acc-role-badge.purchasing, .role-badge.purchasing { background: #059669; }
.tf-acc-role-badge.finance,    .role-badge.finance    { background: #7C3AED; }


/* --- [ 7. TABLES ] --- */
.tf-table-wrapper {
    overflow-x: auto;
    border-radius: var(--tf-radius-lg);
    border: 1px solid var(--tf-stone-200);
    box-shadow: var(--tf-shadow-xs);
    margin-bottom: var(--space-6);
}

.tf-table {
    width: 100%;
    border-collapse: collapse;
}

.tf-table th {
    background-color: var(--tf-stone-100);
    color: var(--tf-stone-700);
    font-weight: 700;
    padding: 14px 16px;
    text-align: left;
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--tf-stone-200);
}

.tf-table td {
    padding: 14px 16px;
    color: var(--tf-stone-700);
    border-bottom: 1px solid var(--tf-stone-100);
    font-size: var(--text-sm);
    vertical-align: middle;
    transition: background-color var(--duration-fast) var(--ease-out);
}

.tf-table tbody tr:hover td {
    background-color: var(--tf-stone-50);
}

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

/* Strikethrough for batal/canceled */
.batal td,
.canceled td,
.strikethrough td {
    text-decoration: line-through;
    text-decoration-color: var(--tf-stone-400);
    color: var(--tf-stone-400);
}

.store-title {
    display: flex;
    max-width: 200px;
    flex-direction: row;
    gap: 10px;
}

.store-title img { max-width: 100px; }

.store-title .store-name {
    line-height: 1.5;
    font-weight: 700;
    flex: 1;
}

.tf-detail-content { margin-bottom: var(--space-8); }


/* --- [ 8. NOTICES / ALERTS ] --- */
.tf-notice {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--tf-radius-md);
    margin-bottom: var(--space-6);
    font-weight: 500;
    font-size: var(--text-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    border-left: 4px solid;
}

.tf-notice-success { background: #ECFDF5; color: #065F46; border-color: var(--tf-status-selesai); }
.tf-notice-error   { background: #FEF2F2; color: #991B1B; border-color: var(--tf-status-batal); }
.tf-notice-warning { background: #FFFBEB; color: #92400E; border-color: var(--tf-status-retur); }
.tf-notice-info    { background: #F0F9FF; color: #075985; border-color: var(--tf-status-kirim); }


/* --- [ 9. PRODUCT & CATALOG CARDS ] --- */
.tf-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-6);
}

.tf-product-card {
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg);
    padding: var(--space-5);
    text-align: center;
    box-shadow: var(--tf-shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.tf-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tf-shadow-xl);
    border-color: var(--tf-amber-400);
}

.tf-product-image-wrap {
    background: var(--tf-stone-100);
    border-radius: var(--tf-radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.tf-product-card img { border-radius: var(--tf-radius-sm); }

.tf-product-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: var(--space-2) 0;
    color: var(--tf-stone-900);
}

.tf-stock-info { font-size: var(--text-xs); color: var(--tf-stone-500); }

.tf-product-price {
    color: var(--tf-amber-500);
    font-weight: 700;
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

/* Cart */
.cart-summary {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg);
}

.cart-summary-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.tf-cart-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.tf-cart-card-item {
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-md);
    padding: var(--space-4);
    position: relative;
}

.tf-card-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--tf-status-batal);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
}

.tf-card-price-row {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
    padding-top: 10px;
    border-top: 1px dashed var(--tf-stone-200);
}

.tf-cart-card-detail {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.tf-cart-card-detail .tf-title { margin-bottom: 0; }

.modal-status {
    margin: 12px 0;
    text-align: right;
}

/* ── Account form card (tf-acc-*) ── */
.tf-acc-wrap { font-family: var(--tf-font-family); max-width: 860px; margin: 0 auto; color: var(--tf-stone-900); }
.tf-acc-wrap h2 { font-size: var(--text-2xl); font-weight: 700; margin: 0 0 20px; }

.tf-acc-card {
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg);
    padding: 24px 28px;
    margin-bottom: var(--space-6);
    box-shadow: var(--tf-shadow-sm);
}
.tf-acc-card h3 {
    font-size: var(--text-md);
    font-weight: 700;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tf-stone-200);
}
.tf-acc-field { margin-bottom: var(--space-4); }
.tf-acc-field label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--tf-stone-500);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}
.tf-acc-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--tf-stone-300);
    border-radius: var(--tf-radius-md);
    font-size: var(--text-base);
    color: var(--tf-stone-900);
    background: var(--tf-white);
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-out);
    font-family: var(--tf-font-family);
}
.tf-acc-field input:focus { border-color: var(--tf-amber-500); box-shadow: 0 0 0 3px rgba(202,138,4,.15); }
.tf-acc-field input:disabled { background: var(--tf-stone-100); color: var(--tf-stone-400); cursor: not-allowed; }
.tf-acc-field .tf-acc-hint { font-size: var(--text-xs); color: var(--tf-stone-400); margin-top: 4px; }
.tf-acc-divider { border: none; border-top: 1px dashed var(--tf-stone-200); margin: var(--space-5) 0 18px; }
.tf-acc-notice {
    padding: 10px 14px;
    border-radius: var(--tf-radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    display: none;
    border-left: 4px solid;
}
.tf-acc-notice.success { background: #ECFDF5; color: #065F46; border-color: var(--tf-status-selesai); display: block; }
.tf-acc-notice.error   { background: #FEF2F2; color: #991B1B; border-color: var(--tf-status-batal);   display: block; }
.tf-acc-submit {
    padding: 10px 28px;
    background: var(--tf-stone-900);
    color: var(--tf-white);
    border: none;
    border-radius: var(--tf-radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--tf-transition);
    font-family: var(--tf-font-family);
    box-shadow: var(--tf-shadow-xs);
}
.tf-acc-submit:hover { background: var(--tf-amber-500); transform: translateY(-1px); box-shadow: var(--tf-shadow-md); }
.tf-acc-submit:disabled { background: var(--tf-stone-300); cursor: not-allowed; box-shadow: none; }

/* Staff table */
.tf-acc-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tf-acc-table th {
    text-align: left; padding: 10px 12px; background: var(--tf-stone-100);
    font-size: var(--text-xs); font-weight: 700; color: var(--tf-stone-500);
    text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--tf-stone-200);
}
.tf-acc-table td { padding: 11px 12px; border-bottom: 1px solid var(--tf-stone-100); color: var(--tf-stone-800); vertical-align: middle; }
.tf-acc-table tr:last-child td { border-bottom: none; }
.tf-acc-empty { text-align: center; padding: 24px; color: var(--tf-stone-400); font-size: var(--text-sm); }

@media (max-width: 600px) {
    .tf-cart-cards { grid-template-columns: 1fr; }
}


/* --- [ 10. WP LOGIN PAGE ] --- */
body.login { background-color: var(--tf-stone-100); }

#login h1 a,
.login h1 a {
    height: 100px;
    width: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding-bottom: 20px;
}

body.login #loginform {
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow-lg);
    border: 1px solid var(--tf-stone-200);
    background: var(--tf-white);
}

.button,
body.login .wp-core-ui .button-primary {
    background: var(--tf-stone-900) !important;
    border-color: var(--tf-stone-900) !important;
    color: var(--tf-white) !important;
    border-radius: var(--tf-radius-md) !important;
    text-shadow: none !important;
    box-shadow: var(--tf-shadow-xs) !important;
    transition: var(--tf-transition);
    font-weight: 600;
}

.button:hover,
body.login .wp-core-ui .button-primary:hover,
body.login .wp-core-ui .button-primary:focus {
    background: var(--tf-amber-500) !important;
    border-color: var(--tf-amber-500) !important;
    transform: translateY(-1px);
    box-shadow: var(--tf-shadow-md) !important;
}

body.login input[type=text],
body.login input[type=password],
body.login input[type=email] {
    border-radius: var(--tf-radius-md) !important;
    border: 1.5px solid var(--tf-stone-300) !important;
    background: var(--tf-white) !important;
    font-family: var(--tf-font-family);
    transition: border-color var(--duration-fast) var(--ease-out);
}

body.login input[type=text]:focus,
body.login input[type=password]:focus,
body.login input[type=email]:focus {
    border-color: var(--tf-amber-500) !important;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.15) !important;
}

body.login #backtoblog a,
body.login #nav a {
    color: var(--tf-stone-600) !important;
    transition: color var(--duration-fast) ease;
}

body.login #backtoblog a:hover,
body.login #nav a:hover { color: var(--tf-amber-500) !important; }

.tf-login-gate {
    width: 300px;
    margin: 20px auto;
    color: var(--tf-white);
}


/* --- [ 11. UI COMPONENTS (Modal, Loaders, Skeletons) ] --- */
.tf-modal-overlay {
    position: fixed;
    width: 100%;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(12, 10, 9, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.tf-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.tf-modal-box {
    background: var(--tf-white);
    border-radius: var(--tf-radius-xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--tf-shadow-xl);
    transform: translateY(20px);
    transition: transform var(--duration-normal) var(--ease-out);
    margin-top: 50px;
    margin-bottom: 50px;
    border: 1px solid var(--tf-stone-200);
}

.tf-modal-overlay.active .tf-modal-box {
    transform: translateY(0);
}

.tf-spinner,
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(202, 138, 4, 0.2);
    border-top-color: var(--tf-amber-500);
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes tf-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton loading */
.tf-skeleton {
    background: linear-gradient(90deg, var(--tf-stone-200) 25%, var(--tf-stone-100) 50%, var(--tf-stone-200) 75%);
    background-size: 200% 100%;
    animation: tf-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--tf-radius-md);
}

@keyframes tf-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* --- [ 12. ADMIN LAYOUT & DASHBOARD ] --- */

.admin-tf .site-header {
    position: fixed;
    left: 0;
    width: 240px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: var(--z-sticky);
}

.admin-tf .site-inner {
    width: auto;
    margin-left: 240px;
}

.post-edit-link { display: none; }

/* ── Subheader bar ── */
.tf-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0 var(--space-8);
    background: var(--tf-white);
    border-bottom: 1px solid var(--tf-stone-200);
    margin-bottom: var(--space-8);
    min-height: 56px;
    flex-wrap: wrap;
}

.tf-subheader .tf-breadcrumb { flex: 1; min-width: 0; }
.tf-subheader .strategic-breadcrumb { padding: 0; }

.tf-subheader .strategic-breadcrumb ol {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}

.tf-subheader .strategic-breadcrumb li {
    display: flex; align-items: center;
    font-size: var(--text-sm); color: var(--tf-stone-500);
}

.tf-subheader .strategic-breadcrumb a {
    color: var(--tf-stone-500); text-decoration: none;
}

.tf-subheader .strategic-breadcrumb a:hover {
    color: var(--tf-stone-900); text-decoration: underline;
}

.tf-subheader .strategic-breadcrumb [aria-current="page"] span {
    color: var(--tf-stone-900); font-weight: 600;
}

.breadcrumb-separator { color: var(--tf-stone-300); margin: 0 2px; }

.admin-tf .tf-subheader { margin-left: 240px; }

/* ── User profile block ── */
.tf-subheader .tf-user-block { flex-shrink: 0; }

.tf-user-profile {
    display: flex; align-items: center; gap: 10px;
    border-left: 1px solid var(--tf-stone-200);
    padding-left: var(--space-4);
}

.tf-user-profile .user-info-text {
    display: flex; flex-direction: column;
    align-items: flex-end; line-height: 1.3;
}

.tf-user-profile .user-display-name {
    font-size: var(--text-sm); font-weight: 600;
    color: var(--tf-stone-900); white-space: nowrap;
}

.tf-user-profile .user-roles {
    font-size: var(--text-xs); color: var(--tf-stone-500); white-space: nowrap;
}

.tf-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--tf-amber-500); color: var(--tf-white);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-sm); font-weight: 700;
    letter-spacing: 0.5px; flex-shrink: 0;
}

.tf-user-logout {
    font-size: var(--text-xs); color: var(--tf-stone-500); text-decoration: none;
    border: 1px solid var(--tf-stone-300); padding: 4px 10px;
    border-radius: var(--tf-radius-badge); transition: var(--tf-transition);
    white-space: nowrap; font-weight: 500;
}

.tf-user-logout:hover {
    background: var(--tf-stone-100); color: var(--tf-stone-900);
    border-color: var(--tf-stone-400);
}

.user-logout-action { display: flex; align-items: center; line-height: 1.3; }

/* ── Nav Tabs ── */
.tf-nav-tab-wrapper {
    display: flex; flex-wrap: wrap; gap: 4px;
    border-bottom: 1px solid var(--tf-stone-200);
    margin-bottom: var(--space-6); padding: 0 4px;
}

.nav-tab {
    display: inline-block; padding: 10px var(--space-4);
    font-size: var(--text-sm); font-weight: 600;
    color: var(--tf-stone-500); text-decoration: none;
    border: none; border-bottom: 2px solid transparent;
    background: none; cursor: pointer;
    transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
    margin-bottom: -1px; white-space: nowrap;
}

.nav-tab:hover { color: var(--tf-stone-900); border-bottom-color: var(--tf-stone-300); background: none; }

.nav-tab-active,
.nav-tab.nav-tab-active { color: var(--tf-stone-900); border-bottom: 2px solid var(--tf-amber-500); background: none; }

/* ── Store stat grid ── */
.tf-store-stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    margin-top: var(--space-4); border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg); overflow: hidden;
}

.tf-store-stat-item {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: var(--space-5); text-align: center;
    border-right: 1px solid var(--tf-stone-200); background: var(--tf-white); gap: var(--space-1);
}

.tf-store-stat-item:last-child { border-right: none; }

.tf-store-stat-label {
    font-size: var(--text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--tf-stone-500);
}

.tf-store-stat-label::before {
    display: block; font-family: "Dashicons"; font-size: 18px;
    color: var(--tf-amber-500); margin-bottom: 4px;
}

.tf-store-stat-grid .tf-store-stat-item:nth-child(1) .tf-store-stat-label::before { content: "\f155"; }
.tf-store-stat-grid .tf-store-stat-item:nth-child(2) .tf-store-stat-label::before { content: "\f313"; }
.tf-store-stat-grid .tf-store-stat-item:nth-child(3) .tf-store-stat-label::before { content: "\f16a"; }
.tf-store-stat-grid .tf-store-stat-item:nth-child(4) .tf-store-stat-label::before { content: "\f12e"; }

.tf-store-stat-value {
    font-size: var(--text-2xl); font-weight: 700;
    color: var(--tf-stone-900); line-height: var(--leading-tight);
}

.tf-store-stat-value small {
    display: block; font-size: var(--text-xs); font-weight: 500;
    color: var(--tf-stone-500); margin-top: 2px;
}

@media (max-width: 600px) {
    .tf-store-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .tf-store-stat-item:nth-child(2) { border-right: none; }
    .tf-store-stat-item:nth-child(3),
    .tf-store-stat-item:nth-child(4) { border-top: 1px solid var(--tf-stone-200); }
}

/* ── Store Detail Summary ── */
.store-summary { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.store-summary .store-logo { width: 30%; min-width: 80px; }
.store-summary .store-info { width: 60%; flex: 1; }

.store-summary .active {
    display: inline-block; padding: 4px 12px; background: var(--tf-amber-500);
    border-radius: var(--tf-radius-badge); margin-bottom: 12px;
    color: var(--tf-white); font-weight: 700; font-size: var(--text-xs);
}

.store-summary .inactive,
.inactive {
    display: inline-block; padding: 4px 12px; background: var(--tf-stone-400);
    border-radius: var(--tf-radius-badge); margin-bottom: 12px;
    color: var(--tf-white); font-weight: 700; font-size: var(--text-xs);
}

.store-summary .suspended,
.suspended {
    display: inline-block; padding: 4px 12px; background: var(--tf-status-batal);
    color: var(--tf-white); border-radius: var(--tf-radius-badge);
    margin-bottom: 12px; font-weight: 700; font-size: var(--text-xs);
}

.store-summary .pic::before {
    content: "\f110"; font-family: "Dashicons"; font-size: 16px; margin-right: 8px; vertical-align: middle;
}

.store-summary .address::before {
    content: "\f231"; font-family: "Dashicons"; font-size: 16px; margin-right: 8px; vertical-align: middle;
}

.store-summary .detail {
    display: flex; gap: 0; margin: var(--space-4) 0;
    border: 1px solid var(--tf-stone-200); border-radius: var(--tf-radius-lg); overflow: hidden;
}

.store-summary .detail .tier,
.store-summary .detail .point,
.store-summary .detail .limit,
.store-summary .detail .sales {
    border-right: 1px solid var(--tf-stone-200); flex: 1 1 0;
    padding: 12px; text-align: center; font-size: var(--text-sm); background: var(--tf-white);
}

.store-summary .detail .sales { border-right: none; }

.store-summary .detail .tier::before,
.store-summary .detail .point::before,
.store-summary .detail .limit::before,
.store-summary .detail .sales::before {
    font-family: "Dashicons"; font-size: 18px; color: var(--tf-amber-500); margin-bottom: 8px; display: block;
}

.store-summary .detail .tier::before  { content: "\f155"; }
.store-summary .detail .point::before { content: "\f313"; }
.store-summary .detail .limit::before { content: "\f16a"; }
.store-summary .detail .sales::before { content: "\f12e"; }

/* ── Pagination ── */
.tf-pagination { margin-top: var(--space-5); text-align: right; }

.tf-pagination .page-numbers {
    display: inline-block; padding: 8px var(--space-4); font-weight: 600;
    margin: 0 2px; border: 1px solid var(--tf-stone-200); text-decoration: none;
    background: var(--tf-stone-50); color: var(--tf-stone-900);
    border-radius: var(--tf-radius-sm); transition: var(--tf-transition); font-size: var(--text-sm);
}

.tf-pagination .page-numbers:hover { background: var(--tf-stone-100); border-color: var(--tf-stone-400); }

.tf-pagination .current {
    background-color: var(--tf-stone-900); color: var(--tf-white); border-color: var(--tf-stone-900);
}


/* --- [ 13. ROLE-BASED NAV MENU ] --- */

.tf-role-based-menu {
    display: block; float: right; padding: 8px 0;
}

.tf-role-based-menu .genesis-nav-menu .menu-item {
    display: inline-block; margin-left: 4px; padding: 0 8px; position: relative;
}

.tf-role-based-menu .genesis-nav-menu .menu-item a {
    color: var(--tf-white); text-decoration: none;
    font-size: var(--text-sm); font-weight: 500; padding: 10px 4px;
    display: block; transition: color var(--duration-fast) ease;
}

.tf-role-based-menu .genesis-nav-menu .menu-item:hover,
.tf-role-based-menu .genesis-nav-menu .current-menu-item {
    border-bottom: 3px solid var(--tf-amber-500);
    background: rgba(202, 138, 4, 0.08);
    border-radius: var(--tf-radius-sm) var(--tf-radius-sm) 0 0;
}

.tf-role-based-menu .genesis-nav-menu a:focus,
.tf-role-based-menu .genesis-nav-menu a:hover,
.tf-role-based-menu .genesis-nav-menu .current-menu-item > a,
.tf-role-based-menu .genesis-nav-menu .sub-menu .current-menu-item > a:focus,
.tf-role-based-menu .genesis-nav-menu .sub-menu .current-menu-item > a:hover {
    border-bottom: 0; color: var(--tf-amber-400);
}

/* Admin sidebar vertical menu */
.admin-tf .genesis-nav-menu .menu-item { display: block; }
.admin-tf .genesis-nav-menu a { padding-left: 8px; }

.admin-tf .tf-role-based-menu {
    display: flex; flex-direction: column; width: 100%; float: none; padding: 0;
}

.admin-tf .tf-role-based-menu .genesis-nav-menu .menu-item {
    display: flex; width: 100%; color: var(--tf-white);
    padding: 0 8px; margin-left: 0;
    border-left: 4px solid transparent; border-radius: 0;
}

.admin-tf .tf-role-based-menu .genesis-nav-menu .menu-item:hover,
.admin-tf .tf-role-based-menu .genesis-nav-menu .current-menu-item {
    border-bottom: 0; border-left: 4px solid var(--tf-amber-500);
    background: rgba(202, 138, 4, 0.1);
    border-radius: 0 var(--tf-radius-sm) var(--tf-radius-sm) 0;
}

/* Nav menu Dashicons */
.tf-role-based-menu .dashboard::before { content: "\f311"; }
.tf-role-based-menu .muser::before     { content: "\f110"; }
.tf-role-based-menu .mtier::before     { content: "\f313"; }
.tf-role-based-menu .mmember::before   { content: "\f307"; }
.tf-role-based-menu .mproduct::before  { content: "\f312"; }
.tf-role-based-menu .morder::before    { content: "\f174"; }
.tf-role-based-menu .mreturn::before   { content: "\f171"; }
.tf-role-based-menu .minvoices::before { content: "\f18e"; }
.tf-role-based-menu .mrenewal::before,
.tf-role-based-menu .arenewal::before  { content: "\f321"; }
.tf-role-based-menu .mvoucher::before  { content: "\f524"; }
.tf-role-based-menu .maccount::before  { content: "\f110"; }

.tf-role-based-menu .dashboard::before,
.tf-role-based-menu .muser::before,
.tf-role-based-menu .mtier::before,
.tf-role-based-menu .mmember::before,
.tf-role-based-menu .mproduct::before,
.tf-role-based-menu .morder::before,
.tf-role-based-menu .mreturn::before,
.tf-role-based-menu .minvoices::before,
.tf-role-based-menu .mrenewal::before,
.tf-role-based-menu .arenewal::before,
.tf-role-based-menu .mvoucher::before,
.tf-role-based-menu .maccount::before {
    font-family: "Dashicons"; vertical-align: middle; margin-right: 8px; padding-top: 12px;
}

.tf-role-based-menu .mrenewal a { color: #991B1B !important; }

.tf-retur-row-pending {
    background: var(--tf-amber-200);
}

/* --- [ 14. RESPONSIVE MOBILE ] --- */

/* Table → stacked card layout */
@media screen and (max-width: 768px) {
    .tf-table,
    .tf-table thead,
    .tf-table tbody,
    .tf-table th,
    .tf-table td,
    .tf-table tr { display: block; }

    .tf-table thead tr {
        position: absolute; top: -9999px; left: -9999px;
    }

    .tf-table tr {
        margin-bottom: var(--space-4);
        border: 1px solid var(--tf-stone-200);
        border-radius: var(--tf-radius-lg);
        padding: 8px; box-shadow: var(--tf-shadow-sm);
        background: var(--tf-white);
    }

    .tf-table td {
        border: none; border-bottom: 1px solid var(--tf-stone-100);
        position: relative; padding-left: 45%; text-align: right;
        display: flex; justify-content: space-between; align-items: center;
    }

    .tf-table td::before {
        content: attr(data-label); text-align: left; font-weight: 700;
        color: var(--tf-stone-900); font-size: var(--text-xs);
        text-transform: uppercase; flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .site-header { padding: 6px 32px; }
    .tf-subheader { padding: 0 var(--space-8); min-height: 48px; }
    .tf-user-profile .user-info-text { display: none; }

    .admin-tf .site-header { position: relative; width: 100%; height: auto; display: block; }
    .admin-tf .tf-subheader,
    .admin-tf .site-inner { margin-left: 0; }

    .tf-role-based-menu, .admin-tf .tf-role-based-menu  { display: block; overflow-x: visible; }
    .tf-role-based-menu .genesis-nav-menu, .admin-tf .tf-role-based-menu .genesis-nav-menu { top: 63px; }

    .admin-tf .tf-role-based-menu .genesis-nav-menu .menu-item {
        width: auto; border-left: none; border-bottom: 3px solid transparent; display: inline-block;
    }

    .admin-tf .tf-role-based-menu .genesis-nav-menu .menu-item:hover,
    .admin-tf .tf-role-based-menu .genesis-nav-menu .current-menu-item {
        border-left: none; border-bottom: 3px solid var(--tf-amber-500); border-radius: 0;
    }

    .tf-nav-tab-wrapper {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .tf-nav-tab-wrapper::-webkit-scrollbar { display: none; }
    .nav-tab { white-space: nowrap; flex-shrink: 0; }

    .store-summary { flex-direction: column; }
    .store-summary .store-logo,
    .store-summary .store-info { width: 100%; }

    .store-summary .detail { flex-wrap: wrap; }
    .store-summary .detail .tier,
    .store-summary .detail .point,
    .store-summary .detail .limit,
    .store-summary .detail .sales {
        flex: 1 1 calc(50% - 1px); min-width: 80px;
    }
}


/* --- [ 17. EU MEMBER PORTAL ] --- */

/* ── Page width wrappers ── */
.tf-eu-page-narrow { max-width: 480px; margin: 48px auto; }
.tf-eu-page-medium { max-width: 560px; margin: 48px auto; }
.tf-eu-page-md     { max-width: 600px; margin: 0 auto; }
.tf-p-2xl          { padding: 64px; }
.tf-mt-8           { margin-top: var(--space-8); }

/* ── Register form ── */
.tf-eu-section-optional { font-weight: 400; text-transform: none; }
.tf-eu-checkbox-label   { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.tf-eu-checkbox-input   { margin-top: 3px; flex-shrink: 0; }
.tf-eu-login-link       { margin-top: var(--space-4); text-align: center; font-size: var(--text-sm); }

/* ── Dashboard banner ── */
.tf-eu-dashboard-banner {
    background: linear-gradient(135deg, var(--tf-stone-950) 0%, var(--tf-stone-700) 100%);
    padding: 28px 32px;
    border-radius: var(--tf-radius-md);
    color: var(--tf-white);
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}
.tf-eu-banner-greeting {
    margin: 0 0 var(--space-1);
    font-size: 12px;
    color: var(--tf-stone-400);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tf-eu-banner-name  { margin: 0 0 12px; color: var(--tf-white); font-size: 22px; }
.tf-eu-banner-tier  {
    display: inline-block;
    background: var(--tf-amber-500); color: var(--tf-white);
    padding: 5px 16px; border-radius: var(--tf-radius-badge);
    font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.tf-eu-banner-poin       { text-align: right; }
.tf-eu-banner-poin-label { margin: 0 0 2px; font-size: 12px; color: var(--tf-stone-400); }
.tf-eu-banner-poin-value { margin: 0; font-size: 42px; font-weight: 900; color: var(--tf-amber-100); line-height: 1; }
.tf-eu-banner-poin-meta  { margin: var(--space-1) 0 0; font-size: var(--text-xs); color: var(--tf-stone-400); }

/* ── Expiry warning ── */
.tf-eu-expiry-warn {
    background: var(--tf-amber-50); border: 1px solid #FCD34D;
    margin-bottom: 20px; border-radius: var(--tf-radius-sm);
    padding: var(--space-4) var(--space-5); font-size: var(--text-sm);
}

/* ── Stat grid (dashboard) ── */
.tf-eu-stat-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4); margin-bottom: var(--space-6);
}
@media (max-width: 600px) { .tf-eu-stat-grid { grid-template-columns: 1fr; } }
@media (min-width: 601px) and (max-width: 860px) { .tf-eu-stat-grid { grid-template-columns: repeat(2, 1fr); } }

.tf-eu-stat-value { font-size: 36px; font-weight: 900; margin: 0; }
.tf-eu-stat-label { font-size: 12px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; color: var(--tf-stone-500); }
.tf-eu-stat-sub   { font-size: var(--text-xs); margin: var(--space-1) 0 0; }

/* ── Quick navigation grid ── */
.tf-eu-quick-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: var(--space-6); }
.tf-eu-nav-btn   { text-align: center; padding: 14px; text-decoration: none; display: block; }

/* ── Empty state ── */
.tf-eu-empty-msg { text-align: center; padding: 32px 0; margin: 0; }

/* ── Klaim info header ── */
.tf-eu-klaim-info      { text-align: right; }
.tf-eu-klaim-info-line { font-size: 12px; display: block; }

/* ── Nota preview ── */
.tf-eu-nota-preview     { margin-top: 12px; }
.tf-eu-nota-preview-img { max-width: 100%; max-height: 280px; border-radius: var(--tf-radius-sm); border: 1px solid var(--tf-stone-200); display: block; }

/* ── Estimasi poin box ── */
.tf-eu-estimasi-wrap  { display: flex; align-items: flex-end; }
.tf-eu-estimasi-box   { background: var(--tf-amber-50); border: 1px solid var(--tf-amber-100); border-radius: var(--tf-radius-sm); padding: 12px 16px; width: 100%; }
.tf-eu-estimasi-label { margin: 0 0 var(--space-1); font-size: 12px; color: var(--tf-stone-500); }
.tf-eu-estimasi-value { font-size: 22px; }

/* ── Poin balance display (katalog header) ── */
.tf-eu-poin-display       { text-align: right; }
.tf-eu-poin-display-label { margin: 0; font-size: 12px; color: var(--tf-stone-500); }
.tf-eu-poin-display-value { font-size: 24px; }

/* ── Riwayat photo link ── */
.tf-eu-foto-link { font-size: var(--text-sm); }

/* ── Member catalog grid (front-end) ── */
.tf-eu-member-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tf-eu-catalog-img-tall    { height: 170px; overflow: hidden; background: var(--tf-stone-100); }
.tf-eu-catalog-img-tall img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-eu-catalog-placeholder-sm {
    height: 120px; background: var(--tf-stone-100);
    display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.tf-eu-catalog-overlay {
    position: absolute; top: 10px; right: 10px;
    padding: 3px 10px; border-radius: var(--tf-radius-badge);
    font-size: var(--text-xs); font-weight: 700; z-index: 1; color: var(--tf-white);
}
.tf-eu-catalog-overlay--batal { background: var(--tf-status-batal); }
.tf-eu-catalog-overlay--tier  { background: var(--tf-stone-700); }

.tf-eu-catalog-body-p    { padding: 16px; }
.tf-eu-catalog-cat       { font-size: var(--text-xs); background: var(--tf-stone-100); padding: 2px 8px; border-radius: var(--tf-radius-badge); color: var(--tf-stone-500); text-transform: uppercase; letter-spacing: .04em; }
.tf-eu-catalog-title-lg  { margin: 8px 0 6px; font-size: 15px; line-height: 1.3; }
.tf-eu-catalog-desc-text { font-size: var(--text-sm); margin: 0 0 14px; line-height: 1.5; }
.tf-eu-catalog-price-row { margin-bottom: 14px; }
.tf-eu-catalog-poin-value { font-size: 22px; font-weight: 900; color: var(--tf-amber-500); }
.tf-eu-catalog-poin-unit  { font-size: 12px; }
.tf-eu-catalog-stok       { font-size: 12px; }
.tf-eu-btn-kurang-poin    { width: 100%; cursor: default; opacity: .6; }

/* ── Redemption modal rows ── */
.tf-eu-modal-title { padding-right: 36px; margin-bottom: var(--space-1); }
.tf-eu-modal-kat   { font-size: var(--text-sm); margin-bottom: var(--space-4); }
.tf-eu-rd-row      { margin-bottom: var(--space-2); }
.tf-eu-rd-row-label { font-size: var(--text-sm); }
.tf-eu-rd-row-sep  { padding-top: 10px; border-top: 1px solid var(--tf-stone-200); }
.tf-eu-rd-sisa     { color: var(--tf-status-selesai); }

/* ── Reward thumb in table ── */
.tf-eu-reward-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: var(--tf-radius-sm); vertical-align: middle; margin-right: 8px; }

/* ── Profile page ── */
.tf-eu-profile-summary   { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: var(--space-6); }
.tf-eu-profile-stat      { flex: 1; min-width: 130px; }
.tf-eu-profile-stat-label { margin: 0 0 2px; font-size: 12px; }
.tf-eu-profile-stat-value     { font-size: 18px; }
.tf-eu-profile-stat-value-sm  { font-size: 16px; color: var(--tf-status-selesai); }
.tf-eu-profile-stat-date      { font-size: 14px; }

/* ── EU nota table — responsive stacked ── */
@media (max-width: 600px) {
    .tf-eu-nota-table thead { display: none; }
    .tf-eu-nota-table tr {
        display: block; margin-bottom: 12px;
        border: 1px solid var(--tf-stone-200); border-radius: var(--tf-radius-sm); padding: 4px 0;
    }
    .tf-eu-nota-table td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 8px 14px; border-bottom: 1px solid var(--tf-stone-100); font-size: var(--text-sm);
    }
    .tf-eu-nota-table td:last-child { border-bottom: none; }
    .tf-eu-nota-table td::before {
        content: attr(data-label); font-weight: 600; font-size: var(--text-xs);
        color: var(--tf-stone-500); text-transform: uppercase; letter-spacing: .04em;
        margin-right: 8px; flex-shrink: 0;
    }
}


/* --- [ 16. EU ADMIN MODULE — UTILITIES & COMPONENTS ] --- */

/* ── Utility extensions ── */
.tf-hidden         { display: none; }
.tf-col-addr       { max-width: 200px; }
.tf-text-center    { text-align: center; }
.tf-ta-right       { text-align: right; }
.tf-p-xl           { padding: var(--space-12); }
.tf-p5             { padding: var(--space-5); }
.tf-mb-0           { margin-bottom: 0 !important; }
.tf-mt-0           { margin-top: 0 !important; }
.tf-mt-3           { margin-top: var(--space-3); }
.tf-mt-2-sm        { margin-top: var(--space-2); }
.tf-mb-sp3         { margin-bottom: var(--space-3); }
.tf-fs-xs          { font-size: var(--text-xs); }
.tf-fs-sm          { font-size: var(--text-sm); }
.tf-fs-2xs         { font-size: 12px; }
.tf-fw-900         { font-weight: 900; }
.tf-flex-1         { flex: 1; }
.tf-flex-wrap      { flex-wrap: wrap; }
.tf-justify-center { justify-content: center; }

/* ── Dashboard metric grid ── */
.tf-eu-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: var(--space-6);
}

.tf-eu-metric-card { padding: var(--space-5); text-align: center; }
a.tf-eu-metric-card { text-decoration: none; }
.tf-eu-metric-icon  { font-size: 22px; margin-bottom: var(--space-1); }
.tf-eu-metric-label {
    font-size: var(--text-xs);
    margin: 0 0 var(--space-1);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--tf-stone-500);
}
.tf-eu-metric-value { font-size: 28px; font-weight: 900; margin: 0; }

/* ── Auto-fit grids ── */
.tf-eu-grid-auto-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.tf-eu-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

/* ── Progress bar ── */
.tf-eu-progress-item   { margin-bottom: 12px; }
.tf-eu-progress-header { margin-bottom: var(--space-1); }
.tf-eu-progress-track  { background: var(--tf-stone-100); border-radius: var(--tf-radius-badge); height: 8px; overflow: hidden; }
.tf-eu-progress-bar    { background: var(--tf-amber-500); height: 100%; }

/* ── Button extras ── */
.tf-btn-sm    { padding: 4px 10px !important; font-size: var(--text-xs) !important; }
.tf-btn-full  { width: 100%; }
.tf-btn-tab   { padding: 6px 14px; font-size: var(--text-sm); }
.tf-btn-pager { min-width: 36px; text-align: center; padding: 6px 12px; }

/* ── Pagination wrapper ── */
.tf-pagination-wrapper { justify-content: center; flex-wrap: wrap; }

/* ── Filter bar ── */
.tf-eu-filter-bar      { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tf-eu-filter-field-lg { flex: 2; min-width: 220px; margin: 0; }
.tf-eu-filter-field    { min-width: 140px; margin: 0; }
.tf-eu-filter-action   { margin: 0; }

/* ── Tab filter strip ── */
.tf-eu-tab-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }

/* ── Member detail split ── */
.tf-eu-detail-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 640px) { .tf-eu-detail-split { grid-template-columns: 1fr; } }

.tf-eu-detail-label { width: 180px; }

/* ── Tier / points dark card ── */
.tf-eu-tier-card {
    background: linear-gradient(135deg, var(--tf-stone-950) 0%, var(--tf-stone-700) 100%);
    color: var(--tf-white);
}
.tf-eu-tier-label {
    margin: 0 0 var(--space-1);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tf-stone-400);
}
.tf-eu-tier-name     { margin: 0 0 14px; color: var(--tf-amber-100); }
.tf-eu-tier-multi    { font-size: var(--text-base); }
.tf-eu-poin-saldo    { margin: 0 0 12px; font-size: 32px; font-weight: 900; color: var(--tf-amber-100); line-height: 1; }
.tf-eu-poin-lifetime { margin: 0; font-size: 20px; font-weight: 700; }

/* ── Admin action forms grid ── */
.tf-eu-admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
}

/* ── Nota thumbnail ── */
.tf-eu-nota-thumb {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: var(--tf-radius-sm);
    border: 1px solid var(--tf-stone-200);
    display: block;
}

/* ── Catalog grid & cards ── */
.tf-eu-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.tf-eu-catalog-card { padding: 0; overflow: hidden; }
.tf-eu-catalog-img  { width: 100%; height: 140px; object-fit: cover; display: block; }
.tf-eu-catalog-placeholder {
    height: 140px; background: var(--tf-stone-100);
    display: flex; align-items: center; justify-content: center; font-size: 36px;
}
.tf-eu-catalog-body   { padding: 14px; }
.tf-eu-catalog-header { margin-bottom: 6px; }
.tf-eu-catalog-title  { font-size: var(--text-base); margin: 0 0 6px; }
.tf-eu-catalog-desc   { font-size: var(--text-xs); margin: 0 0 10px; color: var(--tf-stone-500); }
.tf-eu-catalog-price  { margin-bottom: 10px; }
.tf-eu-catalog-info   { font-size: var(--text-xs); margin: 0 0 8px; color: var(--tf-stone-500); }
.tf-eu-catalog-cat-badge {
    font-size: var(--text-xs); background: var(--tf-stone-100);
    padding: 2px 8px; border-radius: var(--tf-radius-badge);
    text-transform: uppercase; letter-spacing: .04em;
}
.tf-eu-catalog-status-on  { font-size: var(--text-xs); color: var(--tf-status-selesai); }
.tf-eu-catalog-status-off { font-size: var(--text-xs); color: var(--tf-stone-500); }

/* ── Modal close button ── */
.tf-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--tf-stone-500); line-height: 1; padding: 0;
}
.tf-modal-close:hover { color: var(--tf-stone-900); }

/* ── Modal box base & size variants ── */
.tf-modal-box { position: relative; }
.tf-modal-sm  { max-width: 460px; }
.tf-modal-md  { max-width: 560px; }
.tf-modal-lg  { max-width: 640px; }

/* ── Preview poin (nota modal) ── */
.tf-eu-preview-poin {
    background: var(--tf-amber-50); border: 1px solid #FCD34D;
    padding: var(--space-4); border-radius: var(--tf-radius-md);
    font-size: var(--text-sm); margin-bottom: 12px; color: var(--tf-stone-700);
}

/* ── Cancel redemption warning ── */
.tf-eu-cancel-warning {
    background: #FEF2F2; border: 1px solid #FECACA;
    padding: var(--space-4); border-radius: var(--tf-radius-md);
    font-size: var(--text-sm); margin-bottom: 12px;
}

/* ── EU badge states ── */
.badge-eu-aktif      { background: var(--tf-bg-selesai);  color: var(--tf-status-selesai); }
.badge-eu-nonaktif   { background: var(--tf-stone-200);   color: var(--tf-stone-600); }
.badge-eu-suspend    { background: var(--tf-bg-batal);    color: var(--tf-status-batal); }
.badge-eu-diajukan   { background: var(--tf-bg-proses);   color: var(--tf-status-proses); }
.badge-eu-disetujui  { background: var(--tf-bg-selesai);  color: var(--tf-status-selesai); }
.badge-eu-ditolak    { background: var(--tf-bg-batal);    color: var(--tf-status-batal); }
.badge-eu-diklaim    { background: var(--tf-bg-proses);   color: var(--tf-status-proses); }
.badge-eu-diproses   { background: var(--tf-bg-kirim);    color: var(--tf-status-kirim); }
.badge-eu-selesai    { background: var(--tf-bg-selesai);  color: var(--tf-status-selesai); }
.badge-eu-dibatalkan { background: var(--tf-bg-batal);    color: var(--tf-status-batal); }
.badge-eu-earn       { background: var(--tf-bg-selesai);  color: var(--tf-status-selesai); }
.badge-eu-redeem     { background: var(--tf-bg-terkirim); color: var(--tf-amber-600); }
.badge-eu-expire     { background: var(--tf-stone-200);   color: var(--tf-stone-600); }
.badge-eu-adjust     { background: var(--tf-bg-kirim);    color: var(--tf-status-kirim); }
.badge-eu-tier-aktif    { background: var(--tf-bg-selesai); color: var(--tf-status-selesai); }
.badge-eu-tier-nonaktif { background: var(--tf-stone-200);  color: var(--tf-stone-600); }
.badge-eu-default       { background: var(--tf-stone-200);  color: var(--tf-stone-600); }

/* ── EU dash table — responsive stacked ── */
@media (max-width: 640px) {
    .tf-eu-dash-table thead { display: none; }
    .tf-eu-dash-table tr {
        display: block; margin-bottom: 12px;
        border: 1px solid var(--tf-stone-200);
        border-radius: var(--tf-radius-sm); padding: 4px 0;
    }
    .tf-eu-dash-table td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 8px 14px; border-bottom: 1px solid var(--tf-stone-100);
        font-size: var(--text-sm); text-align: left !important;
    }
    .tf-eu-dash-table td:last-child { border-bottom: none; }
    .tf-eu-dash-table td::before {
        content: attr(data-label); font-weight: 600;
        font-size: var(--text-xs); color: var(--tf-stone-500);
        text-transform: uppercase; letter-spacing: .04em;
        margin-right: 8px; flex-shrink: 0;
    }
}


/* --- [ 15. ROLE-BASED MENU — SUBMENU & MOBILE HAMBURGER ] --- */

.tf-role-based-menu .genesis-nav-menu .menu-item { position: relative; }

/* Submenu dropdown */
.tf-role-based-menu .genesis-nav-menu .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 180px;
    list-style: none; margin: 0; padding: 8px 0 6px;
    background: var(--tf-stone-900);
    border-radius: 0 var(--tf-radius-sm) var(--tf-radius-sm) var(--tf-radius-sm);
    box-shadow: var(--tf-shadow-lg); z-index: var(--z-dropdown);
    opacity: 0; visibility: hidden;
    transition: opacity var(--duration-fast) ease, visibility 0s linear var(--duration-normal);
}

.tf-role-based-menu .genesis-nav-menu .menu-item:hover > .sub-menu,
.tf-role-based-menu .genesis-nav-menu .menu-item:focus-within > .sub-menu {
    opacity: 1; visibility: visible;
    transition: opacity var(--duration-fast) ease, visibility 0s;
}

.tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item {
    display: block; width: 100%; margin: 0; padding: 0; border-radius: 0;
}

.tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item a {
    padding: 10px 16px; font-size: var(--text-sm); white-space: nowrap;
    display: block; color: var(--tf-stone-300); border-bottom: none;
}

.tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item:hover,
.tf-role-based-menu .genesis-nav-menu .sub-menu .current-menu-item {
    background: rgba(202, 138, 4, 0.12); border-bottom: 0; border-radius: 0;
}

.tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item:hover > a,
.tf-role-based-menu .genesis-nav-menu .sub-menu .current-menu-item > a { color: var(--tf-amber-400); }

.tf-role-based-menu .genesis-nav-menu .menu-item-has-children > a::after {
    content: ' \25BE'; opacity: 0.6; font-style: normal;
}

/* Hamburger button */
.tf-menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 8px 6px; float: right; margin: 4px 0; z-index: 9999;
}

.tf-ham-bar {
    display: block; width: 22px; height: 2px;
    background: var(--tf-white); border-radius: 2px;
    transition: transform var(--duration-normal) ease, opacity var(--duration-normal) ease;
}

.tf-role-based-menu.open .tf-ham-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tf-role-based-menu.open .tf-ham-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.tf-role-based-menu.open .tf-ham-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .tf-menu-toggle { display: flex; padding: 10px; }

    .tf-role-based-menu {
        position: relative; float: none; width: 100%;
        flex-direction: column; flex-wrap: nowrap; overflow-x: visible; display: block;
    }

    .tf-role-based-menu .genesis-nav-menu {
        display: none; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--tf-stone-900);
        border-top: 1px solid var(--tf-stone-800);
        border-radius: 0 0 var(--tf-radius-md) var(--tf-radius-md);
        box-shadow: var(--tf-shadow-lg); z-index: var(--z-dropdown);
        padding: 8px 0; margin: 0; list-style: none;
    }

    .tf-role-based-menu.open .genesis-nav-menu { display: flex; top: 60px; }

    .tf-role-based-menu .genesis-nav-menu .menu-item {
        display: inline-block; width: 100%; margin: 0; padding: 0;
        border-left: 4px solid transparent; border-bottom: 0;
    }

    .tf-role-based-menu .genesis-nav-menu .menu-item a {
        padding: 12px var(--space-5); font-size: var(--text-base);
        border-bottom: 1px solid rgba(255,255,255,0.05); display: inline-block;
    }

    .tf-role-based-menu .genesis-nav-menu .menu-item:hover,
    .tf-role-based-menu .genesis-nav-menu .current-menu-item {
        border-bottom: 0; border-left: 4px solid var(--tf-amber-500);
        background: rgba(202,138,4,0.1); border-radius: 0;
    }

    .tf-role-based-menu .genesis-nav-menu .sub-menu {
        position: static; display: block;
        background: rgba(0,0,0,0.2); border: none; border-radius: 0;
        box-shadow: none; min-width: auto; width: 100%; padding: 4px 0;
        opacity: 1; visibility: visible; transition: none;
    }

    .tf-role-based-menu .genesis-nav-menu .menu-item.open > .sub-menu { display: block; }

    .tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item { border-left: 4px solid transparent; }

    .tf-role-based-menu .genesis-nav-menu .sub-menu .menu-item a {
        padding-left: 36px; font-size: var(--text-sm);
        border-bottom: 1px solid rgba(255,255,255,0.04); white-space: normal;
    }

    .tf-role-based-menu .genesis-nav-menu .menu-item-has-children > a::after { content: ' \25B8'; }
    .tf-role-based-menu .genesis-nav-menu .menu-item-has-children.open > a::after { content: ' \25BE'; }
}


/* --- [ 18. MEMBER DASHBOARD (tf_member_dashboard shortcode) ] --- */

.tf-db-wrap {
    font-family: var(--tf-font-family);
    max-width: 1100px;
    margin: 0 auto;
    color: var(--tf-stone-900);
}

/* ── Welcome Banner ── */
.tf-db-banner {
    background: linear-gradient(135deg, var(--tf-stone-950) 0%, #1a1a2e 100%);
    border-radius: var(--tf-radius-lg);
    padding: 26px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.tf-db-banner-left { display: flex; align-items: center; gap: 18px; }

.tf-db-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--tf-amber-500);
    background: var(--tf-stone-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--tf-amber-500);
    flex-shrink: 0;
    letter-spacing: 0;
}

.tf-db-banner h2 { color: var(--tf-white); margin: 0 0 5px; font-size: var(--text-2xl); font-weight: 700; }
.tf-db-banner p  { color: var(--tf-stone-400); margin: 0; font-size: var(--text-sm); line-height: var(--leading-relaxed); }

.tf-db-tier-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--tf-radius-badge);
    background: var(--tf-amber-500);
    color: var(--tf-white);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .5px;
    margin-left: 5px;
    vertical-align: middle;
}

.tf-db-banner-btn {
    padding: 9px var(--space-5);
    border-radius: var(--tf-radius-sm);
    border: 1px solid var(--tf-amber-500);
    color: var(--tf-amber-500);
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--tf-transition);
}
.tf-db-banner-btn:hover { background: var(--tf-amber-500); color: var(--tf-white); }

/* ── Stat Cards ── */
.tf-db-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
@media (max-width: 900px) { .tf-db-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tf-db-stats { grid-template-columns: 1fr; } }

.tf-db-card {
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg);
    padding: 18px var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    box-shadow: var(--tf-shadow-xs);
}

.tf-db-card-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--tf-stone-500);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.tf-db-card-value { font-size: 22px; font-weight: 800; color: var(--tf-stone-900); line-height: var(--leading-tight); }
.tf-db-card-value small { font-size: var(--text-sm); font-weight: 500; color: var(--tf-stone-500); }

.tf-db-card-sub          { font-size: var(--text-xs); color: var(--tf-status-selesai); font-weight: 600; }
.tf-db-card-sub.neutral  { color: var(--tf-stone-500); }
.tf-db-card-sub.warn     { color: var(--tf-status-batal); font-weight: 700; }

.tf-db-card-link {
    margin-top: var(--space-1);
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--tf-amber-500);
    text-decoration: none;
}
.tf-db-card-link:hover { text-decoration: underline; }

.tf-db-card-btn {
    margin-top: var(--space-2);
    display: inline-block;
    padding: 7px 14px;
    border-radius: var(--tf-radius-sm);
    background: var(--tf-amber-500);
    color: var(--tf-white);
    font-size: var(--text-xs);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: var(--tf-transition);
}
.tf-db-card-btn:hover { background: var(--tf-amber-600); }

/* Tier progress bar */
.tf-db-prog-wrap  { margin-top: var(--space-2); }
.tf-db-prog-track { background: var(--tf-stone-100); border-radius: var(--tf-radius-badge); height: 8px; overflow: hidden; }
.tf-db-prog-fill  { height: 100%; border-radius: var(--tf-radius-badge); transition: width .6s ease; }
.tf-db-prog-label {
    font-size: var(--text-xs);
    color: var(--tf-stone-500);
    margin-top: var(--space-1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* ── Bottom Grid ── */
.tf-db-bottom {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-5);
    align-items: start;
}
@media (max-width: 820px) { .tf-db-bottom { grid-template-columns: 1fr; } }

/* Section title */
.tf-db-section-title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--tf-stone-900);
    margin: 0 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.tf-db-section-title a { font-size: var(--text-xs); font-weight: 600; color: var(--tf-amber-500); text-decoration: none; }
.tf-db-section-title a:hover { text-decoration: underline; }

/* Products grid */
.tf-db-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .tf-db-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .tf-db-products { grid-template-columns: 1fr; } }

.tf-db-prod-card {
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-md);
    overflow: hidden;
    background: var(--tf-white);
    box-shadow: var(--tf-shadow-xs);
    transition: var(--tf-transition);
}
.tf-db-prod-card:hover { box-shadow: var(--tf-shadow-md); transform: translateY(-2px); }

.tf-db-prod-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--tf-stone-100); display: block; }

.tf-db-prod-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tf-amber-500);
    color: var(--tf-white);
    font-size: var(--text-xs);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tf-db-prod-rank.silver { background: #9e9e9e; }
.tf-db-prod-rank.bronze { background: #cd7f32; }

.tf-db-prod-body { padding: 10px 12px; }
.tf-db-prod-name { font-size: var(--text-xs); font-weight: 700; color: var(--tf-stone-900); margin: 0 0 var(--space-1); line-height: var(--leading-tight); }
.tf-db-prod-sold { font-size: var(--text-xs); color: var(--tf-stone-500); margin: 0; }
.tf-db-prod-sold strong { color: var(--tf-status-kirim); }

/* Leaderboard */
.tf-db-leaderboard {
    background: var(--tf-white);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-lg);
    padding: var(--space-5);
}

.tf-db-lb-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 9px 0;
    border-bottom: 1px solid var(--tf-stone-100);
}
.tf-db-lb-row:last-child { border-bottom: none; }
.tf-db-lb-row.is-me {
    background: var(--tf-amber-50);
    margin: 0 calc(-1 * var(--space-5));
    padding: 9px var(--space-5);
    border-radius: var(--tf-radius-sm);
}

.tf-db-lb-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--tf-stone-100);
    color: var(--tf-stone-600);
    font-size: var(--text-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tf-db-lb-rank.gold   { background: var(--tf-amber-500); color: var(--tf-white); }
.tf-db-lb-rank.silver { background: #9e9e9e; color: var(--tf-white); }
.tf-db-lb-rank.bronze { background: #cd7f32; color: var(--tf-white); }

.tf-db-lb-info  { flex: 1; min-width: 0; }
.tf-db-lb-name  { font-size: var(--text-sm); font-weight: 600; color: var(--tf-stone-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-db-lb-tier  { font-size: var(--text-xs); color: var(--tf-stone-500); }
.tf-db-lb-pts   { font-size: var(--text-sm); font-weight: 700; color: var(--tf-amber-500); white-space: nowrap; }
.tf-db-empty    { text-align: center; padding: 24px 10px; color: var(--tf-stone-400); font-size: var(--text-sm); }


/* --- [ 19. MEMBER INVOICES (tf_member_invoices shortcode) ] --- */

/* Page header row (title + action buttons) */
.tf-inv-page-header {
    border-bottom: 2px solid var(--tf-stone-200);
    padding-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Invoice card inner header — dashed separator */
.tf-inv-card-header {
    border-bottom: 2px dashed var(--tf-stone-200);
    padding-bottom: var(--space-4);
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Small meta text (dates, expedition, etc.) */
.tf-inv-meta { font-size: var(--text-sm); }

/* Calculation summary box — right-aligned */
.tf-inv-calc-box { margin-top: var(--space-6); max-width: 480px; margin-left: auto; }

/* Grand total divider row */
.tf-inv-calc-grand {
    border-top: 1px dashed var(--tf-stone-200);
    padding-top: var(--space-2);
    margin-top: var(--space-1);
    margin-bottom: var(--space-2);
}

/* Sisa tagihan row */
.tf-inv-calc-sisa  { border-top: 2px solid var(--tf-stone-900); padding-top: var(--space-3); margin-top: var(--space-2); }
.tf-inv-sisa-label { font-size: var(--text-lg); font-weight: 700; }
.tf-inv-sisa-value { font-size: 22px; color: var(--tf-status-batal); }

/* Tier discount locked warning */
.tf-inv-tier-warn {
    font-size: var(--text-xs);
    color: var(--tf-status-retur);
    margin-bottom: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--tf-amber-50);
    border-left: 3px solid var(--tf-status-retur);
    border-radius: var(--tf-radius-sm);
}

/* Voucher min-trx error (shown/hidden via JS) */
.tf-inv-voucher-warn {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--tf-status-batal);
    padding: var(--space-2) var(--space-3);
    background: var(--tf-bg-batal);
    border-radius: var(--tf-radius-sm);
}

/* Total-after-voucher display field */
.tf-inv-total-field { padding: 10px 14px; font-weight: 700; font-size: var(--text-md); background: var(--tf-stone-100); }

/* Payment form section title */
.tf-inv-form-title { margin-bottom: var(--space-5); border-bottom: 1px solid var(--tf-stone-200); padding-bottom: 10px; }

/* Nominal recalculation preview */
.tf-inv-nominal-preview { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--tf-stone-900); }

/* File upload trigger label */
.tf-inv-upload-btn {
    width: 100%;
    text-align: center;
    border-style: dashed !important;
    border-width: 2px !important;
    cursor: pointer;
    justify-content: center;
}

/* File preview container */
.tf-inv-file-preview { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); min-height: 20px; }

/* File thumbnail — PDF */
.tf-inv-file-pdf {
    width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-xs); text-align: center;
    background: var(--tf-stone-100);
    border: 1px solid var(--tf-stone-200);
    border-radius: var(--tf-radius-sm);
    padding: var(--space-1); word-break: break-all; overflow: hidden;
}

/* File thumbnail — image */
.tf-inv-file-img {
    width: 90px; height: 90px;
    object-fit: cover;
    border-radius: var(--tf-radius-sm);
    border: 1px solid var(--tf-stone-200);
}

/* File remove button */
.tf-inv-file-remove {
    position: absolute; top: -5px; right: -5px;
    background: var(--tf-status-batal); color: var(--tf-white);
    border: none; border-radius: 50%;
    width: 20px; height: 20px;
    font-size: var(--text-xs);
    cursor: pointer; line-height: 1; padding: 0;
}

/* Submit button — full width, larger */
.tf-inv-submit-btn { width: 100%; padding: 14px; font-size: var(--text-md); }

/* Payment feedback message */
.tf-inv-feedback { margin-top: 14px; font-size: var(--text-base); font-weight: 600; text-align: center; }

/* Payment history section */
.tf-inv-history-section { margin-top: var(--space-10); }
.tf-inv-history-title   { border-bottom: 2px solid var(--tf-stone-200); padding-bottom: 10px; }

/* Lunas / pending-zero notices */
.tf-inv-lunas-notice { justify-content: center; text-align: center; flex-direction: column; }

/* Calculation row colour variants */
.tf-inv-row-retur   { color: var(--tf-status-batal); }
.tf-inv-row-disc    { color: var(--tf-status-selesai); }
.tf-inv-row-pending { color: var(--tf-status-retur); }

/* Overdue date highlight */
.tf-inv-overdue { color: var(--tf-status-batal); font-weight: 700; }
