/* =============================================
   DelayBuddy Affiliate Dashboard
   Brand: Gold #EDB900, Dark #3B3A40
   ============================================= */

/* --- Hide original header, footer, admin bar --- */
body.page-template-default header#brx-header,
body.page-template-default .brxe-header,
header#brx-header {
    display: none !important;
}
body.page-template-default footer#brx-footer,
footer#brx-footer {
    display: none !important;
}
body.page-template-default #wpadminbar {
    display: none !important;
}
body.page-template-default {
    margin-top: 0 !important;
}
html {
    margin-top: 0 !important;
}
.db-affiliate-header {
    background: #3B3A40;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.db-affiliate-header a { display: inline-block; line-height: 0; }
.db-affiliate-header svg { height: 30px; width: auto; }

/* --- Page background & reset Bricks section padding --- */
#brx-content .brxe-section {
    background: #fff !important;
    padding: 0 !important;
}

/* --- Reset Bricks shortcode wrapper (has ID-based border/shadow from Bricks) --- */
#brx-content .brxe-shortcode {
    max-width: 700px !important;
    margin: 0 auto !important;
    padding: 24px 20px 48px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* --- Tab Navigation --- */
/* Wraps rather than scrolls: a scrolling bar with a hidden scrollbar clipped
   "Log out" off the right edge with nothing to hint it could be reached. */
#brx-content #affwp-affiliate-dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    row-gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    border-bottom: 2px solid #E4E3EA;
}

#brx-content .affwp-affiliate-dashboard-tab {
    padding: 0;
    margin: 0;
}

#brx-content .affwp-affiliate-dashboard-tab a {
    display: inline-block;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #6F6D78;
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

#brx-content .affwp-affiliate-dashboard-tab a:hover {
    color: #3B3A40;
}

#brx-content .affwp-affiliate-dashboard-tab.active a {
    color: #3B3A40;
    font-weight: 600;
    border-bottom-color: #EDB900;
}

/* Log out tab to the right */
#brx-content .affwp-affiliate-dashboard-tab:last-child {
    margin-left: auto;
}
#brx-content .affwp-affiliate-dashboard-tab:last-child a {
    color: #B0AEB8;
    font-weight: 400;
}
#brx-content .affwp-affiliate-dashboard-tab:last-child a:hover {
    color: #c0392b;
}

/* --- Tab Content Area --- */
#brx-content .affwp-tab-content {
    animation: affwpFadeIn 0.3s ease;
}
@keyframes affwpFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Cards --- */
#brx-content .affwp-card {
    background: #fff;
    border: 1px solid #E4E3EA;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(59,58,64,0.06);
    margin-bottom: 16px;
    overflow: hidden;
}

#brx-content .affwp-card__header {
    padding: 16px 20px 0;
}

#brx-content .affwp-card__header h4,
#brx-content .affwp-card__header h3,
#brx-content .affwp-card__header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #3B3A40;
    margin: 0 0 2px;
}

/* AffiliateWP prints some card hints as a bare <p> next to the heading
   (the Custom Link Generator's "Enter any URL..." is one): the dashboard's
   hint idiom -- small, gray, no uppercase -- so they match the other
   hints instead of body text. */
#brx-content .affwp-card__header p {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: #6F6D78;
}

#brx-content .affwp-card__content {
    padding: 14px 20px 18px;
}

#brx-content .affwp-card__footer {
    padding: 14px 20px;
    border-top: 1px solid #E4E3EA;
    background: #FAFAFE;
}

#brx-content .affwp-card__tooltip {
    color: #B0AEB8;
}

/* ========================================
   Statistics tab (templates/dashboard-tab-stats.php)
   ======================================== */
#brx-content .db-stats__title {
    font-size: 15px;
    font-weight: 600;
    color: #3B3A40;
    margin: 0 0 3px;
}

#brx-content .db-stats__sub {
    font-size: 12.5px;
    color: #6F6D78;
    margin: 0 0 16px;
}

#brx-content .db-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

#brx-content .db-stat {
    background: #fff;
    border: 1px solid #E4E3EA;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(59,58,64,0.06);
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

