/* ============================================================
   cabinet.css — Cabinet design system refresh
   Premium dark + gold aesthetic matching donate.css / guest.css palette.
   Loads AFTER admin.css — overrides and extends, never resets the base layer.
   All .topbar* and .sidebar* selectors remain in admin.css.
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   Single source of truth for page-level agents.
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-base:   #0a0e1a;
    --bg-page:   #0e1320;
    --bg-card:   #131826;
    --bg-raised: #1c2333;

    /* Gold system — matches donate.css exactly */
    --gold-1:    #fbe49b;          /* lightest highlight */
    --gold-2:    #d8a94b;          /* mid tone / accent */
    --gold-3:    #b8870a;          /* deep amber */
    --gold-soft: #f5e4a4;          /* body text on gold bg */
    --gold-grad: linear-gradient(135deg, #fbe49b 0%, #d8a94b 60%, #b8870a 100%);

    /* Blue accent */
    --accent-blue: #5ca7ff;

    /* Text */
    --text:       #cfd8e8;
    --text-muted: #8a99b3;
    --text-gold:  #f5e4a4;

    /* Borders */
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(212, 175, 55, 0.28);

    /* Radii */
    --r-sm:   8px;
    --r-md:   14px;
    --r-lg:   18px;
    --r-pill: 999px;

    /* Transitions */
    --t-fast: 0.15s ease;
    --t-std:  0.22s ease;

    /* Status */
    --color-success: #4bb36e;
    --color-warning: #d8a94b;
    --color-danger:  #cf5d5d;
    --color-info:    #5ca7ff;
}

/* ============================================================
   ENTRANCE ANIMATION — used by page agents via .fade-in
   ============================================================ */
@keyframes cab-fadein-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes cab-shimmer-sweep {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes cab-glow-pulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1; }
}

.fade-in {
    animation: cab-fadein-up 0.40s ease both;
}

/* ============================================================
   PAGE — main content wrapper
   ============================================================ */
.page {
    max-width: 100%;
}

/* ============================================================
   PAGE HEADER — gold gradient title, eyebrow, subtitle
   ============================================================ */
.page-header {
    position: relative;
    margin-bottom: 20px;
    padding: 26px 28px;
    border: 1px solid var(--border-gold);
    border-radius: var(--r-lg);
    background:
        radial-gradient(ellipse 70% 80% at 5% 0%, rgba(212, 175, 55, 0.10) 0%, transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
        var(--bg-card);
    overflow: hidden;
}

/* Gold shimmer line along the top edge */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.65) 30%,
        rgba(240, 198, 116, 0.90) 50%,
        rgba(212, 175, 55, 0.65) 70%,
        transparent 100%
    );
    pointer-events: none;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 26px);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #f5e4a4 0%, #f0c674 25%, #d4af37 60%, #b8870a 85%, #e8c960 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 220% auto;
}

.page-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

/* Optional eyebrow label above h1 */
.page-header__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 10px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.22);
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================================
   SECTION HEADER — eyebrow + title + optional CTA
   New shared component for page agents.
   ============================================================ */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.section-header__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-header__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: var(--r-pill);
    background: rgba(92, 167, 255, 0.10);
    border: 1px solid rgba(92, 167, 255, 0.22);
    color: #9fd0ff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    width: fit-content;
}

.section-header__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.section-header__cta {
    flex-shrink: 0;
}

/* ============================================================
   CARD — primary surface (used by .card and fieldset in markup)
   admin.css defines base; here we refine to match premium palette.
   ============================================================ */
.card,
fieldset {
    position: relative;
    margin: 0 0 20px;
    padding: 22px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.033), rgba(255, 255, 255, 0.008)),
        var(--bg-card);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 20px 48px rgba(0, 0, 0, 0.28);
    transition: border-color var(--t-std), box-shadow var(--t-std), transform var(--t-fast);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 24px 56px rgba(0, 0, 0, 0.34);
    transform: translateY(-1px);
}

/* Gold-accented card variant — hover with gold border */
.card--gold,
.card.card--gold:hover {
    border-color: var(--border-gold);
    background:
        radial-gradient(ellipse at 85% 0%, rgba(212, 175, 55, 0.09) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), rgba(255, 255, 255, 0.007)),
        var(--bg-card);
}

.card--gold:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.10),
        0 24px 56px rgba(0, 0, 0, 0.34),
        0 0 28px rgba(212, 175, 55, 0.06);
}

