:root {
    --br-bg: #ffffff;
    --br-surface: #ffffff;
    --br-surface-soft: #fafafa;
    --br-surface-strong: #f4f4f4;
    --br-border: #e9e9e9;
    --br-border-strong: #d7d7d7;
    --br-text: #0d0d0d;
    --br-muted: #666666;
    --br-muted-soft: #8a8a8a;
    --br-accent: #111111;
    --br-danger: #b42318;
    --br-warning: #b26a00;
    --br-info: #404040;
    --br-success: #1f7a1f;
    --br-shadow-sm: 0 8px 24px rgba(15, 15, 15, .04);
    --br-shadow-md: 0 18px 46px rgba(15, 15, 15, .07);
    --br-radius-xl: 28px;
    --br-radius-lg: 22px;
    --br-radius-md: 16px;
    --br-radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--br-bg); }
body {
    margin: 0;
    color: var(--br-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(0,0,0,.025), transparent 22%),
        linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; display: block; }

.br-shell { min-height: 100vh; }
.br-main { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }

.br-topbar {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--br-border);
}

.br-brand-suite {
    display: grid;
    gap: 10px;
}

.br-brand-logos {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.br-brand-divider {
    width: 1px;
    min-height: 56px;
    background: var(--br-border-strong);
}

.br-logo-block {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.br-logo-block--blackridge img { height: 72px; width: auto; }
.br-logo-block--gamersloot img { height: 54px; width: auto; }
.br-brand-meta {
    color: var(--br-muted);
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.br-topnav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.br-topnav a,
.br-topnav-user {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--br-muted);
    border: 1px solid transparent;
    background: transparent;
}
.br-topnav a:hover {
    color: var(--br-text);
    border-color: var(--br-border);
    background: var(--br-surface-soft);
}
.br-topnav-user {
    color: var(--br-text);
    border-color: var(--br-border);
    background: var(--br-surface);
}
.br-topnav .br-exit {
    color: var(--br-text);
    border-color: var(--br-border-strong);
}

.br-login-body .br-main { width: 100%; padding: 0; }
.br-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}
.br-login-card {
    width: min(640px, 100%);
    padding: 38px;
    border-radius: var(--br-radius-xl);
    background: rgba(255,255,255,.96);
    border: 1px solid var(--br-border);
    box-shadow: var(--br-shadow-md);
}
.br-login-branding { margin-bottom: 24px; }
.br-login-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.br-kicker {
    margin: 0 0 8px;
    color: var(--br-muted);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .72rem;
}
.br-login-card h1,
.br-hero h1,
.br-module-header h1,
.br-empty h1 {
    margin: 0;
    letter-spacing: -.06em;
    color: var(--br-text);
}
.br-login-card h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.br-login-note,
.br-hero p:last-child,
.br-module-header p:last-child,
.br-empty p,
.br-panel-list p,
.br-module-card p { color: var(--br-muted); line-height: 1.6; }
.br-login-form { display: grid; gap: 14px; }
.br-login-form label { display: grid; gap: 8px; color: var(--br-muted); font-size: .92rem; }
.br-login-form input {
    width: 100%;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border-strong);
    border-radius: var(--br-radius-md);
    padding: 15px 16px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.br-login-form input::placeholder { color: #a3a3a3; }
.br-login-form input:focus {
    border-color: var(--br-text);
    box-shadow: 0 0 0 4px rgba(17,17,17,.06);
    background: #fff;
}
.br-login-foot {
    margin-top: 18px;
    color: var(--br-muted);
    display: grid;
    gap: 6px;
}

.br-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    cursor: pointer;
    font-weight: 700;
    transition: transform .14s ease, opacity .14s ease, background .14s ease;
}
.br-btn:hover { transform: translateY(-1px); }
.br-btn--primary {
    color: #fff;
    border-color: #111;
    background: #111;
    box-shadow: 0 12px 24px rgba(17,17,17,.10);
}
.br-btn--primary:hover { background: #000; }
.br-btn[disabled] { opacity: .52; cursor: not-allowed; transform: none; }

.br-flashes {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 90;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}
.br-flash {
    position: relative;
    padding: 14px 42px 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--br-border-strong);
    background: rgba(255,255,255,.98);
    color: var(--br-text);
    line-height: 1.45;
    box-shadow: 0 18px 44px rgba(15,15,15,.13);
    pointer-events: auto;
    transform: translateX(28px);
    opacity: 0;
    animation: brToastIn .28s ease forwards;
}
.br-flash::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 2px;
    border-radius: 999px;
    background: #111;
    opacity: .16;
}
.br-flash.is-hiding {
    animation: brToastOut .24s ease forwards;
}
.br-flash-close {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--br-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.br-flash-close:hover {
    background: var(--br-surface-strong);
    color: var(--br-text);
}
.br-flash--success { border-color: #cfe8cf; }
.br-flash--error { border-color: #efc8c3; }
.br-flash--warning { border-color: #ead7ad; }
.br-state {
    padding: 14px 16px;
    border-radius: var(--br-radius-md);
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    color: var(--br-text);
    line-height: 1.5;
}
.br-state--danger { border-color: #f0d1cd; background: #fff7f6; }
.br-state--warning { border-color: #f2e2be; background: #fffaf1; }
.br-state--info { border-color: #dddddd; background: #fafafa; }

@keyframes brToastIn {
    to { transform: translateX(0); opacity: 1; }
}
@keyframes brToastOut {
    to { transform: translateX(34px); opacity: 0; }
}

.br-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: stretch;
    margin: 18px 0 22px;
}
.br-hero-copy,
.br-hero-panel,
.br-stat-card,
.br-module-card a,
.br-panel-list article,
.br-module-header {
    border: 1px solid var(--br-border);
    background: rgba(255,255,255,.95);
    box-shadow: var(--br-shadow-sm);
}
.br-hero-copy {
    border-radius: var(--br-radius-xl);
    padding: clamp(24px, 4vw, 36px);
}
.br-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: .95; }
.br-hero-panel {
    border-radius: var(--br-radius-xl);
    padding: 26px;
    display: grid;
    align-content: end;
}
.br-hero-panel span,
.br-hero-panel small,
.br-stat-card span,
.br-stat-card small,
.br-section-head > span { color: var(--br-muted); }
.br-hero-panel strong {
    display: block;
    margin: 10px 0;
    font-size: 1.6rem;
    letter-spacing: -.04em;
}

.br-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.br-stat-card { border-radius: var(--br-radius-lg); padding: 18px; }
.br-stat-card strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 1.75rem;
    letter-spacing: -.05em;
}

.br-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 12px 0 16px;
}
.br-section-head h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    letter-spacing: -.05em;
}

.br-module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.br-module-card { min-height: 220px; }
.br-module-card a {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--br-radius-lg);
    padding: 20px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.br-module-card a:hover {
    transform: translateY(-2px);
    border-color: var(--br-text);
    box-shadow: 0 18px 36px rgba(17,17,17,.08);
}
.br-module-card.is-locked { opacity: .48; }
.br-module-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.br-module-icon {
    min-width: 48px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
    color: var(--br-text);
    font-size: .9rem;
    letter-spacing: .10em;
    font-weight: 800;
    text-transform: uppercase;
}
.br-module-icon--large { min-width: 64px; min-height: 64px; font-size: 1.05rem; }
.br-module-status {
    max-width: 140px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--br-muted);
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}
.br-module-card strong {
    margin: 0 0 8px;
    font-size: 1.08rem;
    letter-spacing: -.03em;
}
.br-module-card footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--br-muted);
}
.br-module-card footer em {
    color: var(--br-text);
    font-style: normal;
    font-weight: 700;
}