#brx-content .db-stat__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6F6D78;
    display: flex;
    align-items: center;
    gap: 6px;
}

#brx-content .db-stat__icon {
    width: 14px;
    height: 14px;
    flex: none;
    color: #B0AEB8;
}

#brx-content .db-stat__value {
    font-size: 30px;
    font-weight: 650;
    color: #3B3A40;
    line-height: 1.1;
    letter-spacing: -0.6px;
    font-variant-numeric: tabular-nums;
}

#brx-content .db-stat__hint {
    font-size: 11.5px;
    color: #B0AEB8;
    line-height: 1.45;
}

/* Gold rule on the earnings tile -- the only accent on the tab. */
#brx-content .db-stat--accent::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: #EDB900;
}

/* A zero reads as "nothing yet", not as a failed load. */
#brx-content .db-stat--zero .db-stat__value {
    color: #B0AEB8;
}

@media (max-width: 600px) {
    #brx-content .db-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   QR Card (built by JS above the link card)
   ======================================== */
#brx-content .db-qr-card {
    text-align: center;
}
#brx-content .db-qr-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#brx-content .db-qr-frame {
    border: 1.5px solid #E4E3EA;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    line-height: 0;
    display: inline-block;
}
#brx-content .db-qr-frame a {
    line-height: 0;
    display: inline-block;
}
#brx-content .db-qr-frame:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#brx-content .db-qr-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
#brx-content .db-qr-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: #EDB900;
    color: #3B3A40;
    border: 1.5px solid #EDB900;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
#brx-content .db-qr-copy-btn:hover {
    background: #D9A800;
    border-color: #D9A800;
}
#brx-content .db-qr-btn-row {
    display: flex;
    gap: 6px;
}
#brx-content .db-qr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fff;
    color: #3B3A40;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
#brx-content .db-qr-btn:hover {
    background: #F7F7FB;
    border-color: #ccc;
}

/* Hide the tooltip span on the affiliate link header */
#brx-content .affwp-affiliate-link__header > .affwp-card__tooltip {
    display: none;
}

/* --- Affiliate Link Input --- */
#brx-content .affwp-affiliate-link__display {
    display: flex;
    gap: 0;
    align-items: stretch;
}

#brx-content .affwp-affiliate-link__input,
#brx-content input.affwp-affiliate-link__input {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    color: #3B3A40;
    background: #F7F7FB;
    border: 1.5px solid #E4E3EA;
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}
#brx-content .affwp-affiliate-link__input:focus {
    border-color: #EDB900;
}
/* 039: in RTL locales (ar) the input inherits dir="rtl", and the trailing
   neutral "/" of the embedded LTR URL is re-laid to the paragraph side,
   visually jumping to the field's left edge. Force the URL's own base
   direction and anchor it left; identical rendering in LTR locales. */
#brx-content .affwp-affiliate-link__input {
    direction: ltr;
    text-align: left;
}

/* --- Copy Link Button --- */
#brx-content .affwp-affiliate-link-copy-link,
#brx-content button.affwp-affiliate-link-copy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    background: #EDB900;
    color: #3B3A40;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #EDB900;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
#brx-content .affwp-affiliate-link-copy-link:hover {
    background: #D9A800;
    border-color: #D9A800;
}
/* The button's label is a glyph, not a word (027): size it so the button
   centers and keeps its proportions like the old text label. The svg
   carries no width/height of its own, so this rule is load-bearing. */
#brx-content .affwp-affiliate-link-copy-link svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* --- Description paragraphs between cards --- */
#brx-content .affwp-tab-content > div > p.description,
#brx-content .affwp-tab-content > div > p {
    color: #6F6D78;
    font-size: 12px;
    margin: 4px 0 12px;
}

/* --- Custom Link Generator Form --- */
#brx-content .affwp-custom-link-generator {
    margin-top: 4px;
}

#brx-content .affwp-custom-link-generator h4,
#brx-content .affwp-custom-link-generator h3 {
    font-size: 15px;
    font-weight: 600;
    color: #3B3A40;
    margin: 0 0 2px;
}