/* Ghost / minimal card */
.card--ghost {
    background: rgba(255, 255, 255, 0.018);
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.card > h2:first-child,
fieldset > legend {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.card__intro {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ============================================================
   CABINET-CARD — alias for .card usable by page agents
   Supports --feature (gold highlight top) and --ghost modifiers
   ============================================================ */
.cabinet-card {
    position: relative;
    padding: 22px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), rgba(255, 255, 255, 0.007)),
        var(--bg-card);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 18px 40px rgba(0, 0, 0, 0.26);
    transition: border-color var(--t-std), box-shadow var(--t-std), transform var(--t-fast);
}

.cabinet-card:hover {
    border-color: rgba(255, 255, 255, 0.10);
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 24px 52px rgba(0, 0, 0, 0.32);
}

/* Feature variant — gold shimmer top line */
.cabinet-card--feature {
    border-color: var(--border-gold);
    background:
        radial-gradient(ellipse at 80% 0%, rgba(212, 175, 55, 0.09) 0%, transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), rgba(255, 255, 255, 0.007)),
        var(--bg-card);
}

.cabinet-card--feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.75) 50%,
        transparent
    );
    border-radius: var(--r-pill);
    pointer-events: none;
}

/* Ghost variant — almost invisible surface */
.cabinet-card--ghost {
    background: rgba(255, 255, 255, 0.015);
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

/* ============================================================
   STAT CARD — dashboard tiles (like .stat in admin but enhanced)
   ============================================================ */
.stat,
.stat-card {
    position: relative;
    padding: 18px 20px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.006)),
        rgba(20, 30, 46, 0.92);
    transition: border-color var(--t-std), box-shadow var(--t-std), transform var(--t-fast);
}

.stat:hover,
.stat-card:hover {
    border-color: rgba(212, 175, 55, 0.20);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.06),
        0 10px 28px rgba(0, 0, 0, 0.26);
    transform: translateY(-2px);
}