.br-module-page { display: grid; gap: 18px; }
.br-back { width: max-content; color: var(--br-muted); padding: 8px 0; }
.br-back:hover { color: var(--br-text); }
.br-module-header {
    border-radius: var(--br-radius-xl);
    padding: 26px;
    display: flex;
    gap: 18px;
    align-items: center;
}
.br-module-header h1 { font-size: clamp(2rem, 5vw, 3rem); }
.br-panel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.br-panel-list article { border-radius: var(--br-radius-lg); padding: 22px; }
.br-panel-list strong { display: block; margin-bottom: 8px; }
.br-empty { min-height: 55vh; display: grid; place-items: center; text-align: center; }
.br-empty h1 { font-size: clamp(2rem, 6vw, 4rem); }

@media (max-width: 980px) {
    .br-hero { grid-template-columns: 1fr; }
    .br-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .br-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .br-panel-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .br-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .br-topnav { width: 100%; justify-content: flex-start; }
}

@media (max-width: 640px) {
    .br-main, .br-topbar { width: min(100% - 22px, 1220px); }
    .br-login-page { padding: 14px; }
    .br-login-card { border-radius: 24px; padding: 22px; }
    .br-brand-logos,
    .br-login-logos { gap: 12px; }
    .br-brand-divider { display: none; }
    .br-logo-block--blackridge img { height: 52px; }
    .br-logo-block--gamersloot img { height: 38px; }
    .br-stats, .br-module-grid { grid-template-columns: 1fr; }
    .br-module-card { min-height: 205px; }
    .br-hero-panel { padding: 22px; }
    .br-module-header { align-items: flex-start; flex-direction: column; }
}

/* Blackridge 01.1.2 — light/dark theme toggle */
html[data-theme="dark"] {
    --br-bg: #070707;
    --br-surface: #101010;
    --br-surface-soft: #151515;
    --br-surface-strong: #1d1d1d;
    --br-border: #262626;
    --br-border-strong: #363636;
    --br-text: #f5f5f5;
    --br-muted: #a3a3a3;
    --br-muted-soft: #7b7b7b;
    --br-accent: #ffffff;
    --br-shadow-sm: 0 8px 24px rgba(0, 0, 0, .26);
    --br-shadow-md: 0 18px 46px rgba(0, 0, 0, .34);
}

html[data-theme="light"] .br-logo-brx--dark,
html[data-theme="dark"] .br-logo-brx--light { display: none; }
html[data-theme="dark"] .br-logo-brx--dark,
html[data-theme="light"] .br-logo-brx--light { display: block; }

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.035), transparent 24%),
        linear-gradient(180deg, #070707 0%, #0d0d0d 100%);
}

.br-theme-toggle {
    min-height: 40px;
    padding: 7px 12px 7px 8px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface);
    color: var(--br-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: .88rem;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.br-theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--br-text);
}
.br-theme-toggle-dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-block;
    background: #111;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
html[data-theme="dark"] .br-theme-toggle-dot {
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 0 18px rgba(255,255,255,.16);
}
.br-theme-toggle--login {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 20;
}

html[data-theme="dark"] .br-topbar { border-bottom-color: var(--br-border); }
html[data-theme="dark"] .br-login-card,
html[data-theme="dark"] .br-hero-copy,
html[data-theme="dark"] .br-hero-panel,
html[data-theme="dark"] .br-stat-card,
html[data-theme="dark"] .br-module-card a,
html[data-theme="dark"] .br-panel-list article,
html[data-theme="dark"] .br-module-header,
html[data-theme="dark"] .br-flash,
html[data-theme="dark"] .br-state {
    background: rgba(16,16,16,.96);
    border-color: var(--br-border);
    box-shadow: var(--br-shadow-sm);
}
html[data-theme="dark"] .br-login-card { box-shadow: var(--br-shadow-md); }
html[data-theme="dark"] .br-login-form input {
    color: var(--br-text);
    background: #0b0b0b;
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-login-form input::placeholder { color: #6f6f6f; }
html[data-theme="dark"] .br-login-form input:focus {
    border-color: #f5f5f5;
    box-shadow: 0 0 0 4px rgba(255,255,255,.08);
    background: #0e0e0e;
}
html[data-theme="dark"] .br-logo-block--gamersloot img {
    filter: drop-shadow(0 0 10px rgba(255,255,255,.08));
}
html[data-theme="dark"] .br-brand-divider { background: var(--br-border-strong); }
html[data-theme="dark"] .br-topnav a:hover,
html[data-theme="dark"] .br-flash-close:hover {
    background: var(--br-surface-strong);
}
html[data-theme="dark"] .br-module-icon,
html[data-theme="dark"] .br-module-status,
html[data-theme="dark"] .br-topnav-user {
    background: var(--br-surface-soft);
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-module-card a:hover {
    border-color: #f5f5f5;
    box-shadow: 0 18px 36px rgba(0,0,0,.34);
}
html[data-theme="dark"] .br-btn--primary {
    color: #111;
    border-color: #fff;
    background: #fff;
    box-shadow: 0 12px 24px rgba(255,255,255,.08);
}
html[data-theme="dark"] .br-btn--primary:hover { background: #f2f2f2; }
html[data-theme="dark"] .br-flash::after { background: #fff; opacity: .18; }
html[data-theme="dark"] .br-state--danger { border-color: rgba(255,118,118,.34); background: rgba(90,20,20,.20); }
html[data-theme="dark"] .br-state--warning { border-color: rgba(255,190,90,.34); background: rgba(90,55,12,.18); }
html[data-theme="dark"] .br-state--info { border-color: var(--br-border-strong); background: rgba(255,255,255,.035); }

@media (max-width: 640px) {
    .br-theme-toggle--login {
        top: 12px;
        right: 12px;
    }
}

/* Blackridge 02 — Usuários */
.br-filter-card,
.br-table-card,
.br-detail-card,
.br-user-profile-head {
    border: 1px solid var(--br-border);
    background: rgba(255,255,255,.95);
    border-radius: var(--br-radius-lg);
    box-shadow: var(--br-shadow-sm);
}
.br-filter-card { padding: 18px; }
.br-user-filters {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, minmax(140px, .75fr)) auto;
    gap: 12px;
    align-items: end;
}
.br-field { display: grid; gap: 7px; color: var(--br-muted); font-size: .88rem; }
.br-field--wide { min-width: 220px; }
.br-field input,
.br-field select {
    width: 100%;
    min-height: 44px;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
}
.br-field input:focus,
.br-field select:focus {
    border-color: var(--br-text);
    box-shadow: 0 0 0 4px rgba(17,17,17,.06);
}
.br-filter-actions { display: flex; gap: 8px; align-items: center; }
.br-table-card { padding: 18px; overflow: hidden; }
.br-card-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}
.br-card-head h2 { margin: 0; letter-spacing: -.04em; }
.br-card-head > span { color: var(--br-muted); font-size: .92rem; }
.br-card-head--compact { margin-bottom: 10px; }
.br-table-wrap { overflow-x: auto; }
.br-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 920px;
}
.br-table th,
.br-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--br-border);
    text-align: left;
    vertical-align: top;
}
.br-table th {
    color: var(--br-muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
    background: var(--br-surface-soft);
}
.br-table tr:last-child td { border-bottom: 0; }
.br-table--compact { min-width: 620px; }
.br-table--compact th,
.br-table--compact td { padding: 11px 10px; }
.br-table-empty { color: var(--br-muted); text-align: center; padding: 26px 12px !important; }
.br-user-cell { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.br-user-cell strong { display: block; margin-bottom: 3px; }
.br-user-cell small { display: block; color: var(--br-muted); line-height: 1.35; }
.br-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--br-text);
    background: var(--br-surface-soft);
    border: 1px solid var(--br-border-strong);
    font-weight: 900;
    letter-spacing: -.03em;
}
.br-avatar--large { width: 74px; height: 74px; flex-basis: 74px; font-size: 1.65rem; }
.br-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
    color: var(--br-muted);
    font-size: .76rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.br-pill--success { color: var(--br-success); border-color: rgba(31,122,31,.26); background: rgba(31,122,31,.06); }