#brx-content .affwp-custom-link-generator .description,
#brx-content .affwp-custom-link-generator p {
    color: #6F6D78;
    font-size: 12px;
    margin: 2px 0 14px;
}

#brx-content .affwp-card__content--form label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6F6D78;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* The generator's two labels read as headings for the card's sections --
   same scale as the card's own h3/h4 rules (15px / 600 / #3B3A40). The
   <label> elements stay: click-to-focus keeps working. Scoped to the
   generator form so the settings tab's labels above keep their uppercase
   treatment. */
#brx-content .affwp-custom-link-generator label[for="affwp-url"],
#brx-content .affwp-custom-link-generator label[for="affwp-campaign"] {
    font-size: 15px;
    font-weight: 600;
    color: #3B3A40;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 6px;
}

#brx-content .affwp-card__content--form input[type="url"],
#brx-content .affwp-card__content--form input[type="text"],
#brx-content .affwp-card__content--form input[type="email"] {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    color: #3B3A40;
    background: #F7F7FB;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    margin-bottom: 12px;
}
#brx-content .affwp-card__content--form input:focus {
    border-color: #EDB900;
}

#brx-content .affwp-generator-campaign-text-link-wrap a {
    color: #EDB900;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
#brx-content .affwp-generator-campaign-text-link-wrap a:hover {
    color: #D9A800;
    text-decoration: underline;
}

/* --- General Buttons --- */
#brx-content .affwp-tab-content .button,
#brx-content .affwp-tab-content button[type="submit"],
#brx-content .affwp-custom-link-submit-wrap .button,
#brx-content .affwp-save-profile-wrap .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #EDB900;
    color: #3B3A40;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #EDB900;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
#brx-content .affwp-tab-content .button:hover,
#brx-content .affwp-tab-content button[type="submit"]:hover,
#brx-content .affwp-custom-link-submit-wrap .button:hover,
#brx-content .affwp-save-profile-wrap .button:hover {
    background: #D9A800;
    border-color: #D9A800;
}

/* --- Tables --- */
#brx-content .affwp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid #E4E3EA;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

#brx-content .affwp-table thead th,
#brx-content .affwp-table th {
    background: #F7F7FB;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #6F6D78;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid #E4E3EA;
    /* Headers render on ONE line (032: СТАТУС and КОМПАНИЯ never wrap).
       027 had let labels wrap because ru «КОНВЕРТИРОВАН» outgrew its
       column; that word is «Конверт.» since 027's translation fix, so
       nowrap is safe again -- and the Description column yields the space
       instead: its cells cap their width and wrap by words (rule below). */
    white-space: nowrap;
}

/* Same labels, repeated by the responsive card layout as ::before content. */
#brx-content .affwp-table-responsive td::before {
    white-space: nowrap;
}

#brx-content .affwp-table tbody td,
#brx-content .affwp-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: #3B3A40;
    border-bottom: 1px solid #F3F3F8;
}
#brx-content .affwp-table tbody tr:last-child td { border-bottom: none; }
#brx-content .affwp-table tbody tr:hover td { background: #FAFAFE; }

/* The Claims Description cell is the column that yields when the nowrap
   headers claim their width: capped, and its long content wraps by words
   (the td default) across as many lines as it needs -- nothing is
   truncated. */
#brx-content .affwp-table td.referral-description {
    max-width: 340px;
}

#brx-content .affwp-table .affwp-table-no-data td {
    text-align: center;
    color: #B0AEB8;
    padding: 24px 14px;
    font-style: italic;
}

/* --- Settings / Forms --- */
#brx-content .affwp-form {
    background: #fff;
    border: 1px solid #E4E3EA;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(59,58,64,0.06);
}

#brx-content .affwp-form h4,
#brx-content .affwp-form h3,
#brx-content .affwp-form h2 {
    font-size: 15px;
    font-weight: 600;
    color: #3B3A40;
    margin: 0 0 12px;
}

#brx-content .affwp-payout-method-status {
    color: #6F6D78;
    font-size: 13px;
    margin-bottom: 14px;
}