.stat__label,
.stat-card__label {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.stat__value,
.stat-card__value {
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat__value--currency {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.stat__value--currency img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

/* Green login value */
.stat__value--login {
    color: #7ee08d;
    text-shadow: 0 0 14px rgba(126, 224, 141, 0.18);
}

/* Gold stat value */
.stat-card__value--gold {
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card__sub {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* ============================================================
   ALERTS & NOTICES
   ============================================================ */
.notice,
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.55;
    position: relative;
}

/* Color dot indicator */
.notice::before,
.alert::before {
    content: '';
    flex-shrink: 0;
    margin-top: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.notice {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.notice::before { background: rgba(255, 255, 255, 0.4); }

.notice--error,
.alert--error {
    border-color: rgba(207, 93, 93, 0.35);
    background: rgba(207, 93, 93, 0.09);
    color: #f5a3a3;
}

.notice--error::before,
.alert--error::before {
    background: #cf5d5d;
    box-shadow: 0 0 6px rgba(207, 93, 93, 0.6);
}

.alert--success {
    border-color: rgba(75, 179, 110, 0.32);
    background: rgba(75, 179, 110, 0.09);
    color: #98f0be;
}

.alert--success::before {
    background: #4bb36e;
    box-shadow: 0 0 6px rgba(75, 179, 110, 0.55);
}

.alert--warning {
    border-color: rgba(216, 169, 75, 0.35);
    background: rgba(216, 169, 75, 0.09);
    color: #ffe7a7;
}

.alert--warning::before {
    background: var(--gold-2);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.alert--info {
    border-color: rgba(92, 167, 255, 0.28);
    background: rgba(92, 167, 255, 0.07);
    color: #9fd0ff;
}

.alert--info::before {
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(92, 167, 255, 0.55);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 24px;
    border: 1px dashed rgba(212, 175, 55, 0.18);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.018);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.empty-state__icon {
    width: 40px;
    height: 40px;
    opacity: 0.35;
    color: var(--gold-2);
}

.empty-state__title {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}

.empty-state__sub {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================
   CODE BLOCK — for tokens, IDs, references
   ============================================================ */
.code-block {
    display: block;
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1px solid rgba(92, 167, 255, 0.18);
    background: rgba(10, 16, 26, 0.96);
    color: #a8d0ff;
    font-family: 'Cascadia Code', 'SF Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
}

code {
    color: #f7d68f;
    font-family: 'Cascadia Code', 'SF Mono', Consolas, 'Courier New', monospace;
}

/* ============================================================
   FORM ELEMENTS — inputs, selects, textareas
   Gold glow on focus matching donate.css pattern
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(76, 105, 150, 0.50);
    border-radius: var(--r-sm);
    background: rgba(9, 14, 23, 0.94);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--t-std), box-shadow var(--t-std);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(138, 153, 179, 0.65);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(212, 175, 55, 0.70);
    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.11),
        0 0 16px rgba(212, 175, 55, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

/* Validation states */
input.is-match,
.settings-input.is-match {
    border-color: rgba(75, 179, 110, 0.90);
    box-shadow: 0 0 0 3px rgba(75, 179, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

input.is-mismatch,
.settings-input.is-mismatch {
    border-color: rgba(207, 93, 93, 0.90);
    box-shadow: 0 0 0 3px rgba(207, 93, 93, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

textarea {
    min-height: 420px;
    resize: vertical;
}

select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a99b3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    padding-right: 32px;
    cursor: pointer;
}

select:hover {
    border-color: rgba(212, 175, 55, 0.32);
}

select option {
    background: var(--bg-page);
    color: var(--text);
}

.field__label {
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ============================================================
   BUTTONS
   Primary = gold gradient + shine sweep (mirrors donate-submit-btn)
   Secondary = muted navy
   Danger = soft red
   Ghost = transparent outline
   ============================================================ */

/* Base (default button / .button) */
button,
.button,
.button-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid rgba(216, 169, 75, 0.48);
    border-radius: var(--r-md);
    background: var(--gold-grad);
    color: #1a1200;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.18),
        0 3px 14px rgba(184, 135, 10, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
    transition:
        box-shadow var(--t-std),
        transform var(--t-fast),
        filter var(--t-fast);
    -webkit-user-select: none;
    user-select: none;
}

/* Shine sweep pseudo-element */
button::before,
.button::before,
.button-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.16),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

button:hover::before,
.button:hover::before,
.button-link:hover::before {
    left: 130%;
}

button:hover,
.button:hover,
.button-link:hover {
    filter: brightness(1.06);
    box-shadow:
        0 0 0 1px rgba(240, 198, 116, 0.40),
        0 5px 20px rgba(184, 135, 10, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    color: #18120a;
}

button:active,
.button:active,
.button-link:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

button:focus-visible,
.button:focus-visible,
.button-link:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.65);
    outline-offset: 2px;
}

/* Primary — explicit alias */
.button--primary {
    /* same as the default gold button */
}

/* Secondary — muted navy */
.button-link--secondary,
.button--secondary {
    border-color: rgba(84, 119, 188, 0.45);
    background: linear-gradient(180deg, #2e4268, #1e2f4a);
    color: #d8e8ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 10px rgba(0, 0, 0, 0.25);
}

.button-link--secondary:hover,
.button--secondary:hover {
    border-color: rgba(92, 167, 255, 0.40);
    background: linear-gradient(180deg, #374e7c, #263860);
    color: #f2f8ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.32);
    filter: none;
}

/* Danger */
.button-link--danger,
.button--danger,
.modal-close {
    border-color: rgba(207, 93, 93, 0.50);
    background: linear-gradient(180deg, #d46969, #aa4444);
    color: #fff5f5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 10px rgba(160, 60, 60, 0.28);
}

.button-link--danger:hover,
.button--danger:hover,
.modal-close:hover {
    border-color: rgba(230, 110, 110, 0.65);
    background: linear-gradient(180deg, #e07070, #bb4848);
    color: #fff;
    filter: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 4px 16px rgba(160, 60, 60, 0.40);
}

/* Ghost */
.button-link--ghost,
.button--ghost {
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.030);
    color: var(--text);
    box-shadow: none;
}

.button-link--ghost:hover,
.button--ghost:hover {
    border-color: rgba(212, 175, 55, 0.28);
    background: rgba(212, 175, 55, 0.06);
    color: var(--gold-soft);
    filter: none;
    box-shadow: none;
}

/* Accent (gold outline style) */
.button-link--accent,
.button--accent {
    border-color: rgba(216, 169, 75, 0.42);
    background: rgba(216, 169, 75, 0.09);
    color: #ffd889;
    box-shadow: none;
}

.button-link--accent:hover,
.button--accent:hover {
    border-color: rgba(216, 169, 75, 0.65);
    background: rgba(216, 169, 75, 0.16);
    color: var(--gold-1);
    filter: none;
}

/* Size modifiers */
.button--sm {
    min-height: 30px;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--r-sm);
}

.button--lg {
    min-height: 48px;
    padding: 13px 28px;
    font-size: 15px;
    border-radius: var(--r-lg);
    font-weight: 800;
    letter-spacing: 0.03em;
}

/* Disabled state */
button:disabled,
.button:disabled,
.button-link--disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   TABLES — gold headers, alt-row tinting, hover glow
   admin.css sets base layout; we refine the visuals.
   ============================================================ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--r-md);
    background: rgba(11, 17, 28, 0.90);
    border: 1px solid var(--border-soft);
}

th,
td {
    padding: 11px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-align: left;
    vertical-align: top;
    transition: background var(--t-fast);
}

th:last-child,
td:last-child { border-right: 0; }

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--gold-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.09) 0%, rgba(255, 255, 255, 0.025) 100%);
    border-bottom: 2px solid rgba(212, 175, 55, 0.20);
    padding: 13px 16px;
    white-space: nowrap;
}

tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.015);
}

tbody tr:nth-child(even) td {
    background: transparent;
}

tbody tr {
    transition: background var(--t-fast);
}

tbody tr:hover td {
    background: rgba(212, 175, 55, 0.05);
}

/* Gold left-edge glow on hovered row */
tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--gold-2);
}

tbody td {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
}

/* Row status stripes */
tbody tr.row--success td:first-child { box-shadow: inset 3px 0 0 #5fe690; }
tbody tr.row--warning td:first-child { box-shadow: inset 3px 0 0 var(--gold-2); }
tbody tr.row--danger  td:first-child { box-shadow: inset 3px 0 0 #ff6b4a; }
tbody tr.row--muted   td              { opacity: 0.50; }

/* Named table variants (existing selectors preserved) */
.dataset-table,
.bonus-tier-table {
    /* inherits gold headers from above */
}

/* ============================================================
   BADGES, CHIPS, PILLS
   ============================================================ */
.badge,
.chip,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge--gold,
.chip--gold {
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.30);
    color: var(--gold-soft);
}

.badge--blue,
.chip--blue {
    background: rgba(92, 167, 255, 0.12);
    border: 1px solid rgba(92, 167, 255, 0.28);
    color: #9fd0ff;
}

.badge--green,
.chip--green {
    background: rgba(75, 179, 110, 0.12);
    border: 1px solid rgba(75, 179, 110, 0.26);
    color: #98f0be;
}

.badge--red,
.chip--red {
    background: rgba(207, 93, 93, 0.12);
    border: 1px solid rgba(207, 93, 93, 0.26);
    color: #f5a3a3;
}

.badge--muted,
.chip--muted {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* ============================================================
   TABS (.settings-tabs) — gold active indicator
   Preserves existing markup; refines look.
   ============================================================ */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.settings-tabs__tab {
    min-height: 34px;
    padding: 6px 16px;
    border: 1px solid rgba(92, 167, 255, 0.16);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.022);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        border-color var(--t-std),
        background var(--t-std),
        color var(--t-std),
        box-shadow var(--t-std);
}

.settings-tabs__tab:hover {
    border-color: rgba(212, 175, 55, 0.28);
    background: rgba(212, 175, 55, 0.06);
    color: var(--gold-soft);
}

.settings-tabs__tab.is-active {
    border-color: rgba(212, 175, 55, 0.50);
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold-soft);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.12);
}

.settings-tab-pane {
    display: none;
    padding-top: 18px;
}

.settings-tab-pane.is-active {
    display: block;
}

/* ============================================================
   MODALS / POPOVERS — gold border accent
   ============================================================ */
.modal,
.popover {
    border-radius: var(--r-lg);
    border: 1px solid var(--border-gold);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.07) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), rgba(255, 255, 255, 0.008)),
        var(--bg-card);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.08),
        0 32px 80px rgba(0, 0, 0, 0.55);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-soft);
}

.modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.modal__body {
    padding: 20px 22px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border-soft);
}

/* ============================================================
   PAGINATION — pill style, gold active
   Preserves existing .cabinet-pagination selectors.
   ============================================================ */
.cabinet-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.cabinet-pagination__meta {
    color: var(--text-muted);
    font-size: 12px;
}

.cabinet-pagination__controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cabinet-pagination__button,
.cabinet-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    transition:
        border-color var(--t-std),
        background var(--t-std),
        color var(--t-std),
        box-shadow var(--t-std);
}

.cabinet-pagination__button:hover {
    border-color: rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-soft);
}

/* Active page — gold gradient pill */
.cabinet-pagination__button.is-active {
    border-color: rgba(216, 169, 75, 0.55);
    background: var(--gold-grad);
    color: #1a1200;
    font-weight: 800;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.20),
        0 3px 12px rgba(184, 135, 10, 0.28);
}

.cabinet-pagination__button.is-disabled {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}

.cabinet-pagination__ellipsis {
    min-width: auto;
    padding: 0 8px;
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
}

/* ============================================================
   LOCALE SWITCHER (topbar utility — non-topbar instance)
   Preserved from original cabinet.css
   ============================================================ */
.topbar__locale-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.topbar__locale-label {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.topbar__locale-select {
    min-width: 132px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: rgba(14, 21, 33, 0.96);
    color: var(--text);
}

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
    gap: 20px;
    align-items: stretch;
}

.auth-layout__main,
.auth-layout__side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    min-width: 0;
}

.auth-layout__main > .page-header,
.auth-layout__main > .card,
.auth-layout__main > .alert,
.auth-layout__side > .card {
    margin: 0;
}

.auth-hero {
    position: relative;
    overflow: hidden;
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%);
    pointer-events: none;
}

.auth-hero__eyebrow,
.auth-side-card__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: rgba(92, 167, 255, 0.10);
    border: 1px solid rgba(92, 167, 255, 0.20);
    color: #9ecbff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.auth-hero__chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.auth-hero__chip--accent {
    border-color: rgba(216, 169, 75, 0.35);
    background: rgba(216, 169, 75, 0.11);
    color: var(--gold-soft);
}

.auth-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.auth-card__header h2,
.auth-side-card h2 { margin-bottom: 8px; }

.auth-card__header p,
.auth-side-card p { color: var(--text-muted); }

.auth-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.auth-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.auth-form .field + .field { margin-top: 18px; }

.auth-inline-hint {
    margin-top: 8px;
    color: #8ea8cf;
    font-size: 12px;
    line-height: 1.55;
}