.br-pill--warning { color: var(--br-warning); border-color: rgba(178,106,0,.28); background: rgba(178,106,0,.07); }
.br-pill--danger { color: var(--br-danger); border-color: rgba(180,35,24,.28); background: rgba(180,35,24,.07); }
.br-pill--neutral { color: var(--br-muted); }
.br-mini-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.br-mini-stack--text span { color: var(--br-muted); font-size: .9rem; }
.br-muted { color: var(--br-muted); }
.br-link { color: var(--br-text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.br-actions { display: grid; gap: 8px; align-items: start; min-width: 170px; }
.br-inline-form { display: flex; flex-wrap: wrap; gap: 6px; }
.br-btn--small { min-height: 34px; padding: 7px 10px; font-size: .82rem; }
.br-btn--danger { color: #fff; border-color: var(--br-danger); background: var(--br-danger); }
.br-btn--danger:hover { background: #8f1f16; }
.br-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    color: var(--br-muted);
}
.br-pagination a,
.br-pagination span {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--br-border);
    border-radius: 999px;
    background: var(--br-surface);
}
.br-pagination a { color: var(--br-text); font-weight: 800; }
.br-stats--users { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.br-user-profile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px;
}
.br-user-profile-main { display: flex; align-items: center; gap: 18px; }
.br-user-profile-main h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.06em; }
.br-user-profile-main p { margin: 6px 0 0; color: var(--br-muted); }
.br-profile-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.br-profile-pills--stack { align-items: flex-start; flex-direction: column; }
.br-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.br-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.br-detail-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.br-detail-card { padding: 20px; min-width: 0; }
.br-kv { margin: 0; display: grid; gap: 10px; }
.br-kv div {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--br-border);
    padding-bottom: 10px;
}
.br-kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.br-kv dt { color: var(--br-muted); font-size: .82rem; }
.br-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.br-card-note { color: var(--br-muted); line-height: 1.55; margin: 16px 0 0; }
.br-profile-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.br-profile-metrics span {
    border: 1px solid var(--br-border);
    background: var(--br-surface-soft);
    border-radius: 16px;
    padding: 14px;
}
.br-profile-metrics strong { display: block; font-size: 1.5rem; letter-spacing: -.04em; }
.br-profile-metrics small { color: var(--br-muted); }

html[data-theme="dark"] .br-filter-card,
html[data-theme="dark"] .br-table-card,
html[data-theme="dark"] .br-detail-card,
html[data-theme="dark"] .br-user-profile-head {
    background: rgba(16,16,16,.96);
    border-color: var(--br-border);
    box-shadow: var(--br-shadow-sm);
}
html[data-theme="dark"] .br-field input,
html[data-theme="dark"] .br-field select,
html[data-theme="dark"] .br-pagination a,
html[data-theme="dark"] .br-pagination span {
    color: var(--br-text);
    background: #0b0b0b;
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-table th,
html[data-theme="dark"] .br-avatar,
html[data-theme="dark"] .br-profile-metrics span,
html[data-theme="dark"] .br-pill {
    background: var(--br-surface-soft);
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-btn--danger { color: #fff; background: #8f1f16; border-color: #8f1f16; }
html[data-theme="dark"] .br-pill--success { color: #8ce28c; border-color: rgba(140,226,140,.24); background: rgba(140,226,140,.06); }
html[data-theme="dark"] .br-pill--warning { color: #f8c46f; border-color: rgba(248,196,111,.26); background: rgba(248,196,111,.07); }
html[data-theme="dark"] .br-pill--danger { color: #ff9a91; border-color: rgba(255,154,145,.26); background: rgba(255,154,145,.08); }

@media (max-width: 1120px) {
    .br-user-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .br-field--wide { grid-column: span 2; }
    .br-filter-actions { grid-column: span 2; }
    .br-stats--users { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .br-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .br-user-filters,
    .br-field--wide,
    .br-filter-actions { grid-template-columns: 1fr; grid-column: auto; }
    .br-stats--users,
    .br-detail-grid,
    .br-detail-grid--wide { grid-template-columns: 1fr; }
    .br-user-profile-head { align-items: flex-start; flex-direction: column; }
    .br-user-profile-main { align-items: flex-start; flex-direction: column; }
    .br-profile-actions { justify-content: flex-start; }
    .br-kv div { grid-template-columns: 1fr; gap: 4px; }
}

/* Blackridge 02.1 — Perfil completo e timeline */
.br-user-detail-page { gap: 16px; }
.br-alert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.br-user-alert {
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    border-radius: 18px;
    padding: 14px 16px;
    display: grid;
    gap: 4px;
    box-shadow: var(--br-shadow-sm);
}
.br-user-alert strong { font-size: .94rem; }
.br-user-alert span { color: var(--br-muted); line-height: 1.45; font-size: .88rem; }
.br-user-alert--warning { border-color: rgba(178,106,0,.28); background: rgba(178,106,0,.055); }
.br-user-alert--danger { border-color: rgba(180,35,24,.28); background: rgba(180,35,24,.055); }
.br-user-alert--success { border-color: rgba(31,122,31,.26); background: rgba(31,122,31,.055); }
.br-detail-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.br-kv--compact { margin-top: 14px; gap: 8px; }
.br-kv--compact div { grid-template-columns: 116px minmax(0, 1fr); padding-bottom: 8px; }
.br-clean-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--br-muted);
    line-height: 1.55;
}
.br-clean-list li + li { margin-top: 6px; }
.br-risk-meter {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}
.br-risk-meter strong {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    letter-spacing: -.08em;
    line-height: .9;
}
.br-risk-meter span { color: var(--br-muted); font-weight: 800; }
.br-risk-meter div {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--br-surface-strong);
    border: 1px solid var(--br-border);
    overflow: hidden;
}
.br-risk-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--br-text);
}
.br-timeline {
    display: grid;
    gap: 12px;
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
}
.br-timeline-item {
    position: relative;
    display: grid;
    gap: 5px;
    padding: 12px 12px 12px 18px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    background: var(--br-surface-soft);
}
.br-timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 999px;
    background: var(--br-muted-soft);
}
.br-timeline-item time { color: var(--br-muted); font-size: .78rem; }
.br-timeline-item strong { font-size: .94rem; }
.br-timeline-item span { color: var(--br-muted); line-height: 1.42; font-size: .88rem; }
.br-timeline-item--success::before { background: var(--br-success); }
.br-timeline-item--warning::before { background: var(--br-warning); }
.br-timeline-item--danger::before { background: var(--br-danger); }

html[data-theme="dark"] .br-user-alert,
html[data-theme="dark"] .br-timeline-item {
    background: rgba(255,255,255,.035);
    border-color: var(--br-border);
}
html[data-theme="dark"] .br-user-alert--warning { border-color: rgba(248,196,111,.26); background: rgba(248,196,111,.06); }
html[data-theme="dark"] .br-user-alert--danger { border-color: rgba(255,154,145,.26); background: rgba(255,154,145,.065); }
html[data-theme="dark"] .br-user-alert--success { border-color: rgba(140,226,140,.24); background: rgba(140,226,140,.06); }
html[data-theme="dark"] .br-risk-meter div { background: var(--br-surface-soft); border-color: var(--br-border-strong); }
html[data-theme="dark"] .br-risk-meter i { background: var(--br-text); }

@media (max-width: 1120px) {
    .br-alert-grid,
    .br-detail-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .br-alert-grid,
    .br-detail-grid--three { grid-template-columns: 1fr; }
    .br-kv--compact div { grid-template-columns: 1fr; }
}

/* Blackridge 02.2 — ações administrativas e notas internas */
.br-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.br-action-row--mt { margin-top: 12px; }
.br-restriction-form,
.br-note-form {
    display: grid;
    gap: 12px;
}
.br-restriction-form label:not(.br-field),
.br-note-pin {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--br-muted);
    line-height: 1.45;
}
.br-restriction-form input[type="checkbox"],
.br-note-pin input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--br-text);
}
.br-field textarea,
.br-field select {
    width: 100%;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border-strong);
    border-radius: var(--br-radius-md);
    padding: 12px 14px;
    outline: none;
    resize: vertical;
}
.br-field textarea:focus,
.br-field select:focus {
    border-color: var(--br-text);
    box-shadow: 0 0 0 4px rgba(17,17,17,.06);
}
.br-note-form-row {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 12px;
    align-items: end;
}
.br-notes-list {
    display: grid;
    gap: 12px;
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
}
.br-note-item {
    display: grid;
    gap: 10px;
    border: 1px solid var(--br-border);
    background: var(--br-surface-soft);
    border-radius: 18px;
    padding: 14px;
}
.br-note-item.is-pinned {
    border-color: rgba(178,106,0,.38);
    background: rgba(178,106,0,.055);
}
.br-note-item header,
.br-note-item footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.br-note-item header span,
.br-note-item footer small {
    color: var(--br-muted);
    font-size: .82rem;
}
.br-note-item p {
    margin: 0;
    color: var(--br-text);
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.br-modal[hidden] { display: none; }
.br-modal {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 20px;
}
.br-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.34);
    backdrop-filter: blur(4px);
}
.br-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    color: var(--br-text);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(0,0,0,.22);
    display: grid;
    gap: 14px;
}
.br-modal-card h3 {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2rem);
    letter-spacing: -.05em;
}
.br-modal-card p {
    margin: 0;
    color: var(--br-muted);
    line-height: 1.55;
}
.br-modal-card form {
    display: grid;
    gap: 12px;
}
.br-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--br-border);
    background: var(--br-surface-soft);
    color: var(--br-text);
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}
.br-modal-close:hover { border-color: var(--br-text); }