#brx-content .affwp-payment-email-wrap label,
#brx-content .affwp-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6F6D78;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

#brx-content .affwp-payment-email-wrap input[type="email"],
#brx-content .affwp-payment-email-wrap input[type="text"],
#brx-content .affwp-form input[type="email"],
#brx-content .affwp-form input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 13px;
    color: #3B3A40;
    background: #F7F7FB;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
#brx-content .affwp-form input:focus {
    border-color: #EDB900;
}

/* The dashboard's common hint style. The two extra selectors reuse these
   values where a bare .description would be out-ranked (the generator's own
   paragraph rules) or where the paragraph carries no class (the
   affiliate-link card header, which keeps this lighter hint-grey on top of
   the general card-header paragraph rule near the top of the file). */
#brx-content .affwp-payment-email-desc,
#brx-content .description,
#brx-content .affwp-custom-link-generator .db-url-hint,
#brx-content .affwp-affiliate-link .affwp-card__header p {
    color: #6F6D78;
    font-size: 12px;
    margin-top: 4px;
}

/* Notification checkbox */
#brx-content .affwp-send-notifications-wrap {
    margin: 16px 0;
}
#brx-content .affwp-send-notifications-wrap label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #3B3A40;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
#brx-content .affwp-send-notifications-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #EDB900;
    cursor: pointer;
}

/* --- Graphs tab --- */
#brx-content .affwp-tab-content canvas {
    border-radius: 8px;
    border: 1px solid #E4E3EA;
    padding: 12px;
    background: #fff;
}

/* --- Onboarding Tour --- */
.db-tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999990;
    display: none;
}
.db-tour-overlay.active { display: block; }

.db-tour-highlight {
    position: relative;
    z-index: 999991;
    box-shadow: 0 0 0 4px #EDB900, 0 0 0 9999px rgba(0,0,0,0.5);
    border-radius: 10px;
}

.db-tour-box {
    position: fixed;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    color: #3B3A40;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    z-index: 999992;
    display: none;
}
.db-tour-box.active { display: block; }

.db-tour-close {
    position: absolute; top: 10px; right: 12px;
    border: 0; background: none;
    font-size: 18px; cursor: pointer; color: #B0AEB8; line-height: 1;
    width: 24px; height: 24px; display: grid; place-items: center;
    border-radius: 4px;
}
.db-tour-close:hover { color: #3B3A40; background: #F7F7FB; }

.db-tour-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.db-tour-text { font-size: 13px; color: #6F6D78; line-height: 1.5; margin-bottom: 14px; }
.db-tour-footer { display: flex; justify-content: space-between; align-items: center; }
.db-tour-dots { display: flex; gap: 5px; }
.db-tour-dot { width: 7px; height: 7px; border-radius: 50%; background: #E4E3EA; }
.db-tour-dot.on { background: #EDB900; }
.db-tour-dot.done { background: #6F6D78; }
.db-tour-btns { display: flex; gap: 6px; }
.db-tour-btn {
    padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
    cursor: pointer; border: 1.5px solid #E4E3EA; background: #fff; color: #3B3A40;
}
.db-tour-btn:hover { background: #F7F7FB; }
.db-tour-btn:disabled { opacity: 0.35; cursor: default; }
.db-tour-btn.primary { background: #EDB900; border-color: #EDB900; font-weight: 600; }
.db-tour-btn.primary:hover { background: #D9A800; border-color: #D9A800; }

/* --- Shared range filter (Statistics, Graphs, Claims, Visits, Payouts) --- */
#brx-content .db-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 16px;
}
#brx-content .db-range__presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#brx-content .db-range__pill {
    padding: 6px 13px;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    background: #fff;
    color: #6F6D78;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#brx-content .db-range__pill:hover {
    background: #F7F7FB;
    color: #3B3A40;
}
#brx-content .db-range__pill.is-active {
    background: #EDB900;
    border-color: #EDB900;
    color: #3B3A40;
    font-weight: 600;
}

/* The filter toggles (Status, Company): <details> sitting in the presets row
   like pills -- ordinary flex items whose summary pills size them. */
#brx-content .db-range .db-status-filter,
#brx-content .db-range .db-company-filter {
    display: inline-flex;
}
/* The summaries borrow the whole pill look from .db-range__pill; this adds the
   caret and the affordances a summary needs (the marker triangle browsers
   give summaries, including Safari's ::-webkit-details-marker, is suppressed
   in favor of the ::after caret). */
#brx-content details.db-status-filter > summary.db-range__pill,
#brx-content details.db-company-filter > summary.db-range__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    cursor: pointer;
}
#brx-content details.db-status-filter > summary.db-range__pill::-webkit-details-marker,
#brx-content details.db-company-filter > summary.db-range__pill::-webkit-details-marker {
    display: none;
}
#brx-content details.db-status-filter > summary.db-range__pill::after,
#brx-content details.db-company-filter > summary.db-range__pill::after {
    content: '▾';
}
#brx-content details.db-status-filter[open] > summary.db-range__pill::after,
#brx-content details.db-company-filter[open] > summary.db-range__pill::after {
    content: '▴';
}
/* Each filter's pills row is a sibling of the presets row (a .db-range column
   child, spaced by the column's gap): hidden unless the row above it holds
   that filter's open details, then displayed as its own pills row under the
   filter row -- only the matching pair opens (Status open shows status pills,
   Company open shows company pills). The details lives inside the presets row
   while the options div is a child of .db-range, so the two are NOT siblings
   -- a bare details[open] ~ .db-status__options can never match -- and
   :has() (Baseline in all engines since Dec 2023) bridges that one level. */