.auth-form__captcha {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid rgba(92, 167, 255, 0.16);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
}

.auth-form__captcha .cf-turnstile {
    display: flex;
    justify-content: center;
}

.auth-form__captcha-placeholder {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px dashed var(--border-gold);
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(216, 169, 75, 0.08), rgba(92, 167, 255, 0.05));
}

.auth-form__captcha-label {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.auth-form__captcha-placeholder strong {
    color: var(--text);
    font-size: 14px;
}

.auth-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.auth-side-card__soon {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.07);
    color: #bfd4fb;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-action-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.auth-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 96px;
    padding: 14px 16px;
    border: 1px solid rgba(92, 167, 255, 0.16);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(42, 60, 92, 0.92), rgba(28, 42, 67, 0.92)),
        rgba(18, 27, 41, 0.96);
    color: var(--text);
    text-align: left;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
        border-color var(--t-std),
        background var(--t-std),
        transform var(--t-fast),
        box-shadow var(--t-std);
}

a.auth-action-card:hover {
    border-color: rgba(132, 188, 255, 0.30);
    background:
        linear-gradient(180deg, rgba(49, 70, 108, 0.96), rgba(33, 47, 73, 0.96)),
        rgba(18, 27, 41, 0.98);
    color: #f8fbff;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 28px rgba(0, 0, 0, 0.16);
}

.auth-action-card--disabled,
.auth-action-card[disabled] {
    cursor: not-allowed;
    opacity: 0.88;
}

.auth-action-card--primary {
    border-color: rgba(216, 169, 75, 0.42);
    background:
        linear-gradient(180deg, rgba(226, 178, 83, 0.96), rgba(173, 124, 33, 0.96)),
        rgba(120, 81, 18, 0.94);
    color: #1d1609;
}

.auth-action-card--primary .auth-action-card__copy strong,
.auth-action-card--primary .auth-action-card__copy span,
.auth-action-card--primary .auth-side-card__soon { color: inherit; }

.auth-action-card__copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.auth-action-card__copy strong {
    font-size: 16px;
    line-height: 1.15;
}

.auth-action-card__copy span {
    color: #b8c8e6;
    font-size: 12px;
    line-height: 1.45;
}

.auth-action-card--primary .auth-side-card__soon {
    background: rgba(255, 255, 255, 0.26);
}

.auth-side-card--info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012)),
        rgba(14, 26, 43, 0.94);
}

.auth-checklist {
    margin: 14px 0 0;
    padding-left: 18px;
    color: #d7e4fa;
}

.auth-checklist li + li { margin-top: 8px; }

.auth-checklist--compact { margin-top: 10px; }
.auth-checklist--compact li + li { margin-top: 6px; }

.auth-layout--recovery .auth-card,
.auth-layout--login .auth-card { min-height: 0; }

.auth-layout--login .auth-card,
.auth-layout--login .auth-form { flex: 0 0 auto; }

.auth-form--recovery .field:last-of-type { margin-bottom: 0; }

.auth-info-box,
.auth-question-box,
.auth-status-card,
.auth-meta-box {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--r-md);
    border: 1px solid rgba(92, 167, 255, 0.13);
    background: rgba(255, 255, 255, 0.025);
}

.auth-info-box p,
.auth-question-box p,
.auth-status-card p {
    margin: 0;
    color: #d5e3fa;
    line-height: 1.7;
}