html[data-theme="dark"] .br-field textarea,
html[data-theme="dark"] .br-field select,
html[data-theme="dark"] .br-note-item,
html[data-theme="dark"] .br-modal-card,
html[data-theme="dark"] .br-modal-close {
    color: var(--br-text);
    background: #0b0b0b;
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-note-item.is-pinned {
    border-color: rgba(248,196,111,.26);
    background: rgba(248,196,111,.06);
}
html[data-theme="dark"] .br-modal-backdrop { background: rgba(0,0,0,.62); }
html[data-theme="dark"] .br-field textarea:focus,
html[data-theme="dark"] .br-field select:focus {
    border-color: var(--br-text);
    box-shadow: 0 0 0 4px rgba(255,255,255,.07);
}
@media (max-width: 720px) {
    .br-note-form-row { grid-template-columns: 1fr; }
    .br-modal { padding: 12px; }
    .br-modal-card { border-radius: 20px; padding: 20px; }
}

/* Blackridge 02.3 — filtros avançados, risco e exportação */
.br-user-filters--advanced {
    grid-template-columns: 1.35fr repeat(5, minmax(132px, 1fr));
}
.br-user-filters--advanced .br-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.br-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--br-border);
}
.br-active-filters span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    background: var(--br-surface-soft);
    color: var(--br-muted);
    font-size: .8rem;
}
.br-active-filters b { color: var(--br-text); }
.br-table--users { min-width: 1120px; }
.br-risk-mini {
    display: grid;
    gap: 3px;
    width: max-content;
    min-width: 82px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
}
.br-risk-mini strong {
    font-size: .84rem;
    line-height: 1;
}
.br-risk-mini span {
    color: var(--br-muted);
    font-size: .75rem;
    font-weight: 800;
}
.br-risk-mini--success { border-color: rgba(31,122,31,.22); background: rgba(31,122,31,.045); }
.br-risk-mini--warning { border-color: rgba(178,106,0,.28); background: rgba(178,106,0,.06); }
.br-risk-mini--danger { border-color: rgba(180,35,24,.28); background: rgba(180,35,24,.065); }
html[data-theme="dark"] .br-active-filters span,
html[data-theme="dark"] .br-risk-mini {
    background: var(--br-surface-soft);
    border-color: var(--br-border-strong);
}
html[data-theme="dark"] .br-risk-mini--success { border-color: rgba(140,226,140,.24); background: rgba(140,226,140,.055); }
html[data-theme="dark"] .br-risk-mini--warning { border-color: rgba(248,196,111,.25); background: rgba(248,196,111,.06); }
html[data-theme="dark"] .br-risk-mini--danger { border-color: rgba(255,154,145,.26); background: rgba(255,154,145,.065); }
@media (max-width: 1180px) {
    .br-user-filters--advanced { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .br-user-filters--advanced .br-field--wide { grid-column: span 3; }
}
@media (max-width: 720px) {
    .br-user-filters--advanced { grid-template-columns: 1fr; }
    .br-user-filters--advanced .br-field--wide { grid-column: auto; }
}

/* Blackridge 03 — E-mails */
.br-email-page { display: grid; gap: 18px; }
.br-email-hero { align-items: center; }
.br-email-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.br-email-stats article,
.br-email-card,
.br-email-sidebar {
    border: 1px solid var(--br-border);
    background: rgba(255,255,255,.95);
    box-shadow: var(--br-shadow-sm);
    border-radius: var(--br-radius-lg);
}
.br-email-stats article { padding: 18px; }
.br-email-stats span,
.br-email-stats small { display: block; color: var(--br-muted); }
.br-email-stats span { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.br-email-stats strong { display: block; margin: 8px 0 4px; font-size: 1.8rem; letter-spacing: -.05em; }
.br-email-layout {
    display: grid;
    grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr) minmax(340px, .9fr);
    gap: 16px;
    align-items: start;
}
.br-email-sidebar {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
    padding: 16px;
    max-height: calc(100vh - 36px);
    overflow: hidden;
}
.br-email-filter-form,
.br-email-form,
.br-email-test-form,
.br-email-create-form { display: grid; gap: 12px; }
.br-email-filter-form label,
.br-email-form label,
.br-email-test-form label,
.br-email-create-form label {
    display: grid;
    gap: 7px;
    color: var(--br-muted);
    font-size: .9rem;
}
.br-email-filter-form input,
.br-email-filter-form select,
.br-email-form input,
.br-email-form select,
.br-email-form textarea,
.br-email-test-form input,
.br-email-create-form input,
.br-email-create-form select {
    width: 100%;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border-strong);
    border-radius: var(--br-radius-md);
    padding: 12px 14px;
    outline: none;
}
.br-email-form textarea {
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .86rem;
    line-height: 1.62;
}
.br-email-filter-form input:focus,
.br-email-filter-form select:focus,
.br-email-form input:focus,
.br-email-form select:focus,
.br-email-form textarea:focus,
.br-email-test-form input:focus,
.br-email-create-form input:focus,
.br-email-create-form select:focus {
    border-color: var(--br-text);
    box-shadow: 0 0 0 4px rgba(17,17,17,.06);
}
.br-email-filter-row,
.br-email-grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.br-email-list {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 4px;
}
.br-email-template {
    display: grid;
    gap: 8px;
    border: 1px solid var(--br-border);
    background: var(--br-surface-soft);
    border-radius: 18px;
    padding: 14px;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.br-email-template:hover { transform: translateY(-1px); border-color: var(--br-text); background: var(--br-surface); }
.br-email-template.is-selected { border-color: var(--br-text); box-shadow: inset 3px 0 0 var(--br-text); background: var(--br-surface); }
.br-email-template-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.br-email-template-top strong { font-size: .96rem; line-height: 1.25; }
.br-email-template-top em {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    font-size: .72rem;
    font-style: normal;
    font-weight: 800;
}
.br-email-template-top em.is-on { color: var(--br-success); }
.br-email-template-top em.is-off { color: var(--br-danger); }
.br-email-template small { color: var(--br-muted); line-height: 1.45; }
.br-email-template-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.br-email-template-meta code,
.br-email-template-meta b,
.br-email-card code {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--br-border);
    border-radius: 999px;
    background: var(--br-surface);
    color: var(--br-muted);
    font-size: .75rem;
}
.br-email-editor,
.br-email-preview-panel { display: grid; gap: 16px; min-width: 0; }
.br-email-card { padding: 18px; min-width: 0; }
.br-email-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.br-email-section-head h2 { margin: 0; font-size: 1.28rem; letter-spacing: -.04em; }
.br-email-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.br-email-actions form { margin: 0; }
.br-email-vars { display: flex; gap: 8px; flex-wrap: wrap; }
.br-email-vars button {
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    background: var(--br-surface-soft);
    color: var(--br-text);
    padding: 7px 10px;
    cursor: pointer;
    font-weight: 700;
}
.br-email-vars button.is-copied { background: var(--br-text); color: var(--br-surface); }
.br-email-check {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    padding: 12px;
    background: var(--br-surface-soft);
}
.br-email-check input { width: 17px !important; height: 17px; accent-color: var(--br-text); }
.br-email-preview {
    display: block;
    width: 100%;
    height: 620px;
    border: 1px solid var(--br-border);
    border-radius: 18px;
    background: #0B1736;
}
.br-email-empty,
.br-email-empty-large {
    display: grid;
    place-items: center;
    min-height: 120px;
    text-align: center;
    color: var(--br-muted);
    border: 1px dashed var(--br-border-strong);
    border-radius: 18px;
    padding: 18px;
    background: var(--br-surface-soft);
}
.br-email-logs { display: grid; gap: 10px; }
.br-email-logs article {
    display: grid;
    gap: 4px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    padding: 12px;
    background: var(--br-surface-soft);
}
.br-email-logs article span,
.br-email-logs article small { color: var(--br-muted); font-size: .82rem; }