#brx-content .db-range .db-status__options,
#brx-content .db-range .db-company__options {
    display: none;
}
#brx-content .db-range .db-range__presets:has(> details.db-status-filter[open]) ~ .db-status__options,
#brx-content .db-range .db-range__presets:has(> details.db-company-filter[open]) ~ .db-company__options {
    display: flex;
}

#brx-content .db-range__custom {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    background: #F7F7FB;
    border: 1px solid #E4E3EA;
    border-radius: 8px;
}
/* The theme gives every label a bottom margin, which left the fields sitting
   short of the button on a flex-end row. */
#brx-content .db-range__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
}
#brx-content .db-range__field span {
    font-size: 10.5px;
    font-weight: 600;
    color: #6F6D78;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
/* One shared control height so the inputs and the button read as a single row.
   The theme forces line-height: 40px on inputs, which inflated them to 56px. */
#brx-content .db-range__custom input[type="date"] {
    box-sizing: border-box;
    height: 38px;
    padding: 0 10px;
    line-height: normal;
    font-size: 13px;
    font-family: inherit;
    color: #3B3A40;
    background: #fff;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}
#brx-content .db-range__custom input[type="date"]:focus {
    border-color: #EDB900;
}
/* Matches the generic dashboard button rule on specificity and sits later in
   the file, so the height and padding here win. */
#brx-content .db-range__custom button.db-range__apply {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    line-height: normal;
    background: #EDB900;
    color: #3B3A40;
    border: 1.5px solid #EDB900;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
#brx-content .db-range__custom button.db-range__apply:hover {
    background: #D9A800;
    border-color: #D9A800;
}

/* --- Sortable table headers --- */
#brx-content .affwp-table th .db-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}
#brx-content .affwp-table th .db-sort:hover {
    color: #3B3A40;
}
#brx-content .affwp-table th.is-sorted {
    color: #3B3A40;
}
#brx-content .db-sort__mark {
    font-size: 10px;
    color: #EDB900;
}

/* --- Column-header tooltips (037) --- */
/* CSS-only, instant on hover, no JS: the hint text rides data-hint on the th
   (sortable ths get it from delaybuddy_sortable_th(), the payouts lifetime/
   unpaid plain ths carry it directly). Desktop-only by nature -- the mobile
   card view hides thead. The resets (text-transform, letter-spacing) undo the
   th rule above so the hint reads as a sentence, not a heading. No arrow,
   kept minimal. */