.auth-info-box__eyebrow,
.auth-question-box__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 10px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: rgba(212, 175, 55, 0.11);
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-meta-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.auth-meta-box div {
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: rgba(9, 15, 24, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auth-meta-box span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-meta-box strong,
.auth-question-box strong,
.auth-status-card h2 { color: var(--text); }

.auth-question-box strong {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.45;
}

.auth-status-card { margin-top: 0; }
.auth-status-card h2 { margin: 0 0 10px; }

.auth-match-indicator {
    min-height: 18px;
    margin-top: 8px;
    color: transparent;
    font-size: 12px;
    line-height: 1.4;
}

.auth-match-indicator.is-match  { color: #7ef0a6; }
.auth-match-indicator.is-mismatch { color: #ff8f8f; }

.auth-input.is-match    { border-color: rgba(88, 214, 141, 0.90); box-shadow: 0 0 0 3px rgba(88, 214, 141, 0.11); }
.auth-input.is-mismatch { border-color: rgba(255, 116, 116, 0.90); box-shadow: 0 0 0 3px rgba(255, 116, 116, 0.11); }

/* ============================================================
   SETTINGS COMPONENTS
   ============================================================ */
.settings-security-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 22px;
}

.settings-security-grid--single { grid-template-columns: minmax(0, 1fr); }

.settings-security-card { min-width: 0; }
.settings-security-card .stack,
.settings-security-card .settings-tabs { max-width: 720px; }

.settings-field { max-width: 720px; }

.settings-input {
    width: 100%;
    max-width: 720px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--r-md);
    border: 1px solid rgba(76, 105, 150, 0.50);
    background: rgba(9, 14, 23, 0.92);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--t-std), box-shadow var(--t-std);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.settings-input::placeholder { color: rgba(138, 153, 179, 0.60); }

.settings-input:focus {
    border-color: rgba(212, 175, 55, 0.68);
    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.10),
        0 0 14px rgba(212, 175, 55, 0.05);
}

.settings-input.is-match   { border-color: rgba(88, 214, 141, 0.90); box-shadow: 0 0 0 3px rgba(88, 214, 141, 0.11); }
.settings-input.is-mismatch { border-color: rgba(255, 116, 116, 0.90); box-shadow: 0 0 0 3px rgba(255, 116, 116, 0.11); }
.settings-input--email { border-radius: var(--r-md); }

.settings-security-card .field input,
.settings-security-card .field input[type="email"],
.settings-security-card .field input[type="password"],
.settings-security-card .field input[type="text"] { max-width: 720px; }

.settings-email-pane { max-width: 720px; }
.settings-email-form { margin-top: 18px; }

.settings-field-hint {
    margin-top: 6px;
    color: #ff8f8f;
    font-size: 12px;
    line-height: 1.6;
    max-width: 760px;
}

.settings-field-hint__accent {
    color: var(--gold-soft);
    font-weight: 700;
}

.settings-question-line {
    margin: 6px 0 8px;
    color: var(--text-muted);
    font-size: 12px;
    max-width: 720px;
}

.settings-question-line strong { color: #7ef0a6; font-weight: 700; }

.settings-match-indicator {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: transparent;
}

.settings-match-indicator.is-match   { color: #7ef0a6; }
.settings-match-indicator.is-mismatch { color: #ff8f8f; }

.settings-requirement-list,
.settings-security-toggles { display: grid; gap: 14px; }

.settings-request-box {
    margin-top: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1px solid rgba(92, 167, 255, 0.13);
    background: rgba(255, 255, 255, 0.025);
    color: #d9e7ff;
    line-height: 1.7;
    max-width: 720px;
}

.settings-request-box strong { color: var(--gold-soft); margin-right: 8px; }

.settings-request-box a { color: #7db7ff; font-weight: 700; text-decoration: none; }
.settings-request-box a:hover { color: #a8d0ff; text-decoration: underline; }

.settings-confirm-card { max-width: 840px; }
.settings-group + .settings-group { margin-top: 22px; }

/* Legacy switch (preserved exactly) */
.legacy-switch--disabled { opacity: 0.75; cursor: default; }
.legacy-switch--disabled .legacy-switch__track { pointer-events: none; }

/* ============================================================
   TRANSFER COMPONENTS
   ============================================================ */
.transfer-leaf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
    gap: 22px;
}

.transfer-leaf-grid--single { grid-template-columns: minmax(0, 1fr); }

.transfer-leaf-card { min-width: 0; }

.transfer-leaf-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.transfer-leaf-card__header--inner { margin-top: 8px; }

.transfer-leaf-card__header h2,
.transfer-leaf-card h2 { margin: 0 0 8px; }

.transfer-leaf-card__header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.transfer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 32px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.transfer-badge--enabled {
    background: rgba(74, 185, 120, 0.14);
    border: 1px solid rgba(74, 185, 120, 0.26);
    color: #98f0be;
}

.transfer-badge--disabled {
    background: rgba(207, 93, 93, 0.11);
    border: 1px solid rgba(207, 93, 93, 0.22);
    color: #ffb0b0;
}

.transfer-leaf-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.transfer-leaf-kpi {
    padding: 16px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-soft);
}

.transfer-leaf-kpi__label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.transfer-leaf-kpi strong {
    color: var(--text);
    font-size: 20px;
}

.transfer-leaf-form { max-width: 480px; }
.transfer-leaf-form .field { margin-top: 18px; }
.transfer-leaf-card .settings-tabs { margin-bottom: 18px; }

.transfer-leaf-preview {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(216, 169, 75, 0.12), rgba(92, 167, 255, 0.07));
    border: 1px solid rgba(216, 169, 75, 0.22);
}

.transfer-leaf-preview__label,
.transfer-leaf-preview__suffix { color: var(--text-muted); font-size: 13px; }

.transfer-leaf-preview strong {
    color: var(--gold-soft);
    font-size: 30px;
    line-height: 1;
}

.transfer-leaf-note {
    margin-top: 14px;
    color: #90a7cd;
    font-size: 13px;
    line-height: 1.6;
}

.transfer-leaf-note--compact { margin-top: 12px; }

.transfer-help-box {
    margin-top: 12px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--r-md);
    border: 1px solid rgba(216, 169, 75, 0.20);
    background: linear-gradient(135deg, rgba(216, 169, 75, 0.09), rgba(92, 167, 255, 0.05));
}

.transfer-help-box__title {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-soft);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.transfer-help-box__text { color: #d9e7ff; line-height: 1.7; }

.transfer-recipient-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.transfer-recipient-row input { flex: 1 1 auto; }

.transfer-recipient-summary {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
}

.transfer-recipient-summary.is-success {
    border-color: rgba(74, 185, 120, 0.22);
    background: rgba(74, 185, 120, 0.07);
    color: #bff5d2;
}

.transfer-recipient-summary.is-error {
    border-color: rgba(207, 93, 93, 0.22);
    background: rgba(207, 93, 93, 0.07);
    color: #ffc5c5;
}

.transfer-leaf-form .actions { margin-top: 18px; }

/* ============================================================
   MAIL TOOL CARDS
   ============================================================ */
.mail-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.mail-tool-card {
    padding: 20px;
    border: 1px solid rgba(56, 77, 110, 0.45);
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(28, 38, 56, 0.96), rgba(20, 27, 40, 0.96));
    transition: border-color var(--t-std);
}

.mail-tool-card:hover { border-color: rgba(212, 175, 55, 0.22); }
.mail-tool-card--full { grid-column: 1 / -1; }

.mail-tool-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.mail-tool-card__header h3 { margin: 4px 0 0; }

.mail-tool-card__eyebrow {
    display: inline-block;
    color: #9db8e8;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mail-tool-card__text { margin: 0 0 14px; color: #c9d8ef; line-height: 1.7; }

.mail-tool-card__note {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: rgba(216, 169, 75, 0.09);
    border: 1px solid rgba(216, 169, 75, 0.22);
    color: var(--gold-soft);
    line-height: 1.7;
}

.mail-summary-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin: 0;
}

.mail-summary-list div {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: rgba(12, 18, 29, 0.62);
    border: 1px solid rgba(56, 77, 110, 0.30);
}

.mail-summary-list dt {
    margin: 0 0 8px;
    color: #9db8e8;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mail-summary-list dd { margin: 0; color: var(--gold-soft); word-break: break-word; }

.mail-tool-form + .mail-tool-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(56, 77, 110, 0.28);
}

.mail-tool-form .field { display: block; }
.mail-tool-form .field__label { display: block; margin-bottom: 8px; }
.mail-tool-form__actions { margin-top: 14px; }

.mail-tool-input {
    width: 100%;
    max-width: 420px;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(77, 111, 171, 0.48);
    border-radius: var(--r-md);
    background: rgba(9, 14, 24, 0.92);
    color: var(--text);
    outline: none;
    transition: border-color var(--t-std), box-shadow var(--t-std);
}

.mail-tool-input::placeholder { color: rgba(138, 153, 179, 0.60); }

.mail-tool-input:focus {
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.10);
}

.mail-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.mail-preview-card {
    padding: 18px;
    border: 1px solid rgba(113, 135, 171, 0.20);
    border-radius: var(--r-md);
    background: rgba(8, 15, 29, 0.32);
}

.mail-preview-card__title { margin-bottom: 8px; color: var(--text); font-size: 16px; font-weight: 700; }
.mail-preview-card__text { min-height: 48px; margin-bottom: 14px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* ============================================================
   LEGACY MONEY MODES
   ============================================================ */
.legacy-money-modes { display: grid; gap: 14px; }

.legacy-money-mode {
    padding: 16px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-soft);
    transition: border-color var(--t-std);
}

.legacy-money-mode:hover { border-color: rgba(212, 175, 55, 0.20); }

.legacy-money-mode__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.legacy-money-mode__toggle-form { display: flex; justify-content: flex-end; margin-top: 12px; }

.legacy-money-mode__meta { display: grid; gap: 8px; margin: 14px 0 0; }
.legacy-money-mode__meta div { display: flex; justify-content: space-between; gap: 16px; color: #c6d6f3; font-size: 13px; }
.legacy-money-mode__meta dt { color: var(--text-muted); }
.legacy-money-mode__meta dd { margin: 0; color: var(--text); text-align: right; }

/* ============================================================
   INVENTORY TOOLBAR
   ============================================================ */
.inventory-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.inventory-toolbar__field { width: 100%; max-width: 420px; }
.inventory-toolbar__actions { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   ACTIONS ROW
   ============================================================ */
.actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   REFERRAL COMPONENTS (preserved selectors, refined colors)
   ============================================================ */
.referral-stat__value { font-size: 22px; }
.referral-stat__value--accent { color: #77d3ff; text-shadow: 0 0 14px rgba(119, 211, 255, 0.14); }
.referral-stat__meta { margin-top: 8px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }

.referral-link-box input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(92, 167, 255, 0.20);
    border-radius: var(--r-sm);
    background: rgba(10, 16, 26, 0.96);
    color: #d8e6ff;
    font: 13px/1.4 Consolas, 'Courier New', monospace;
}

.referral-link-box__input { color: #77d3ff !important; font-weight: 700; }

.referral-admin-summary {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.referral-admin-summary__card {
    padding: 16px 18px;
    border: 1px solid rgba(92, 167, 255, 0.14);
    border-radius: var(--r-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008)),
        rgba(14, 21, 33, 0.82);
    transition: border-color var(--t-std);
}

.referral-admin-summary__card:hover { border-color: rgba(92, 167, 255, 0.28); }

.referral-admin-summary__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: #95b8f2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-admin-summary__card h3 { margin: 0 0 6px; font-size: 17px; }
.referral-admin-summary__card p { margin: 0; color: var(--text-muted); line-height: 1.5; }

.referral-admin-list { display: grid; gap: 12px; }

.referral-admin-row {
    display: grid;
    gap: 14px;
    grid-template-columns: 120px 320px minmax(0, 1fr);
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008)),
        rgba(12, 18, 29, 0.84);
}

.referral-admin-row label {
    display: block;
    margin-bottom: 7px;
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-admin-row__level input { text-align: center; }
.referral-admin-row__main { display: grid; gap: 12px; }
.referral-admin-fields { display: grid; gap: 12px; }
.referral-admin-fields--compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.referral-admin-row .field { margin-bottom: 0; }
.referral-admin-row .field--wide { grid-column: 1 / -1; }

.referral-item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.referral-item-cell__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--border-soft);
    flex: 0 0 32px;
}

.referral-item-cell__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-muted);
    font-weight: 700;
    flex: 0 0 32px;
}