html[data-theme="dark"] .br-email-stats article,
html[data-theme="dark"] .br-email-card,
html[data-theme="dark"] .br-email-sidebar,
html[data-theme="dark"] .br-email-template,
html[data-theme="dark"] .br-email-empty,
html[data-theme="dark"] .br-email-empty-large,
html[data-theme="dark"] .br-email-logs article,
html[data-theme="dark"] .br-email-check,
html[data-theme="dark"] .br-email-vars button,
html[data-theme="dark"] .br-email-form input,
html[data-theme="dark"] .br-email-form select,
html[data-theme="dark"] .br-email-form textarea,
html[data-theme="dark"] .br-email-filter-form input,
html[data-theme="dark"] .br-email-filter-form select,
html[data-theme="dark"] .br-email-test-form input,
html[data-theme="dark"] .br-email-create-form input,
html[data-theme="dark"] .br-email-create-form select {
    background: var(--br-surface);
    border-color: var(--br-border-strong);
    color: var(--br-text);
}
html[data-theme="dark"] .br-email-template.is-selected,
html[data-theme="dark"] .br-email-template:hover { background: var(--br-surface-soft); border-color: var(--br-text); }
html[data-theme="dark"] .br-email-template-meta code,
html[data-theme="dark"] .br-email-template-meta b,
html[data-theme="dark"] .br-email-card code { background: var(--br-surface-soft); }
html[data-theme="dark"] .br-email-vars button.is-copied { background: var(--br-text); color: #111; }

@media (max-width: 1320px) {
    .br-email-layout { grid-template-columns: 330px minmax(0, 1fr); }
    .br-email-preview-panel { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
    .br-email-preview { height: 520px; }
}
@media (max-width: 900px) {
    .br-email-layout,
    .br-email-preview-panel,
    .br-email-stats,
    .br-email-grid.two,
    .br-email-filter-row { grid-template-columns: 1fr; }
    .br-email-sidebar { position: relative; top: auto; max-height: none; }
    .br-email-section-head { display: block; }
    .br-email-actions { justify-content: flex-start; margin-top: 12px; }
}
@media (max-width: 620px) {
    .br-email-stats { grid-template-columns: 1fr 1fr; }
    .br-email-card,
    .br-email-sidebar { padding: 14px; border-radius: 20px; }
    .br-email-actions .br-btn { width: 100%; }
    .br-email-preview { height: 430px; }
}

/* Blackridge 03.1 — Editor Pro e Versionamento */
.br-email-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.br-email-validation {
    display: grid;
    gap: 8px;
    border: 1px solid #ead7ad;
    background: #fffaf1;
    color: var(--br-text);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
    line-height: 1.45;
}
.br-email-submit-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.br-email-vars-pro {
    max-height: 128px;
    overflow: auto;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    padding: 10px;
    background: var(--br-surface-soft);
}
.br-email-versions { display: grid; gap: 10px; }
.br-email-versions article {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    padding: 12px;
    background: var(--br-surface-soft);
}
.br-email-versions article > div:first-child { display: grid; gap: 4px; min-width: 0; }
.br-email-versions article span,
.br-email-versions article small { color: var(--br-muted); line-height: 1.45; }
.br-email-version-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.br-email-version-actions form { margin: 0; }
.br-email-preview-tabs,
.br-email-preview-switch {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.br-email-preview-tabs { margin-bottom: 12px; }
.br-email-preview-tabs a,
.br-email-preview-switch button {
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    background: var(--br-surface-soft);
    color: var(--br-text);
    padding: 8px 11px;
    cursor: pointer;
    font-weight: 700;
    font-size: .84rem;
}
.br-email-preview-switch button.is-active,
.br-email-preview-tabs a:hover { background: var(--br-text); color: var(--br-surface); }
.br-email-preview-frame-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}
.br-email-preview-frame-wrap.is-mobile .br-email-preview {
    width: min(390px, 100%);
    height: 720px;
}
html[data-theme="dark"] .br-email-validation {
    background: rgba(178,106,0,.12);
    border-color: rgba(242,226,190,.28);
}
html[data-theme="dark"] .br-email-versions article,
html[data-theme="dark"] .br-email-vars-pro,
html[data-theme="dark"] .br-email-preview-tabs a,
html[data-theme="dark"] .br-email-preview-switch button {
    background: var(--br-surface);
    border-color: var(--br-border-strong);
    color: var(--br-text);
}
html[data-theme="dark"] .br-email-preview-switch button.is-active,
html[data-theme="dark"] .br-email-preview-tabs a:hover { background: var(--br-text); color: #111; }
@media (max-width: 1320px) { .br-email-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) {
    .br-email-stats { grid-template-columns: 1fr 1fr; }
    .br-email-submit-row .br-btn,
    .br-email-version-actions .br-btn { width: 100%; }
    .br-email-versions article { display: grid; }
}

.br-email-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: -10px 0 18px;
}
.br-email-stats.br-email-stats-queue,
.br-email-stats { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.br-email-log-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, .8fr)) auto;
    gap: 12px;
    align-items: end;
}
.br-email-log-filter label,
.br-email-test-form label {
    display: grid;
    gap: 7px;
    color: var(--br-muted);
    font-size: .88rem;
}
.br-email-log-filter input,
.br-email-log-filter select {
    width: 100%;
    min-height: 44px;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
}
.br-email-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
    color: var(--br-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}