#brx-content .affwp-table th[data-hint] { position: relative; }
#brx-content .affwp-table th[data-hint]:hover::after {
    content: attr(data-hint);
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 10;
    width: max-content; max-width: 260px;
    background: #3B3A40; color: #fff; font-size: 11px; font-weight: 400;
    text-transform: none; letter-spacing: 0; line-height: 1.5;
    padding: 6px 10px; border-radius: 6px; pointer-events: none;
    white-space: normal; text-align: start;
}
/* 038: the table's overflow: hidden (see the .affwp-table rule above) clips
   a left-anchored box on the last two columns (Campaign + Status in Claims;
   the last column elsewhere) -- anchor those from the right so the box
   grows leftwards inside the table. Harmless where the second-to-last
   never clips: the box is max-width-bounded either way. */
#brx-content .affwp-table th[data-hint]:nth-last-child(-n+2):hover::after {
    left: auto; right: 0;
}

/* --- Graphs tab --- */
#brx-content .db-chart {
    background: #fff;
    border: 1px solid #E4E3EA;
    border-radius: 10px;
    padding: 16px 18px 12px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(59,58,64,0.06);
}

#brx-content .db-chart__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
#brx-content .db-chart__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6F6D78;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
#brx-content .db-chart__total {
    font-size: 18px;
    font-weight: 600;
    color: #3B3A40;
    white-space: nowrap;
}
#brx-content .db-chart--accent .db-chart__total {
    color: #B98F00;
}
#brx-content .db-chart__total-note {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #B0AEB8;
    text-transform: none;
    letter-spacing: 0;
    text-align: right;
}

/* The SVG carries no intrinsic height -- preserveAspectRatio is none so the
   plot stretches to whatever box we give it here. */
#brx-content .db-chart__svg {
    display: block;
    width: 100%;
    height: 150px;
    overflow: visible;
}
#brx-content .db-chart__grid {
    stroke: #F3F3F8;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
#brx-content .db-chart__axis {
    stroke: #E4E3EA;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

#brx-content .db-chart__scale,
#brx-content .db-chart__dates {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #B0AEB8;
}
#brx-content .db-chart__scale {
    /* Sits above the plot as a min/max legend rather than a real y-axis. */
    margin-top: -150px;
    height: 138px;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
}
#brx-content .db-chart__dates {
    margin-top: 6px;
}

#brx-content .db-chart__empty {
    padding: 28px 0;
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: #B0AEB8;
}

/* --- Custom Link Delete Action --- */
#brx-content .db-delete-custom-link,
#brx-content .db-qr-custom-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: #B0AEB8;
    cursor: pointer;
    transition: color 0.15s;
}
#brx-content .db-delete-custom-link:hover {
    color: #D64545;
}
#brx-content .db-qr-custom-link:hover {
    color: #3B3A40;
}

/* The row actions anchor the QR popover (041): absolutely positioned under
   the trigger, so the container needs a positioning context. */
#brx-content .affwp-custom-link-actions {
    position: relative;
}

/* --- Custom Link QR Popover (041) --- */
/* White card matching the dashboard's tooltip idiom: 1.5px hairline border,
   6px radius, the tooltip's shadow scale. Hidden by default, shown only via
   .is-open -- though the JS builds the menu on open and removes it on close,
   so the class is the open-state contract the CSS keeps honest. */
#brx-content .db-qr-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    display: flex;
    gap: 2px;
    padding: 6px;
    background: #fff;
    border: 1.5px solid #E4E3EA;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    white-space: nowrap;
}
/* The table's overflow: hidden (border-radius clipping, see the 038 note on
   .affwp-table) cuts off anything extending past its border box, so the
   popover cannot simply open downward from the last row's trigger -- most of
   its ~43px would fall outside the table. JS (anchorQrMenu) measures the room
   left inside the table and adds this modifier when downward does not fit:
   anchor upward instead. Measured, not tr:last-child-guessed: it also covers
   a second-to-last row on a table with a footer row, should one appear. */
