/* RESELLERAPP-CORE
   Focused reseller portal. Same design-token approach as the customer portal
   (yeetapp) so both sites stay one visual family and a future palette change
   is a token edit, not a rewrite. Prefix .ra- to avoid clashing with the
   theme's Bootstrap. */

:root {
    --ra-brand: #2563eb;
    --ra-brand-dark: #1d4ed8;
    --ra-bg: #eef2f7;
    --ra-card: #ffffff;
    --ra-soft: #f1f5f9;
    --ra-ink: #0f172a;
    --ra-muted: #64748b;
    --ra-line: #e2e8f0;
    --ra-ok: #16a34a;
    --ra-warn: #f59e0b;
    --ra-danger: #dc2626;
    --ra-radius: 14px;
    --ra-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
}

html[data-ra-theme="dark"] {
    --ra-bg: #0b1220;
    --ra-card: #111827;
    --ra-soft: #1f2937;
    --ra-ink: #f1f5f9;
    --ra-muted: #94a3b8;
    --ra-line: #1f2937;
    --ra-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

html:has(body.resellerapp) { background: var(--ra-bg); }

body.resellerapp {
    background: var(--ra-bg);
    color: var(--ra-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
}

/* ---- shell ------------------------------------------------------------- */
.ra-shell { display: flex; min-height: 100vh; }

.ra-side {
    width: 244px; flex: 0 0 244px; background: var(--ra-card);
    border-right: 1px solid var(--ra-line); padding: 18px 14px;
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.ra-brand {
    display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px;
    color: var(--ra-ink); text-decoration: none; padding: 4px 8px 16px;
}
.ra-brand:hover { color: var(--ra-ink); text-decoration: none; }
.ra-logo {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
    background: linear-gradient(135deg, var(--ra-brand), var(--ra-brand-dark));
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.ra-nav { display: flex; flex-direction: column; gap: 2px; }
.ra-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px;
    border-radius: 10px; color: var(--ra-muted); text-decoration: none;
    font-size: 14.5px; font-weight: 500;
}
.ra-nav a i { width: 18px; text-align: center; font-size: 15px; }
.ra-nav a:hover { background: var(--ra-soft); color: var(--ra-ink); text-decoration: none; }
.ra-nav a.on { background: var(--ra-brand); color: #fff; }
.ra-nav-sep { height: 1px; background: var(--ra-line); margin: 10px 6px; }

.ra-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ra-top {
    display: flex; align-items: center; gap: 12px; padding: 14px 26px;
    background: var(--ra-card); border-bottom: 1px solid var(--ra-line);
}
.ra-hello { font-weight: 600; font-size: 15px; }
.ra-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ra-iconbtn {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ra-line);
    background: var(--ra-card); color: var(--ra-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.ra-iconbtn:hover { background: var(--ra-soft); color: var(--ra-ink); }
.ra-burger { display: none; }
.ra-content { padding: 24px 26px 40px; flex: 1 0 auto; }

/* ---- page furniture ---------------------------------------------------- */
.ra-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ra-pagehead > .ra-btn { flex: none; }
.ra-pagehead h1 { font-size: 21px; font-weight: 700; margin: 0; color: var(--ra-ink); }
.ra-pagehead p { margin: 3px 0 0; color: var(--ra-muted); font-size: 14px; }

.ra-card {
    background: var(--ra-card); border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); padding: 20px 22px;
}
.ra-card + .ra-card { margin-top: 16px; }
.ra-card h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: var(--ra-ink); }

.ra-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--ra-brand); color: #fff !important; border: 0; border-radius: 10px;
    padding: 10px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
    text-decoration: none !important;
}
.ra-btn:hover { background: var(--ra-brand-dark); color: #fff !important; }
.ra-btn-ghost {
    background: transparent; color: var(--ra-ink) !important;
    border: 1px solid var(--ra-line);
}
.ra-btn-ghost:hover { background: var(--ra-soft); color: var(--ra-ink) !important; }
.ra-btn-block { width: 100%; }

/* ---- overdue banner ---------------------------------------------------- */
.ra-alert {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    border-radius: var(--ra-radius); padding: 15px 18px; margin-bottom: 18px;
    background: #fffbeb; border: 1px solid #fde68a; color: #78350f;
}
.ra-alert.due { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.ra-alert i { font-size: 19px; }
.ra-alert .ra-btn { margin-left: auto; }
html[data-ra-theme="dark"] .ra-alert { background: #1f2937; border-color: #374151; color: #fbbf24; }
html[data-ra-theme="dark"] .ra-alert.due { background: #291a1a; border-color: #4b2626; color: #fca5a5; }

/* ---- credit packs ------------------------------------------------------ */
.ra-plan { margin-bottom: 22px; }
.ra-plan-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.ra-plan-head h2 { margin: 0; font-size: 16px; }
.ra-plan-note { color: var(--ra-muted); font-size: 13px; }

.ra-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.ra-pack {
    background: var(--ra-card); border: 1px solid var(--ra-line); border-radius: 12px;
    padding: 16px 15px; text-align: center; display: flex; flex-direction: column; gap: 4px;
    transition: border-color .12s, transform .12s;
}
.ra-pack:hover { border-color: var(--ra-brand); transform: translateY(-2px); }
.ra-pack-qty { font-size: 25px; font-weight: 800; color: var(--ra-ink); line-height: 1.1; }
.ra-pack-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ra-muted); }
.ra-pack-price { font-size: 16px; font-weight: 700; color: var(--ra-brand); margin: 8px 0 10px; }
.ra-pack .ra-btn { padding: 8px 14px; font-size: 13.5px; }

/* ---- tables ------------------------------------------------------------ */
.ra-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.ra-tbl th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ra-muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--ra-line);
}
.ra-tbl td { padding: 11px 10px; border-bottom: 1px solid var(--ra-line); color: var(--ra-ink); }
.ra-tbl tr:last-child td { border-bottom: 0; }
.ra-pill {
    display: inline-block; padding: 3px 10px; border-radius: 11px;
    font-size: 11.5px; font-weight: 600;
}
.ra-pill.paid { background: #dcfce7; color: #166534; }
.ra-pill.unpaid { background: #fee2e2; color: #991b1b; }
.ra-pill.other { background: var(--ra-soft); color: var(--ra-muted); }
html[data-ra-theme="dark"] .ra-pill.paid { background: #14311f; color: #86efac; }
html[data-ra-theme="dark"] .ra-pill.unpaid { background: #341818; color: #fca5a5; }

.ra-empty { color: var(--ra-muted); font-size: 14px; padding: 6px 2px; }

/* ---- guest shell ------------------------------------------------------- */
body.resellerapp.ra-guest { display: flex; flex-direction: column; min-height: 100vh; }
.ra-gtop { padding: 20px 26px; }
.ra-gbody { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 10px 20px 40px; }
.ra-gbody .ra-gwrap { width: 100%; max-width: 460px; }
.ra-gbody.wide .ra-gwrap { max-width: 1100px; }
body.resellerapp.ra-guest #main-body { min-height: 0 !important; }

/* ---- stock WHMCS content inside our shell ------------------------------ */
.ra-content .card { background: var(--ra-card); border-color: var(--ra-line); }
.ra-content .btn-primary { background: var(--ra-brand); border-color: var(--ra-brand); color: #fff !important; }
.ra-content .btn-primary:hover { background: var(--ra-brand-dark); border-color: var(--ra-brand-dark); }
.ra-content .btn-default, .ra-content .btn-secondary {
    background: var(--ra-card) !important; border: 1px solid var(--ra-line) !important; color: var(--ra-ink) !important;
}
.ra-content .form-control, .ra-content .form-select, .ra-content select, .ra-content input[type=text],
.ra-content input[type=email], .ra-content input[type=password], .ra-content textarea {
    background: var(--ra-card); border: 1px solid var(--ra-line); color: var(--ra-ink);
}
.ra-content a { color: var(--ra-brand); }
html[data-ra-theme="dark"] .ra-content .table, html[data-ra-theme="dark"] .ra-content table { color: var(--ra-ink); }
html[data-ra-theme="dark"] .ra-content .table th, html[data-ra-theme="dark"] .ra-content .table td { border-color: var(--ra-line); }

/* ---- footer ------------------------------------------------------------ */
.ra-foot {
    border-top: 1px solid var(--ra-line); padding: 16px 26px; color: var(--ra-muted);
    font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.ra-foot a { color: var(--ra-muted); text-decoration: none; }
.ra-foot a:hover { color: var(--ra-ink); }
.ra-foot .ra-copy { margin-left: auto; }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 900px) {
    .ra-side {
        position: fixed; left: 0; top: 0; z-index: 1200; transform: translateX(-100%);
        transition: transform .18s ease; box-shadow: 0 0 30px rgba(0,0,0,.2);
    }
    body.ra-menu-open .ra-side { transform: translateX(0); }
    .ra-burger { display: flex; }
    .ra-content { padding: 18px 16px 34px; }
    .ra-top { padding: 12px 16px; }
    .ra-foot { padding: 14px 16px; }
}
/* END RESELLERAPP-CORE */

/* RESELLERAPP-DATATABLES — stock WHMCS list pages (tickets, etc.) inside our shell */
.ra-content .table { color: var(--ra-ink); border-color: var(--ra-line); }
.ra-content .table thead th {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ra-muted); font-weight: 600; border-bottom: 1px solid var(--ra-line);
    background: transparent;
}
.ra-content .table td, .ra-content .table th { border-color: var(--ra-line); padding: 11px 10px; }
.ra-content .table tbody tr:hover { background: var(--ra-soft); }
.ra-content .dataTables_wrapper { background: var(--ra-card); border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); padding: 16px 18px; }
.ra-content .dataTables_filter input, .ra-content .dataTables_length select {
    background: var(--ra-card) !important; border: 1px solid var(--ra-line) !important;
    color: var(--ra-ink) !important; border-radius: 8px; padding: 5px 9px; appearance: auto !important;
}
.ra-content .dataTables_info, .ra-content .dataTables_filter,
.ra-content .dataTables_length, .ra-content .dataTables_paginate { color: var(--ra-muted); font-size: 13px; }
.ra-content .paginate_button {
    border-radius: 7px !important; border: 1px solid var(--ra-line) !important;
    background: var(--ra-card) !important; color: var(--ra-ink) !important; margin: 0 2px;
}
.ra-content .paginate_button.current {
    background: var(--ra-brand) !important; border-color: var(--ra-brand) !important; color: #fff !important;
}
.ra-content .paginate_button.disabled { opacity: .45; }
/* status labels WHMCS prints on ticket/invoice rows */
.ra-content .label.status { padding: 3px 10px; border-radius: 11px; font-size: 11.5px; font-weight: 600; }
/* END RESELLERAPP-DATATABLES */

/* RESELLERAPP-TOPBAR — cart, language pill, account menu */
.ra-cartbtn { position: relative; text-decoration: none !important; }
.ra-cart-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 9px; background: var(--ra-brand); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.ra-langbtn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    border: 1px solid var(--ra-line); border-radius: 18px; background: var(--ra-card);
    color: var(--ra-ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.ra-langbtn:hover { background: var(--ra-soft); }
.ra-langtxt { white-space: nowrap; }

.ra-usermenu { position: relative; }
.ra-avatar {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ra-line);
    background: var(--ra-soft); color: var(--ra-ink); cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-weight: 700; font-size: 15px; text-transform: uppercase; position: relative;
}
.ra-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ra-usermenu-pop {
    display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px;
    background: var(--ra-card); border: 1px solid var(--ra-line); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,.14); padding: 6px; z-index: 1100;
}
.ra-usermenu.open .ra-usermenu-pop { display: block; }
.ra-usermenu-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--ra-line); margin-bottom: 6px; }
.ra-usermenu-head .nm { font-weight: 700; font-size: 14.5px; color: var(--ra-ink); }
.ra-usermenu-head .em { font-size: 12.5px; color: var(--ra-muted); word-break: break-all; }
.ra-usermenu-pop a {
    display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 8px;
    color: var(--ra-ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.ra-usermenu-pop a i { width: 16px; text-align: center; color: var(--ra-muted); }
.ra-usermenu-pop a:hover { background: var(--ra-soft); text-decoration: none; }
.ra-usermenu-sep { height: 1px; background: var(--ra-line); margin: 6px 8px; }
.ra-usermenu-out, .ra-usermenu-out i { color: var(--ra-danger) !important; }
@media (max-width: 640px) { .ra-langtxt { display: none; } .ra-langbtn { padding: 0 10px; } }
/* END RESELLERAPP-TOPBAR */

/* RESELLERAPP-PLANPICK — dashboard shows ONE plan at a time (2 tidy rows) */
.ra-planpick { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ra-planpick label { font-weight: 600; font-size: 14px; color: var(--ra-ink); margin: 0; }
.ra-planpick select {
    width: auto; min-width: 150px; background: var(--ra-card); color: var(--ra-ink);
    border: 1px solid var(--ra-line); border-radius: 9px; padding: 7px 12px;
    font-size: 14px; appearance: auto;
}
/* five across = ten packs in two rows */
.ra-packs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 1100px) { .ra-packs { grid-template-columns: repeat(5, 1fr); } }
/* END RESELLERAPP-PLANPICK */

/* RESELLERAPP-DASHROW — two equal cards: what's owed | buy more credits */
.ra-dashrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ra-dashcol { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ra-dashcol h2 { margin: 0; font-size: 17px; }
.ra-dashcol .ra-empty { padding: 0; margin: 0 0 6px; }
.ra-dashcol .ra-btn { margin-top: auto; }
.ra-dashcol.due { border-color: #fecaca; }
html[data-ra-theme="dark"] .ra-dashcol.due { border-color: #4b2626; }
.ra-dash-ic {
    width: 42px; height: 42px; border-radius: 11px; display: flex;
    align-items: center; justify-content: center; font-size: 19px; margin-bottom: 8px;
}
.ra-dash-ic.due { background: #fef2f2; color: var(--ra-danger); }
.ra-dash-ic.ok { background: #dcfce7; color: var(--ra-ok); }
.ra-dash-ic.buy { background: #eff6ff; color: var(--ra-brand); }
html[data-ra-theme="dark"] .ra-dash-ic.due { background: #291a1a; }
html[data-ra-theme="dark"] .ra-dash-ic.ok  { background: #14311f; }
html[data-ra-theme="dark"] .ra-dash-ic.buy { background: #16233c; }
@media (max-width: 780px) { .ra-dashrow { grid-template-columns: 1fr; } }
/* END RESELLERAPP-DASHROW */

/* the stacked-card margin must not apply to cards sitting side by side in the
   dash row — it pushed the second card 16px lower than the first */
.ra-dashrow .ra-card + .ra-card { margin-top: 0 !important; }
.ra-dashrow > .ra-card { height: 100%; }

/* RESELLERAPP-COLLAPSE — icon-only sidebar rail, remembered across pages */
.ra-collapsebtn { display: flex; }
@media (max-width: 900px) { .ra-collapsebtn { display: none; } }
html.ra-collapsed .ra-side { width: 74px; flex: 0 0 74px; padding: 18px 10px; }
html.ra-collapsed .ra-side .ra-brand { justify-content: center; padding: 4px 0 16px; font-size: 0; gap: 0; }
html.ra-collapsed .ra-side .ra-nav a { justify-content: center; font-size: 0; gap: 0; padding: 11px 0; }
html.ra-collapsed .ra-side .ra-nav a i { font-size: 16px; width: auto; }
html.ra-collapsed .ra-side .ra-logo { font-size: 13px; }

/* dark mode: the plan <select> inherits Bootstrap's light .form-control */
html[data-ra-theme="dark"] .ra-planpick select,
html[data-ra-theme="dark"] #order-pure_comparison select,
html[data-ra-theme="dark"] select.form-control {
    background: var(--ra-card) !important; color: var(--ra-ink) !important;
    border-color: var(--ra-line) !important;
}
/* END RESELLERAPP-COLLAPSE */

/* hamburger: plain icon like the customer portal — no circle, no border */
.ra-collapsebtn, .ra-burger {
    width: auto !important; height: auto !important;
    border: 0 !important; background: transparent !important;
    padding: 2px 4px !important; font-size: 21px !important;
    color: var(--ra-ink) !important; line-height: 1;
}
.ra-collapsebtn:hover, .ra-burger:hover {
    background: transparent !important; color: var(--ra-brand) !important;
}

/* the focus ring lingers after a MOUSE click and reads as a stray circle —
   drop it for pointer input, keep it for keyboard users via :focus-visible */
.ra-collapsebtn:focus, .ra-burger:focus, .ra-iconbtn:focus, .ra-avatar:focus, .ra-langbtn:focus {
    outline: none !important; box-shadow: none !important;
}
.ra-collapsebtn:focus-visible, .ra-burger:focus-visible, .ra-iconbtn:focus-visible,
.ra-avatar:focus-visible, .ra-langbtn:focus-visible {
    outline: 2px solid var(--ra-brand) !important; outline-offset: 2px;
}

/* RESELLERAPP-DARK-STOCK
   Dark mode only covered our own .ra-* components. WHMCS's own guest pages
   (login, register, password reset) are built from stock Bootstrap cards, which
   stayed WHITE while the theme flipped the text to near-white — so the "Login"
   heading and every field label became invisible. Reported by the client
   2026-08-13. These rules give the stock components a dark surface to sit on. */
html[data-ra-theme="dark"] .card,
html[data-ra-theme="dark"] .panel,
html[data-ra-theme="dark"] .modal-content {
    background: var(--ra-card) !important;
    color: var(--ra-ink) !important;
    border-color: var(--ra-line) !important;
}
html[data-ra-theme="dark"] .card-header,
html[data-ra-theme="dark"] .card-footer,
html[data-ra-theme="dark"] .modal-header,
html[data-ra-theme="dark"] .modal-footer {
    background: var(--ra-soft) !important;
    color: var(--ra-ink) !important;
    border-color: var(--ra-line) !important;
}
/* headings + labels: these were the invisible ones */
html[data-ra-theme="dark"] .card h1, html[data-ra-theme="dark"] .card h2,
html[data-ra-theme="dark"] .card h3, html[data-ra-theme="dark"] .card h4,
html[data-ra-theme="dark"] .card label,
html[data-ra-theme="dark"] .card .control-label,
html[data-ra-theme="dark"] .card legend,
html[data-ra-theme="dark"] .custom-control-label,
html[data-ra-theme="dark"] .form-check-label { color: var(--ra-ink) !important; }
html[data-ra-theme="dark"] .card p,
html[data-ra-theme="dark"] .card .text-muted,
html[data-ra-theme="dark"] .card small { color: var(--ra-muted) !important; }

/* inputs, including Chrome's autofill which forces its own pale blue */
html[data-ra-theme="dark"] .form-control,
html[data-ra-theme="dark"] input[type="text"],
html[data-ra-theme="dark"] input[type="email"],
html[data-ra-theme="dark"] input[type="password"],
html[data-ra-theme="dark"] textarea,
html[data-ra-theme="dark"] select {
    background: var(--ra-soft) !important;
    color: var(--ra-ink) !important;
    border-color: var(--ra-line) !important;
}
html[data-ra-theme="dark"] .form-control::placeholder { color: var(--ra-muted) !important; }
html[data-ra-theme="dark"] input:-webkit-autofill,
html[data-ra-theme="dark"] input:-webkit-autofill:hover,
html[data-ra-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ra-ink) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--ra-soft) inset !important;
    caret-color: var(--ra-ink);
}
/* input-group add-ons (the person / key icons) and the reveal-password button */
html[data-ra-theme="dark"] .input-group-text,
html[data-ra-theme="dark"] .input-group-prepend .input-group-text,
html[data-ra-theme="dark"] .input-group-append .btn,
html[data-ra-theme="dark"] .btn-reveal-pw,
html[data-ra-theme="dark"] .btn-default {
    background: var(--ra-soft) !important;
    color: var(--ra-ink) !important;
    border-color: var(--ra-line) !important;
}
/* stock alerts / validation on guest pages */
html[data-ra-theme="dark"] .alert-info,
html[data-ra-theme="dark"] .alert-warning,
html[data-ra-theme="dark"] .alert-danger,
html[data-ra-theme="dark"] .alert-success { border-color: var(--ra-line) !important; }
html[data-ra-theme="dark"] hr { border-color: var(--ra-line) !important; }
/* END RESELLERAPP-DARK-STOCK */

/* RESELLERAPP-DARK-STOCK-2
   Second sweep (2026-08-15). Same root cause as every entry above and as the
   pwstrength bug: this theme was cloned from stock twenty-one, which has no
   dark mode, so a stock rule that paints a LIGHT background without also
   setting a colour leaves our near-white ink invisible on it. Each selector
   below was measured at 1.01-1.10:1 contrast before this block.

   Where a background is safe in BOTH themes, `transparent` is used instead of
   a dark-only override, so light mode is provably unchanged. */

/* 1. Stock paints every .table-list body cell #fff, and the DATATABLES block
      above styled thead th but never td — so headers went dark while the rows
      stayed white blocks. Hits 8 pages: Support, Services, Emails, Quotes,
      Affiliates, Domains, SSL, Domain pricing. */
.ra-content .table-list > tbody > tr > td { background-color: transparent; }
.ra-content .table-list > tbody > tr:hover > td { background-color: var(--ra-soft); }

/* 2. The file-picker label is where WHMCS writes the CHOSEN FILENAME, so a
      reseller attaching a file to a ticket could not see what they attached
      (or that anything attached). It is a <label>, not a .form-control, so the
      dark input rules above never reached it. */
html[data-ra-theme="dark"] .custom-file-label {
    background-color: var(--ra-soft) !important;
    border-color: var(--ra-line) !important;
    color: var(--ra-ink) !important;
}
html[data-ra-theme="dark"] .custom-file-label::after {
    background-color: var(--ra-line) !important;
    color: var(--ra-ink) !important;
}

/* 3. Money totals: stock paints these rows #efefef with no colour, so the
      amount due was invisible on mass-pay, the upgrade summary and the payment
      page's invoice summary. (viewinvoice/viewquote are standalone pages that
      never load this stylesheet, so they are unaffected.) */
html[data-ra-theme="dark"] tr.masspay-total > td,
html[data-ra-theme="dark"] .invoice-summary-table td.total-row,
html[data-ra-theme="dark"] .invoice-summary-table tr.total-row > td {
    background-color: var(--ra-soft) !important;
    color: var(--ra-ink) !important;
}

/* 4. Markdown surfaces in tickets: the live Preview pane and any table inside
      a ticket message are painted #fff / #f8f8f8 by stock with no colour. */
html[data-ra-theme="dark"] .md-editor > .md-preview,
html[data-ra-theme="dark"] .markdown-content table,
html[data-ra-theme="dark"] .md-preview table {
    background-color: var(--ra-card) !important;
    border-color: var(--ra-line) !important;
    color: var(--ra-ink) !important;
}
html[data-ra-theme="dark"] .markdown-content table > thead > tr > th,
html[data-ra-theme="dark"] .md-preview table > thead > tr > th {
    background-color: var(--ra-soft) !important;
    border-color: var(--ra-line) !important;
    color: var(--ra-ink) !important;
}
html[data-ra-theme="dark"] .markdown-content table > tbody > tr > td,
html[data-ra-theme="dark"] .md-preview table > tbody > tr > td {
    border-color: var(--ra-line) !important;
}

/* 5. Remaining stock light panels: the ticket-feedback rating scale (the
      Worst..Best labels vanished, leaving unlabelled radio buttons), the
      sub-user invite acceptance box, and the account-switch panel. */
html[data-ra-theme="dark"] .ticketfeedbackstaffcont,
html[data-ra-theme="dark"] .invite-box,
html[data-ra-theme="dark"] .continue-container {
    background-color: var(--ra-soft) !important;
    border-color: var(--ra-line) !important;
}
/* END RESELLERAPP-DARK-STOCK-2 */

/* RESELLERAPP-GUEST-TOPBAR — the guest header was brand-only, so login/register
   and the order pages had an empty top-right corner in both themes. */
.ra-gtop { display: flex; align-items: center; gap: 12px; }
.ra-gtop .ra-brand { margin: 0; }
.ra-gtop .ra-right { margin-left: auto; }
@media (max-width: 640px) { .ra-gtop { padding: 14px 16px; } }
/* END RESELLERAPP-GUEST-TOPBAR */