.br-email-status--sent { color: var(--br-success); border-color: rgba(31,122,31,.28); background: rgba(31,122,31,.06); }
.br-email-status--failed { color: var(--br-danger); border-color: rgba(180,35,24,.28); background: rgba(180,35,24,.06); }
.br-email-status--pending { color: var(--br-warning); border-color: rgba(178,106,0,.28); background: rgba(178,106,0,.07); }
.br-email-status--processing { color: var(--br-info); }
.br-email-status--cancelled { color: var(--br-muted); }
.br-email-queue-table small { color: var(--br-muted); line-height: 1.45; }
.br-email-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 220px;
}
.br-email-queue-actions form { margin: 0; }
.br-email-queue-actions .br-btn { min-height: 34px; padding: 7px 10px; font-size: .82rem; }

html[data-theme="dark"] .br-email-log-filter input,
html[data-theme="dark"] .br-email-log-filter select,
html[data-theme="dark"] .br-email-status {
    background: var(--br-surface-soft);
    border-color: var(--br-border-strong);
    color: var(--br-text);
}

@media (max-width: 1320px) {
    .br-email-stats.br-email-stats-queue,
    .br-email-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .br-email-log-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .br-email-toolbar { justify-content: flex-start; }
    .br-email-stats.br-email-stats-queue,
    .br-email-stats,
    .br-email-log-filter { grid-template-columns: 1fr; }
}

/* Blackridge 03.3 — Eventos transacionais */
.br-email-stats.br-email-stats-events { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.br-email-events-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.br-email-event-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--br-border);
    border-radius: 22px;
    padding: 18px;
    background: var(--br-surface-soft);
}
.br-email-event-card.needs-attention { border-color: #ead7ad; background: #fffaf1; }
.br-email-event-card.is-disabled { opacity: .72; }
.br-email-event-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.br-email-event-card h3 { margin: 5px 0 4px; font-size: 1.1rem; letter-spacing: -.03em; }
.br-email-event-card p { margin: 0; color: var(--br-muted); line-height: 1.55; }
.br-email-event-card code,
.br-email-event-log-table code {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    white-space: normal;
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    color: var(--br-muted);
    font-size: .76rem;
}
.br-email-event-category {
    color: var(--br-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.br-email-event-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.br-email-event-meta span {
    border: 1px solid var(--br-border);
    border-radius: 14px;
    background: var(--br-surface);
    color: var(--br-muted);
    padding: 9px 10px;
    font-size: .82rem;
    line-height: 1.35;
}
.br-email-event-meta b { color: var(--br-text); font-weight: 800; }
.br-email-event-vars {
    border: 1px solid var(--br-border);
    border-radius: 16px;
    background: var(--br-surface);
    padding: 10px 12px;
}
.br-email-event-vars summary {
    cursor: pointer;
    color: var(--br-muted);
    font-weight: 800;
    font-size: .86rem;
}
.br-email-event-vars pre {
    overflow: auto;
    max-height: 180px;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--br-surface-soft);
    border: 1px solid var(--br-border);
    color: var(--br-muted);
    font-size: .8rem;
}
.br-email-event-map-form {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--br-border);
    padding-top: 12px;
}
.br-email-event-map-form label,
.br-email-event-sample-form label {
    display: grid;
    gap: 7px;
    color: var(--br-muted);
    font-size: .86rem;
}
.br-email-event-map-form select,
.br-email-event-map-form input,
.br-email-event-sample-form select,
.br-email-event-sample-form input {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    background: var(--br-surface);
    color: var(--br-text);
    padding: 9px 11px;
    outline: none;
}
.br-email-event-map-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.br-email-event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.br-email-event-actions form { margin: 0; }
.br-email-event-actions .br-btn { min-height: 36px; padding: 8px 12px; font-size: .84rem; }
.br-email-event-log-table small { color: var(--br-muted); }

html[data-theme="dark"] .br-email-event-card,
html[data-theme="dark"] .br-email-event-vars,
html[data-theme="dark"] .br-email-event-meta span,
html[data-theme="dark"] .br-email-event-map-form select,
html[data-theme="dark"] .br-email-event-map-form input,
html[data-theme="dark"] .br-email-event-sample-form select,
html[data-theme="dark"] .br-email-event-sample-form input {
    background: var(--br-surface);
    border-color: var(--br-border-strong);
    color: var(--br-text);
}
html[data-theme="dark"] .br-email-event-card.needs-attention {
    background: rgba(178,106,0,.12);
    border-color: rgba(242,226,190,.28);
}
html[data-theme="dark"] .br-email-event-card code,
html[data-theme="dark"] .br-email-event-log-table code,
html[data-theme="dark"] .br-email-event-vars pre {
    background: var(--br-surface-soft);
    border-color: var(--br-border-strong);
}

@media (max-width: 1320px) {
    .br-email-stats.br-email-stats-events { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .br-email-events-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .br-email-stats.br-email-stats-events,
    .br-email-event-filter,
    .br-email-event-sample-form,
    .br-email-event-meta,
    .br-email-event-map-row { grid-template-columns: 1fr; }
    .br-email-event-card header { display: grid; }
    .br-email-event-actions { justify-content: flex-start; }
}


/* Blackridge 03.4 — Preferências e marketing seguro */
.br-filter-bar,
.br-inline-action,
.br-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.br-filter-bar {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-lg);
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
}

.br-filter-bar input,
.br-filter-bar select,
.br-form-grid input,
.br-form-grid select,
.br-form-grid textarea {
    min-height: 44px;
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    background: var(--br-surface);
    color: var(--br-text);
    padding: 10px 12px;
    outline: none;
}

.br-filter-bar input[type="search"] {
    min-width: min(340px, 100%);
    flex: 1 1 260px;
}

.br-form-grid {
    display: grid;
    gap: 12px;
}

.br-form-grid label {
    display: grid;
    gap: 6px;
    color: var(--br-muted);
    font-size: .92rem;
}

.br-check {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    color: var(--br-text) !important;
}

.br-check input {
    min-height: auto;
}

.br-table-card {
    margin-top: 18px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-lg);
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
    overflow: auto;
}

.br-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}

.br-table th,
.br-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--br-border);
    text-align: left;
    vertical-align: top;
}

.br-table th {
    color: var(--br-muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
    background: var(--br-surface-soft);
}

.br-table tr:last-child td {
    border-bottom: 0;
}

.br-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.br-chip,
.br-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    background: var(--br-surface-soft);
    color: var(--br-muted);
    font-size: .75rem;
    font-weight: 700;
}