#brx-content .db-qr-menu--up {
    top: auto;
    bottom: calc(100% + 6px);
}
#brx-content .db-qr-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: #6F6D78;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
#brx-content .db-qr-menu-btn:hover {
    background: #F7F7FB;
    color: #3B3A40;
}
#brx-content .db-qr-menu-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}
#brx-content .db-qr-menu.is-open {
    display: flex;
}
#brx-content .db-qr-menu:not(.is-open) {
    display: none;
}

/* While confirming, the row's own actions step aside so there is exactly one
   thing to click. The link itself stays visible -- that is the context. */
#brx-content tr.db-confirming .affwp-custom-link-actions {
    display: none;
}
#brx-content tr.db-confirming td {
    background: #FFFBF0;
}

#brx-content .db-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #EFEDE4;
}
#brx-content .db-confirm-text {
    font-size: 12px;
    color: #6F6D78;
}
#brx-content tr.db-delete-failed .db-confirm-text {
    color: #D64545;
}
#brx-content .db-confirm-btns {
    display: flex;
    gap: 6px;
}
#brx-content .db-confirm-cancel,
#brx-content .db-confirm-delete {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
#brx-content .db-confirm-cancel {
    background: #fff;
    color: #3B3A40;
    border: 1.5px solid #E4E3EA;
}
#brx-content .db-confirm-cancel:hover {
    background: #F7F7FB;
}
#brx-content .db-confirm-delete {
    background: #D64545;
    color: #fff;
    border: 1.5px solid #D64545;
    font-weight: 600;
}
#brx-content .db-confirm-delete:hover {
    background: #BE3A3A;
    border-color: #BE3A3A;
}
#brx-content .db-confirm-delete:disabled {
    opacity: 0.6;
    cursor: default;
}

#brx-content tr.db-row-leaving {
    opacity: 0;
    transition: opacity 0.2s;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    #brx-content .brxe-shortcode {
        padding: 16px 12px 32px;
    }
    #brx-content #affwp-affiliate-dashboard-tabs {
        gap: 0;
        margin-bottom: 16px;
    }
    #brx-content .affwp-affiliate-dashboard-tab a {
        padding: 8px 10px;
        font-size: 12px;
    }
    #brx-content .affwp-affiliate-link__display {
        flex-direction: column;
    }
    #brx-content .affwp-affiliate-link__input {
        border-right: 1.5px solid #E4E3EA;
        border-radius: 6px;
    }
    #brx-content .affwp-affiliate-link-copy-link {
        border-radius: 6px;
        margin-top: 6px;
    }
    #brx-content .affwp-card__header,
    #brx-content .affwp-card__content {
        padding-left: 14px;
        padding-right: 14px;
    }
    #brx-content .affwp-form {
        padding: 14px;
    }
    #brx-content .affwp-affiliate-dashboard-tab:last-child {
        margin-left: 0;
    }
}

/* --- Statistics: period value with the lifetime figure kept underneath --- */
#brx-content .db-stat__period {
    font-size: 11px;
    font-weight: 600;
    color: #B0AEB8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: -2px;
}
#brx-content .db-stat__lifetime {
    font-size: 11.5px;
    color: #6F6D78;
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px solid #F3F3F8;
    font-variant-numeric: tabular-nums;
}

/* --- Payouts: the three stat cards double as the table's status filter --- */
/* The grid itself reuses .db-stat-grid (already 3-up); only the gap to the
   table below is new. */
#brx-content .db-payout-filters {
    margin-bottom: 16px;
}
/* Link affordance: the card is an <a>, so it needs the pill treatment on top
   of the static card look. */
#brx-content .db-payout-filters .db-stat {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#brx-content .db-payout-filters .db-stat:hover {
    background: #F7F7FB;
    border-color: #EDB900;
}
/* The pill-accent gold as a border plus a 1px ring, so the active card reads
   stronger than the same-colour hover without shifting the layout. */
#brx-content .db-payout-filters .db-stat.is-active {
    border-color: #EDB900;
    box-shadow: 0 0 0 1px #EDB900, 0 1px 4px rgba(59,58,64,0.06);
}