.referral-item-cell__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.referral-item-cell__meta strong { color: var(--text); font-size: 13px; line-height: 1.2; }
.referral-item-cell__meta span { color: var(--text-muted); font-size: 11px; }

.referral-item-cell--large {
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.018);
}

.referral-item-cell__hint { margin-top: 8px; color: #ffcfda; font-size: 11px; line-height: 1.45; }

.referral-item-cell--large .referral-item-cell__icon,
.referral-item-cell--large .referral-item-cell__placeholder {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
}

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

.referral-rewards-table th { white-space: nowrap; }
.referral-rewards-table td { padding: 10px; }

.referral-rewards-table input[type="text"],
.referral-rewards-table input[type="number"] {
    min-width: 96px;
    padding: 9px 10px;
    border-color: rgba(123, 150, 196, 0.24);
    border-radius: var(--r-sm);
    background: linear-gradient(180deg, rgba(9, 14, 23, 0.98), rgba(7, 11, 18, 0.98));
    color: var(--text);
}

.referral-rewards-table input[type="text"]:focus,
.referral-rewards-table input[type="number"]:focus {
    border-color: rgba(212, 175, 55, 0.60);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.10);
}

.referral-rewards-table--legacy th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.referral-legacy-table th, .referral-legacy-table td { vertical-align: middle; }
.referral-settings-group .settings-group__header { margin-bottom: 12px; }
.referral-legacy-table thead th { white-space: nowrap; background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)); }
.referral-legacy-table td > input[type="text"] { min-width: 88px; }
.referral-legacy-table td:last-child > input[type="text"] { min-width: 260px; }