.br-badge.is-ok {
    border-color: #cfe8cf;
    color: #1f7a1f;
}

.br-badge.is-danger {
    border-color: #efc8c3;
    color: #b42318;
}

.br-badge.is-muted {
    color: var(--br-muted);
}

.br-muted {
    color: var(--br-muted);
}

.br-modal::backdrop {
    background: rgba(0,0,0,.28);
}

.br-modal-card {
    width: min(680px, calc(100vw - 32px));
    padding: 22px;
    border-radius: 24px;
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    color: var(--br-text);
    box-shadow: 0 28px 80px rgba(0,0,0,.18);
}

.br-modal-card header,
.br-modal-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.br-modal-card header {
    margin-bottom: 16px;
}

.br-modal-card footer {
    margin-top: 16px;
}

.br-modal-card h3 {
    margin: 0;
    letter-spacing: -.04em;
}

.br-modal-close {
    border: 0;
    background: var(--br-surface-soft);
    color: var(--br-text);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
}

code {
    color: var(--br-text);
    background: var(--br-surface-soft);
    border: 1px solid var(--br-border);
    border-radius: 8px;
    padding: 2px 6px;
}

@media (max-width: 640px) {
    .br-filter-bar,
    .br-row-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .br-filter-bar > *,
    .br-row-actions > * {
        width: 100%;
    }
}


/* Blackridge 03.5 — Entregabilidade */
.br-dl {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 16px 0 0;
}

.br-dl dt {
    color: var(--br-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
}

.br-dl dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.br-deliverability-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 22px;
}

.br-health-card {
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-lg);
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
    padding: 18px;
}

.br-health-card span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--br-border-strong);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .10em;
    font-weight: 800;
}

.br-health-card.is-ok span {
    border-color: #cfe8cf;
    color: #1f7a1f;
}

.br-health-card.is-warning span {
    border-color: #f2e2be;
    color: #b26a00;
}

.br-health-card strong {
    display: block;
    margin: 14px 0 8px;
    letter-spacing: -.03em;
}

.br-health-card p {
    margin: 0;
    color: var(--br-muted);
    line-height: 1.5;
}

.br-details {
    margin-top: 14px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-md);
    padding: 12px;
    background: var(--br-surface-soft);
}

.br-details summary {
    cursor: pointer;
    font-weight: 800;
}

.br-details pre {
    max-width: 100%;
    overflow: auto;
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    color: var(--br-text);
}

@media (max-width: 980px) {
    .br-deliverability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .br-deliverability-grid,
    .br-dl {
        grid-template-columns: 1fr;
    }
}


/* Blackridge 03.6 — Integrações reais */
.br-row-actions form {
    margin: 0;
}

.br-state code,
.br-table code {
    white-space: normal;
    word-break: break-word;
}


/* Blackridge 03.6.1 — Homologação e layout do módulo de e-mails */
.br-email-module .br-back {
    margin-bottom: 4px;
}

.br-email-command {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--br-border);
    border-radius: 30px;
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
}

.br-email-command h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4rem);
    letter-spacing: -.07em;
}

.br-email-command p {
    max-width: 760px;
    color: var(--br-muted);
    line-height: 1.6;
}

.br-email-command-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.br-email-health-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.br-email-health-grid article {
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--br-shadow-sm);
}

.br-email-health-grid span,
.br-email-health-grid small {
    color: var(--br-muted);
}

.br-email-health-grid strong {
    display: block;
    margin: 7px 0 2px;
    font-size: 1.55rem;
    letter-spacing: -.05em;
}

.br-homologation-board {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 16px;
}

.br-homologation-checklist,
.br-homologation-guide {
    border: 1px solid var(--br-border);
    border-radius: 26px;
    background: var(--br-surface);
    padding: 20px;
    box-shadow: var(--br-shadow-sm);
}

.br-checklist {
    display: grid;
    gap: 10px;
}

.br-checklist article {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--br-border);
    border-radius: 18px;
    padding: 14px;
    background: var(--br-surface-soft);
}

.br-checklist article > span {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    border: 1px solid var(--br-border-strong);
    flex: 0 0 auto;
}

.br-checklist article.is-ok > span {
    color: #1f7a1f;
    border-color: #cfe8cf;
}

.br-checklist article.is-pending > span {
    color: #b26a00;
    border-color: #f2e2be;
}

.br-checklist strong {
    display: block;
    margin-bottom: 3px;
}

.br-checklist p,
.br-homologation-guide p,
.br-homologation-guide li {
    color: var(--br-muted);
    line-height: 1.55;
}

.br-homologation-guide ol {
    padding-left: 20px;
}

.br-integrations-table .is-recommended-row td {
    background: color-mix(in srgb, var(--br-surface-soft) 80%, transparent);
}

.br-integration-name {
    display: grid;
    gap: 5px;
}

.br-issues {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--br-muted);
    line-height: 1.45;
}

.br-inline-test {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.br-inline-test input {
    min-height: 42px;
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    padding: 9px 12px;
    background: var(--br-surface);
    color: var(--br-text);
    min-width: 190px;
}

.br-email-command-cards {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}

.br-email-command-cards a {
    min-height: 132px;
    border: 1px solid var(--br-border);
    border-radius: 22px;
    background: var(--br-surface);
    padding: 16px;
    box-shadow: var(--br-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.br-email-command-cards a:hover,
.br-email-command-cards a.is-active {
    transform: translateY(-2px);
    border-color: var(--br-text);
    box-shadow: 0 18px 36px rgba(17,17,17,.08);
}

.br-email-command-cards span {
    width: 40px;
    height: 40px;
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: .08em;
    background: var(--br-surface-soft);
}

.br-email-command-cards strong {
    margin-top: auto;
    letter-spacing: -.03em;
}

.br-email-command-cards small {
    color: var(--br-muted);
    line-height: 1.35;
}

@media (max-width: 1180px) {
    .br-email-command-cards,
    .br-email-health-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .br-email-command,
    .br-homologation-board {
        grid-template-columns: 1fr;
    }
    .br-email-command-actions {
        justify-content: flex-start;
    }
    .br-email-command-cards,
    .br-email-health-grid {
        grid-template-columns: 1fr;
    }
    .br-inline-test {
        align-items: stretch;
        flex-direction: column;
    }
    .br-inline-test input,
    .br-inline-test button {
        width: 100%;
    }
}


/* Blackridge 03.6.2 — Template Studio premium */
.br-email-studio {
    display: grid;
    gap: 18px;
}

.br-email-studio-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: end;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--br-border);
    border-radius: 32px;
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
}

.br-email-studio-hero h1 {
    margin: 0;
    font-size: clamp(2.35rem, 6vw, 4.9rem);
    line-height: .94;
    letter-spacing: -.08em;
}

.br-email-studio-hero p {
    max-width: 760px;
    color: var(--br-muted);
    line-height: 1.6;
}

.br-email-studio-status {
    border: 1px solid var(--br-border);
    border-radius: 24px;
    background: var(--br-surface-soft);
    padding: 18px;
}

.br-email-studio-status span,
.br-email-studio-status small {
    color: var(--br-muted);
}

.br-email-studio-status strong {
    display: block;
    margin: 8px 0 3px;
    font-size: 2rem;
    letter-spacing: -.06em;
}

.br-email-studio-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.br-email-studio-metrics article {
    border: 1px solid var(--br-border);
    border-radius: 20px;
    background: var(--br-surface);
    padding: 16px;
    box-shadow: var(--br-shadow-sm);
}

.br-email-studio-metrics span,
.br-email-studio-metrics small {
    color: var(--br-muted);
}

.br-email-studio-metrics strong {
    display: block;
    margin: 8px 0 3px;
    font-size: 1.55rem;
    letter-spacing: -.05em;
}

.br-template-workbench {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 410px;
    gap: 16px;
    align-items: start;
}

.br-template-sidebar,
.br-template-editor,
.br-template-preview-column {
    display: grid;
    gap: 16px;
}

.br-template-sidebar,
.br-template-preview-column {
    position: sticky;
    top: 18px;
}

.br-template-panel,
.br-template-editor-card,
.br-template-preview-card {
    border: 1px solid var(--br-border);
    border-radius: 26px;
    background: var(--br-surface);
    box-shadow: var(--br-shadow-sm);
    padding: 18px;
}

.br-template-panel-head,
.br-template-editor-head,
.br-template-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.br-template-panel-head h2,
.br-template-editor-head h2,
.br-template-preview-head h2 {
    margin: 0;
    letter-spacing: -.05em;
}

.br-template-panel-head > span {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--br-muted);
    background: var(--br-surface-soft);
    border: 1px solid var(--br-border);
    font-weight: 800;
}

.br-template-filter,
.br-template-create-form,
.br-template-form {
    display: grid;
    gap: 12px;
}

.br-template-filter input,
.br-template-filter select,
.br-template-create-form input,
.br-template-create-form select,
.br-template-form input,
.br-template-form select,
.br-template-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--br-border-strong);
    border-radius: 14px;
    background: var(--br-surface);
    color: var(--br-text);
    padding: 10px 12px;
    outline: none;
}

.br-template-form textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    line-height: 1.55;
    resize: vertical;
}

.br-template-filter-row,
.br-form-row {
    display: grid;
    gap: 10px;
}

.br-template-filter-row {
    grid-template-columns: 1fr 1fr;
}

.br-form-row.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.br-template-create-form label,
.br-template-form label {
    display: grid;
    gap: 7px;
    color: var(--br-muted);
    font-size: .92rem;
}

.br-template-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}

.br-template-list-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--br-border);
    border-radius: 18px;
    background: var(--br-surface-soft);
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.br-template-list-item:hover,
.br-template-list-item.is-selected {
    border-color: var(--br-text);
    background: var(--br-surface);
    transform: translateY(-1px);
}

.br-template-list-top,
.br-template-list-meta,
.br-template-code-row,
.br-template-editor-actions,
.br-template-submit-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.br-template-list-top {
    justify-content: space-between;
    gap: 8px;
}

.br-template-list-top strong {
    line-height: 1.25;
}

.br-template-list-top em {
    font-style: normal;
    font-size: .72rem;
    font-weight: 800;
    color: var(--br-muted);
}

.br-template-list-top em.is-ok {
    color: #1f7a1f;
}

.br-template-list-meta b {
    font-size: .72rem;
    color: var(--br-muted);
    border: 1px solid var(--br-border);
    background: var(--br-surface);
    border-radius: 999px;
    padding: 4px 8px;
}

.br-template-editor-head {
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--br-border);
}

.br-template-editor-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.br-template-alerts {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.br-template-alerts > div {
    border: 1px solid #f2e2be;
    background: #fffaf1;
    border-radius: 14px;
    padding: 11px 12px;
    color: var(--br-text);
}

.br-template-alerts > div.is-danger {
    border-color: #efc8c3;
    background: #fff7f6;
}

.br-variable-dock {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--br-border);
    border-radius: 18px;
    background: var(--br-surface-soft);
}

.br-variable-dock small,
.br-preview-note {
    color: var(--br-muted);
}

.br-variable-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.br-variable-buttons button {
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    background: var(--br-surface);
    color: var(--br-text);
    padding: 7px 10px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
}

.br-variable-buttons button.is-copied {
    border-color: #1f7a1f;
    color: #1f7a1f;
}

.br-template-submit-bar {
    position: sticky;
    bottom: 12px;
    z-index: 2;
    padding: 12px;
    border: 1px solid var(--br-border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--br-surface) 94%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: var(--br-shadow-sm);
}

.br-template-lower-grid {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
    gap: 16px;
}

.br-version-list,
.br-mini-log-list {
    display: grid;
    gap: 10px;
}

.br-version-item,
.br-mini-log-list article {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    background: var(--br-surface-soft);
}

.br-version-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.br-version-item small,
.br-version-item span,
.br-mini-log-list small {
    color: var(--br-muted);
}

.br-template-preview-card {
    padding: 0;
    overflow: hidden;
}

.br-template-preview-head {
    padding: 18px 18px 0;
}

.br-email-preview-tabs {
    display: flex;
    gap: 8px;
    padding: 0 18px 14px;
    flex-wrap: wrap;
}

.br-email-preview-tabs a {
    border: 1px solid var(--br-border-strong);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--br-muted);
    background: var(--br-surface-soft);
    font-weight: 700;
    font-size: .84rem;
}

.br-email-preview-frame-wrap {
    padding: 14px;
    background: var(--br-surface-soft);
    border-top: 1px solid var(--br-border);
}

.br-email-preview-frame-wrap.is-mobile {
    display: flex;
    justify-content: center;
}

.br-email-preview-frame {
    width: 100%;
    min-height: 720px;
    border: 1px solid var(--br-border);
    border-radius: 18px;
    background: #fff;
}

.br-email-preview-frame-wrap.is-mobile .br-email-preview-frame {
    max-width: 390px;
    min-height: 720px;
}

.br-preview-note {
    display: block;
    padding: 0 18px 18px;
}

.br-email-preview-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--br-border);
    border-radius: 999px;
    background: var(--br-surface-soft);
}

.br-email-preview-switch button {
    border: 0;
    border-radius: 999px;
    padding: 7px 10px;
    background: transparent;
    color: var(--br-muted);
    cursor: pointer;
    font-weight: 700;
}

.br-email-preview-switch button.is-active {
    background: var(--br-text);
    color: var(--br-surface);
}

.br-template-create-panel {
    border-style: dashed;
}

.br-email-empty,
.br-email-empty-large {
    color: var(--br-muted);
    line-height: 1.5;
}

.br-email-empty-large {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
}

.br-badge.is-warning {
    color: #b26a00;
    border-color: #f2e2be;
    background: #fffaf1;
}

[data-theme="dark"] .br-template-alerts > div {
    background: rgba(245, 158, 11, .08);
}

[data-theme="dark"] .br-template-alerts > div.is-danger {
    background: rgba(180, 35, 24, .08);
}

@media (max-width: 1280px) {
    .br-template-workbench {
        grid-template-columns: 300px minmax(0, 1fr);
    }
    .br-template-preview-column {
        grid-column: 1 / -1;
        position: static;
    }
}

@media (max-width: 980px) {
    .br-email-studio-hero,
    .br-template-workbench,
    .br-template-lower-grid {
        grid-template-columns: 1fr;
    }
    .br-template-sidebar {
        position: static;
    }
    .br-email-studio-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .br-form-row.two,
    .br-template-filter-row,
    .br-email-studio-metrics {
        grid-template-columns: 1fr;
    }
    .br-template-editor-actions,
    .br-template-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .br-template-editor-actions > *,
    .br-template-submit-bar > *,
    .br-template-submit-bar button {
        width: 100%;
    }
    .br-version-item {
        grid-template-columns: 1fr;
    }
}