.referral-table td,
.referral-table th { white-space: nowrap; }

.settings-referral-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.settings-referral-actions button { min-width: 220px; }

.referral-admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================================
   STAT CURRENCY SILVER (muted image)
   ============================================================ */
.stat__value--currency-silver img { filter: saturate(0.2) brightness(1.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
    .transfer-leaf-grid,
    .settings-security-grid,
    .mail-tools-grid,
    .mail-summary-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .auth-layout { grid-template-columns: 1fr; }

    .cabinet-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .cabinet-pagination__controls {
        justify-content: flex-start;
        width: 100%;
    }

    .auth-card__header { flex-direction: column; }
    .auth-meta-box { grid-template-columns: 1fr; }

    .transfer-leaf-kpis { grid-template-columns: 1fr; }

    .transfer-recipient-row,
    .transfer-leaf-card__header,
    .legacy-money-mode__top,
    .legacy-money-mode__meta div {
        flex-direction: column;
        align-items: flex-start;
    }

    .legacy-money-mode__toggle-form { justify-content: flex-start; }
    .legacy-money-mode__meta dd { text-align: left; }

    .topbar__locale-form { width: 100%; margin-right: 0; justify-content: flex-end; }
    .topbar__locale-select { min-width: 0; width: 100%; max-width: 180px; }

    .referral-admin-row { grid-template-columns: 1fr; }
    .referral-admin-fields--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .page-header { padding: 18px 18px; }
}

@media (max-width: 480px) {
    .mail-tools-grid,
    .referral-admin-summary { grid-template-columns: 1fr; }

    .page-header h1 { font-size: 18px; }

    .cabinet-pagination__button,
    .cabinet-pagination__ellipsis { min-width: 34px; height: 34px; }
}

/* ============================================================
   ACCESSIBILITY — global focus ring
   ============================================================ */
*:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.60);
    outline-offset: 2px;
}
