/**
 * RoxyCloud global overrides — foundation + chrome (Phase 1)
 */
@import url('tokens.css');

/* Typography + page background (solid — no repeating gradient bands) */
html {
    height: 100%;
    background-color: var(--rc-bg);
    overflow-x: clip;
    max-width: 100%;
}

body.rc-theme {
    font-family: var(--rc-font);
    color: var(--rc-text);
    background-color: var(--rc-bg);
    background-image: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    max-width: 100%;
}

body.rc-theme #main-body,
body.rc-theme section#main-body,
body.rc-theme .primary-content,
body.rc-theme header.header.rc-chrome {
    max-width: 100%;
    overflow-x: clip;
}

body.rc-theme .container {
    max-width: 100%;
}

body.rc-theme img,
body.rc-theme video,
body.rc-theme iframe,
body.rc-theme table {
    max-width: 100%;
}

body.rc-theme pre,
body.rc-theme .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

/* Ambient glow fixo — não repete ao rolar */
body.rc-theme::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 100% 55% at 50% -5%, rgba(83, 82, 237, 0.07) 0%, transparent 52%),
        radial-gradient(ellipse 65% 45% at 100% 100%, rgba(255, 255, 255, 0.025) 0%, transparent 48%);
}

body.rc-theme.primary-bg-color {
    background-color: var(--rc-bg);
    background-image: none;
}

body.rc-theme #main-body,
body.rc-theme section#main-body {
    background: transparent;
}

body.rc-hide-sidebar .primary-content {
    max-width: var(--rc-content-max);
    margin-left: auto;
    margin-right: auto;
}

body.rc-app-shell.rc-hide-sidebar .primary-content {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Header chrome — unified shell (logo + nav + toolbar) */
header.header.rc-chrome {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: transparent !important;
    box-shadow: none !important;
}

header.header.rc-chrome .topbar {
    background: rgba(6, 6, 10, 0.92) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    color: var(--rc-text-secondary);
    font-size: 0.8125rem;
}

header.header.rc-chrome .topbar .btn,
header.header.rc-chrome .topbar .input-group-text {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    color: rgba(245, 245, 255, 0.94) !important;
    font-weight: 600;
    font-size: 0.8rem;
}

header.header.rc-chrome .topbar .btn-active-client {
    background: rgba(83, 82, 237, 0.28) !important;
    border-color: rgba(83, 82, 237, 0.42) !important;
    color: #fff !important;
}

header.header.rc-chrome .topbar .btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: var(--rc-text) !important;
}

header.header.rc-chrome .rc-chrome__shell {
    background: rgba(12, 12, 18, 0.82);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.38);
}

header.header.rc-chrome .rc-chrome__shell-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

@media (min-width: 1200px) {
    header.header.rc-chrome .rc-chrome__shell-inner {
        flex-wrap: nowrap;
        gap: 1.5rem;
    }
}

header.header.rc-chrome .rc-chrome__brand-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none !important;
}

header.header.rc-chrome .rc-chrome__brand-text {
    color: var(--rc-text);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

header.header.rc-chrome .rc-chrome__logo-img,
header.header.rc-chrome .logo-img {
    max-height: 44px;
    width: auto !important;
    height: auto !important;
    max-width: min(200px, 46vw);
    object-fit: contain;
    filter: drop-shadow(0 2px 20px rgba(83, 82, 237, 0.18));
}

header.header.rc-chrome .rc-chrome__navbar.main-navbar-wrapper {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    min-height: unset !important;
    padding: 0 !important;
}

header.header.rc-chrome .rc-chrome__navbar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

header.header.rc-chrome .rc-chrome__navbar-inner .navbar-collapse {
    flex: 1 1 auto;
    min-width: 0;
}

@media (min-width: 1200px) {
    header.header.rc-chrome .rc-chrome__navbar-inner .navbar-collapse.collapse {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.25rem;
        min-width: 0;
    }
}

header.header.rc-chrome .rc-chrome__nav-primary {
    margin-right: 0;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

header.header.rc-chrome .rc-chrome__nav-secondary {
    margin-left: 0;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

header.header.rc-chrome .rc-chrome__toolbar {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

header.header.rc-chrome .rc-chrome__menu-btn {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(240, 240, 250, 0.95) !important;
    padding: 0.4rem 0.7rem !important;
    line-height: 1 !important;
}

header.header.rc-chrome .rc-chrome__menu-btn:hover {
    background: rgba(83, 82, 237, 0.2) !important;
    border-color: rgba(83, 82, 237, 0.35) !important;
}

header.header.rc-chrome .navbar-nav .rc-nav__link.nav-link {
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    color: rgba(235, 235, 245, 0.9) !important;
    padding: 0.45rem 0.95rem !important;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

header.header.rc-chrome .navbar-nav .rc-nav__link.nav-link:hover,
header.header.rc-chrome .navbar-nav .rc-nav__link.nav-link:focus {
    background: rgba(83, 82, 237, 0.14) !important;
    border-color: rgba(83, 82, 237, 0.28);
    color: #fff !important;
    text-decoration: none;
}

header.header.rc-chrome .navbar-nav .nav-item.active > .rc-nav__link.nav-link {
    background: rgba(83, 82, 237, 0.22) !important;
    border-color: rgba(83, 82, 237, 0.35);
    color: #fff !important;
}

header.header.rc-chrome .navbar-nav .rc-nav__link.nav-link.dropdown-toggle::after {
    margin-left: 0.35em;
    vertical-align: 0.12em;
    opacity: 0.65;
}

header.header.rc-chrome .rc-nav__link .badge {
    font-size: 0.62rem;
    font-weight: 700;
    vertical-align: middle;
    border-radius: 6px;
    padding: 0.2em 0.45em;
    background: rgba(83, 82, 237, 0.4);
    color: #f4f4ff;
}

header.header.rc-chrome .rc-chrome__search-form {
    margin: 0;
}

header.header.rc-chrome .rc-chrome__search.search,
header.header.rc-chrome .rc-chrome__search {
    width: auto !important;
    max-width: 220px;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

header.header.rc-chrome .rc-chrome__search:focus-within {
    border-color: rgba(83, 82, 237, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(83, 82, 237, 0.12);
}

header.header.rc-chrome .rc-chrome__search .form-control {
    background: transparent !important;
    border: 0 !important;
    color: rgba(245, 245, 255, 0.95) !important;
    border-radius: 0 !important;
    font-size: 0.8rem;
    min-width: 140px;
    max-width: 180px;
    padding: 0.4rem 0.75rem;
    box-shadow: none !important;
}

header.header.rc-chrome .rc-chrome__search .btn-default {
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: rgba(245, 245, 255, 0.75) !important;
    border-radius: 0 !important;
    padding: 0.4rem 0.65rem;
}

header.header.rc-chrome .rc-chrome__search .btn-default:hover {
    background: rgba(83, 82, 237, 0.2) !important;
    color: #fff !important;
}

/* Neutraliza borda branca do theme.css stock */
header.header.rc-chrome .search,
header.header.rc-chrome .search.rc-chrome__search,
header.header.rc-chrome .rc-chrome__kb-search .search {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.04);
}

header.header.rc-chrome .search:focus-within,
header.header.rc-chrome .rc-chrome__kb-search .search:focus-within {
    border-color: rgba(83, 82, 237, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(83, 82, 237, 0.12);
}

/* ── Navbar logada ── */
header.header.rc-chrome .rc-chrome__navbar--loggedin .rc-chrome__nav-primary .rc-nav__link {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.78rem;
}

header.header.rc-chrome .rc-chrome__toolbar > .rc-nav__item {
    display: flex;
    align-items: center;
}

header.header.rc-chrome .rc-chrome__toolbar > .rc-nav__item .rc-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
    max-width: 170px;
}

header.header.rc-chrome .rc-chrome__toolbar > .rc-nav__item .rc-nav__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

header.header.rc-chrome .rc-chrome__toolbar > .rc-nav__item .rc-nav__link:hover,
header.header.rc-chrome .rc-chrome__toolbar > .rc-nav__item.show > .rc-nav__link {
    background: rgba(83, 82, 237, 0.22) !important;
    border-color: rgba(83, 82, 237, 0.4) !important;
    color: #fff !important;
}

@media (max-width: 1199px) {
    header.header.rc-chrome .rc-chrome__navbar--loggedin .rc-chrome__toolbar > .rc-nav__item {
        display: none !important;
    }
}

header.header.rc-chrome .rc-chrome__topbar-inner {
    min-height: 2.25rem;
    padding: 0.35rem 0;
}

header.header.rc-chrome .rc-chrome__notify-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem !important;
    border-radius: 999px !important;
    font-size: 0.78rem;
}

header.header.rc-chrome .rc-chrome__notify-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--rc-accent-strong);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

header.header.rc-chrome .rc-chrome__user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.45rem 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

header.header.rc-chrome .rc-chrome__user-chip-label {
    font-size: 0.75rem;
    color: rgba(200, 200, 215, 0.75);
    font-weight: 500;
}

header.header.rc-chrome .rc-chrome__user-chip-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none !important;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

header.header.rc-chrome .rc-chrome__user-chip-name:hover {
    color: var(--rc-accent);
}

header.header.rc-chrome .rc-chrome__user-chip-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    color: rgba(220, 220, 235, 0.85);
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease;
}

header.header.rc-chrome .rc-chrome__user-chip-action:hover {
    background: rgba(83, 82, 237, 0.2);
    color: #fff;
}

header.header.rc-chrome .rc-chrome__user-chip-action--admin {
    color: var(--rc-warning);
}

header.header.rc-chrome .rc-chrome__kb-search .form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(245, 245, 255, 0.95) !important;
    border-radius: 0 10px 10px 0 !important;
}

header.header.rc-chrome .rc-chrome__kb-search .input-group-prepend .btn {
    border-radius: 10px 0 0 10px !important;
}

header.header.rc-chrome .rc-chrome__cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.45rem 0.75rem !important;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(235, 235, 245, 0.9) !important;
    transition: background 0.2s ease, border-color 0.2s ease;
}

header.header.rc-chrome .rc-chrome__cart-btn:hover {
    background: rgba(83, 82, 237, 0.18) !important;
    border-color: rgba(83, 82, 237, 0.35);
    color: #fff !important;
}

header.header.rc-chrome .rc-chrome__cart-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--rc-accent-strong) !important;
    color: #fff !important;
    border-radius: 999px;
    min-width: 1.1rem;
    padding: 0.15em 0.4em;
}

header.header.rc-chrome .dropdown-menu.rc-nav__dropdown,
header.header.rc-chrome .rc-nav__dropdown.dropdown-menu {
    margin-top: 0.45rem;
    padding: 0.35rem;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(18, 18, 26, 0.97) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5) !important;
}

header.header.rc-chrome .rc-nav__dropdown > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

header.header.rc-chrome .rc-nav__dropdown .dropdown-item.rc-nav__dropdown-link,
header.header.rc-chrome .rc-nav__dropdown a.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.86rem;
    font-weight: 500;
    color: rgba(230, 230, 242, 0.95) !important;
    white-space: nowrap;
}

header.header.rc-chrome .rc-nav__dropdown .dropdown-item.rc-nav__dropdown-link:hover,
header.header.rc-chrome .rc-nav__dropdown a.dropdown-item:hover {
    background: rgba(83, 82, 237, 0.18) !important;
    color: #fff !important;
}

header.header.rc-chrome .rc-nav__dropdown li.active > a.dropdown-item,
header.header.rc-chrome .rc-nav__dropdown .dropdown-item.rc-nav__dropdown-link.active {
    background: rgba(83, 82, 237, 0.32) !important;
    color: #fff !important;
}

header.header.rc-chrome .rc-nav__dropdown .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.08);
    margin: 0.35rem 0;
}

@media (max-width: 1199px) {
    header.header.rc-chrome .rc-chrome__navbar-inner .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1040;
        background: rgba(14, 14, 20, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
        padding: 0.75rem 1rem 1rem;
        margin: 0;
        width: 100%;
        left: 0;
        right: 0;
    }

    header.header.rc-chrome .rc-chrome__navbar {
        position: relative;
    }

    header.header.rc-chrome .rc-chrome__nav-primary,
    header.header.rc-chrome .rc-chrome__nav-secondary {
        margin: 0;
        width: 100%;
    }

    header.header.rc-chrome .navbar-nav .rc-nav__link.nav-link {
        padding: 0.6rem 0.85rem !important;
    }
}

/* Breadcrumb */
body.rc-theme .master-breadcrumb {
    background: transparent;
    border-bottom: 1px solid var(--rc-border-subtle);
    padding: 0.75rem 0;
}

body.rc-theme .breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
}

body.rc-theme .breadcrumb-item,
body.rc-theme .breadcrumb-item a {
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
}

body.rc-theme .breadcrumb-item.active {
    color: var(--rc-text-secondary);
}

/* Main body */
body.rc-theme #main-body {
    flex: 1 0 auto;
    padding: clamp(1rem, 4vw, 2rem) 0 clamp(2rem, 4vw, 3rem);
}

body.rc-theme .primary-content {
    color: var(--rc-text);
}

/* Cards */
body.rc-theme .card {
    border-radius: var(--rc-radius);
    border: 1px solid var(--rc-border);
    background-color: var(--rc-surface);
    box-shadow: var(--rc-shadow);
}

body.rc-theme .card-header {
    background: var(--rc-surface-raised);
    border-bottom: 1px solid var(--rc-border);
    color: var(--rc-text);
}

body.rc-theme .card-footer {
    background: var(--rc-surface-raised);
    border-top: 1px solid var(--rc-border);
}

/* Tables */
body.rc-theme .table {
    color: var(--rc-text);
}

body.rc-theme .table thead th {
    border-bottom: 1px solid var(--rc-border);
    color: var(--rc-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--rc-surface-raised);
}

body.rc-theme .table td,
body.rc-theme .table th {
    border-top: 1px solid var(--rc-border-subtle);
    vertical-align: middle;
}

body.rc-theme .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

body.rc-theme .table-hover tbody tr:hover {
    background-color: var(--rc-surface-hover);
}

body.rc-theme .dataTables_wrapper .dataTables_filter input,
body.rc-theme .dataTables_wrapper .dataTables_length select {
    background: var(--rc-surface-raised);
    border-color: var(--rc-border);
    color: var(--rc-text);
}

/* Forms */
body.rc-theme .form-control {
    background-color: var(--rc-surface-raised);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    color: var(--rc-text);
}

body.rc-theme .form-control:focus {
    background-color: var(--rc-surface-raised);
    border-color: var(--rc-border-hover);
    box-shadow: 0 0 0 3px var(--rc-ring);
    color: var(--rc-text);
}

body.rc-theme .form-control::placeholder {
    color: var(--rc-text-muted);
}

body.rc-theme .form-control-label,
body.rc-theme label {
    color: var(--rc-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

body.rc-theme .input-group-text {
    background: var(--rc-surface-raised);
    border-color: var(--rc-border);
    color: var(--rc-text-muted);
}

body.rc-theme select.form-control option {
    background: var(--rc-surface-raised);
    color: var(--rc-text);
}

body.rc-theme .custom-select {
    background-color: var(--rc-surface-raised);
    border-color: var(--rc-border);
    color: var(--rc-text);
}

/* Alerts */
body.rc-theme .alert {
    border-radius: var(--rc-radius-sm);
    border-width: 1px;
}

body.rc-theme .alert-success {
    background: var(--rc-accent-soft);
    border-color: var(--rc-accent-muted);
    color: var(--rc-accent);
}

body.rc-theme .alert-info {
    background: var(--rc-accent-soft);
    border-color: var(--rc-accent-muted);
    color: var(--rc-text-secondary);
}

body.rc-theme .alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.35);
    color: #fde047;
}

body.rc-theme .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

body.rc-theme .alert .alert-link {
    color: var(--rc-accent);
}

/* Buttons */
body.rc-theme .btn-primary {
    background-color: var(--rc-btn-primary-bg);
    border-color: var(--rc-btn-primary-border);
    color: var(--rc-text);
    border-radius: var(--rc-radius-sm);
    font-weight: 500;
}

body.rc-theme .btn-primary:hover,
body.rc-theme .btn-primary:focus {
    background-color: var(--rc-btn-primary-hover);
    border-color: var(--rc-btn-primary-border);
    color: var(--rc-text);
}

body.rc-theme .btn-default,
body.rc-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--rc-border-subtle);
    color: #e4e4e7;
    border-radius: var(--rc-radius-sm);
}

body.rc-theme .btn-default:hover,
body.rc-theme .btn-secondary:hover {
    background: var(--rc-surface-hover);
    border-color: var(--rc-border);
    color: var(--rc-text);
}

body.rc-theme .btn-outline-primary {
    border-color: var(--rc-border-hover);
    color: var(--rc-text);
}

body.rc-theme .btn-outline-primary:hover {
    background: var(--rc-surface-hover);
    border-color: var(--rc-border-hover);
    color: var(--rc-text);
}

body.rc-theme .btn-success {
    background: var(--rc-accent-strong);
    border-color: var(--rc-accent-strong);
}

body.rc-theme .btn-success:hover {
    background: var(--rc-accent-deep);
    border-color: var(--rc-accent-deep);
}

/* Remove borda/fundo branco do Bootstrap ao clicar em botões */
body.rc-theme .btn:focus,
body.rc-theme .btn.focus,
body.rc-theme .btn:active,
body.rc-theme .btn.active,
body.rc-theme button:focus,
body.rc-theme button:active {
    outline: none !important;
    box-shadow: none !important;
}

body.rc-theme .btn-default:focus,
body.rc-theme .btn-default.focus,
body.rc-theme .btn-default:active,
body.rc-theme .btn-default.active,
body.rc-theme .btn-default:active:focus,
body.rc-theme .btn-default.active:focus,
body.rc-theme .open > .dropdown-toggle.btn-default:focus,
body.rc-theme .open > .dropdown-toggle.btn-default {
    background: var(--rc-surface-hover) !important;
    border-color: var(--rc-border) !important;
    color: var(--rc-text) !important;
    box-shadow: none !important;
    outline: none !important;
}

body.rc-theme .btn-primary:focus,
body.rc-theme .btn-primary:active,
body.rc-theme .btn-primary.active,
body.rc-theme .btn-primary:active:focus {
    background-color: var(--rc-btn-primary-hover) !important;
    border-color: var(--rc-btn-primary-border) !important;
    color: var(--rc-text) !important;
    box-shadow: none !important;
    outline: none !important;
}

body.rc-theme .btn:focus-visible {
    box-shadow: 0 0 0 2px var(--rc-ring) !important;
}

body.rc-theme .btn:focus:not(:focus-visible) {
    box-shadow: none !important;
}

/* Toast — feedback de cópia e ações rápidas */
.rc-toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10900;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.rc-toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--rc-radius-sm);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface-raised);
    color: var(--rc-text);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.rc-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.rc-toast__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    font-size: 0.9375rem;
}

.rc-toast--success .rc-toast__icon {
    color: #4ade80;
}

.rc-toast--error .rc-toast__icon {
    color: #f87171;
}

.rc-toast--info .rc-toast__icon {
    color: var(--rc-accent);
}

.rc-toast__msg {
    min-width: 0;
}

body.rc-theme .nav-pills {
    background: rgba(9, 9, 11, 0.7);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius);
    padding: 8px 10px;
}

body.rc-theme .nav-pills .nav-link {
    color: var(--rc-text-secondary);
    border-radius: var(--rc-radius-sm);
    font-size: 15px;
}

body.rc-theme .nav-pills .nav-link.active {
    background-color: var(--rc-surface-raised);
    border-left: 3px solid var(--rc-accent-strong);
    color: var(--rc-text);
}

/* Sidebar (when visible) */
body.rc-theme .sidebar .card-sidebar {
    border-radius: var(--rc-radius);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
}

body.rc-theme .sidebar .list-group-item {
    background: transparent;
    border-color: var(--rc-border-subtle);
    color: var(--rc-text-secondary);
}

body.rc-theme .sidebar .list-group-item.active {
    background: var(--rc-surface-raised);
    border-left: 3px solid var(--rc-accent-strong);
    color: var(--rc-text);
}

/* Footer */
body.rc-theme #footer.rc-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: var(--rc-bg-elevated);
    border-top: 1px solid var(--rc-border);
    color: var(--rc-text-muted);
    padding: 2rem 0;
}

body.rc-theme #footer.rc-footer .nav-link {
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
}

body.rc-theme #footer.rc-footer .nav-link:hover {
    color: var(--rc-accent);
}

body.rc-theme #footer.rc-footer .copyright {
    color: var(--rc-text-muted);
    font-size: 0.75rem;
    text-align: center;
}

body.rc-theme #footer.rc-footer .btn {
    color: var(--rc-text-muted);
    background: transparent;
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    font-size: 0.8125rem;
}

/* Modals */
body.rc-theme .modal-content {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    color: var(--rc-text);
}

body.rc-theme .modal-header {
    border-bottom-color: var(--rc-border);
}

body.rc-theme .modal-footer {
    border-top-color: var(--rc-border);
}

/* Links */
body.rc-theme a {
    color: var(--rc-text-secondary);
}

body.rc-theme a:hover {
    color: var(--rc-accent);
}

body.rc-theme .text-muted {
    color: var(--rc-text-muted) !important;
}

/* Homepage premium */
body.rc-home-premium #main-body > .container {
    max-width: var(--rc-content-max);
}

body.rc-app-shell.rc-home-premium #main-body > .container {
    max-width: none;
    width: 100%;
}

body.rc-home-premium .master-breadcrumb {
    display: none;
}

.rc-home-hero {
    text-align: center;
    padding: clamp(2rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

.rc-home-hero__eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--rc-accent-soft);
    border: 1px solid var(--rc-accent-muted);
    color: var(--rc-accent);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rc-home-hero__title {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--rc-text);
}

.rc-home-hero__lead {
    margin: 0 auto 2rem;
    max-width: 36rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--rc-text-muted);
}

.rc-home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.rc-home-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.rc-home-trust__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    background: var(--rc-surface-raised);
    border: 1px solid var(--rc-border);
    color: var(--rc-text-secondary);
    font-size: 0.8125rem;
}

.rc-home-trust__pill i {
    color: var(--rc-accent-strong);
}

.rc-home-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.rc-home-product-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    border-radius: var(--rc-radius);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    box-shadow: var(--rc-shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rc-home-product-card:hover {
    border-color: var(--rc-border-hover);
    box-shadow: var(--rc-shadow-hover);
}

.rc-home-product-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--rc-text);
}

.rc-home-product-card__tagline {
    flex: 1;
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--rc-text-muted);
}

.rc-home-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.rc-home-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-radius: var(--rc-radius);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text-secondary) !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
}

.rc-home-quick-link:hover {
    border-color: var(--rc-border-hover);
    background: var(--rc-surface-hover);
    color: var(--rc-text) !important;
}

.rc-home-quick-link__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--rc-accent-soft);
    color: var(--rc-accent-strong);
    font-size: 1.125rem;
}

.rc-section-title {
    margin: 2.5rem 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--rc-text);
}

/* Topbar — logged-in client chrome (legado — mantido para compat) */
body.rc-theme #header.rc-chrome .topbar .active-client .input-group-text {
    background: transparent;
    border: 0;
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem 0.25rem 0;
}

body.rc-theme #header.rc-chrome .topbar .active-client .btn {
    color: var(--rc-text-secondary);
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

body.rc-theme #header.rc-chrome .topbar .active-client .btn.btn-active-client span {
    border-bottom: 1px dashed var(--rc-border-hover);
    color: var(--rc-text);
}

body.rc-theme #header.rc-chrome .topbar .active-client .btn:hover {
    color: var(--rc-text);
}

body.rc-theme #header.rc-chrome .toolbar .nav-link {
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    color: var(--rc-text-secondary);
}

body.rc-theme #header.rc-chrome .toolbar .nav-link:hover {
    border-color: var(--rc-border-hover);
    background: var(--rc-surface-hover);
    color: var(--rc-text);
}

body.rc-theme #header.rc-chrome .cart-btn .badge.badge-info {
    background: var(--rc-accent-strong);
    color: var(--rc-bg);
}

/* Admin return tab — dark theme */
@media (min-width: 768px) {
    body.rc-theme .btn-return-to-admin {
        position: fixed !important;
        top: 50%;
        right: 0;
        padding: 0.5rem 1rem !important;
        background: var(--rc-surface-raised) !important;
        border: 1px solid var(--rc-border) !important;
        color: var(--rc-text-muted) !important;
        font-size: 0.75rem !important;
        font-weight: 500;
        border-radius: var(--rc-radius-sm) 0 0 var(--rc-radius-sm) !important;
        transform: translateY(-50%) rotate(90deg);
        transform-origin: center right;
        z-index: 500;
        box-shadow: var(--rc-shadow);
    }

    body.rc-theme .btn-return-to-admin:hover {
        background: var(--rc-surface-hover) !important;
        color: var(--rc-text) !important;
        border-color: var(--rc-border-hover) !important;
    }
}

/* Notifications popover */
body.rc-theme .popover {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    box-shadow: var(--rc-shadow-hover);
}

body.rc-theme .popover-body {
    color: var(--rc-text);
    padding: 0;
}

body.rc-theme .popover-user-notifications ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.rc-theme .popover-user-notifications ul li {
    border-bottom: 1px solid var(--rc-border-subtle);
}

body.rc-theme .popover-user-notifications ul li:last-child {
    border-bottom: 0;
}

body.rc-theme .popover-user-notifications ul li a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--rc-text-secondary);
    text-decoration: none;
}

body.rc-theme .popover-user-notifications ul li a:hover {
    background: var(--rc-surface-hover);
    color: var(--rc-text);
}

body.rc-theme .popover-user-notifications ul li.none {
    padding: 1rem;
    color: var(--rc-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Stock WHMCS white surfaces */
body.rc-theme .primary-content .bg-white,
body.rc-theme #main-body .bg-white {
    background-color: var(--rc-surface) !important;
}

body.rc-theme .text-dark,
body.rc-theme .text-body {
    color: var(--rc-text) !important;
}

body.rc-theme .badge-light {
    background: var(--rc-surface-raised);
    color: var(--rc-text-secondary);
    border: 1px solid var(--rc-border);
}

body.rc-theme .badge-secondary {
    background: var(--rc-surface-raised);
    color: var(--rc-text-muted);
    border: 1px solid var(--rc-border);
}

body.rc-theme .dropdown-menu {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    box-shadow: var(--rc-shadow-hover);
}

body.rc-theme .dropdown-item {
    color: var(--rc-text-secondary);
    font-size: 0.875rem;
}

body.rc-theme .dropdown-item:hover,
body.rc-theme .dropdown-item:focus {
    background: var(--rc-surface-hover);
    color: var(--rc-text);
}

body.rc-theme .dropdown-divider {
    border-top-color: var(--rc-border-subtle);
}

/* Nav tabs consistency */
body.rc-theme .nav-tabs {
    border-bottom-color: var(--rc-border);
}

body.rc-theme .nav-tabs .nav-link {
    color: var(--rc-text-muted);
    border-color: transparent;
}

body.rc-theme .nav-tabs .nav-link:hover {
    color: var(--rc-text);
    border-color: var(--rc-border);
    background: var(--rc-surface-hover);
}

body.rc-theme .nav-tabs .nav-link.active {
    color: var(--rc-text);
    background: var(--rc-surface);
    border-color: var(--rc-border) var(--rc-border) var(--rc-surface);
}

/* Banner de verificação de e-mail */
.rc-email-verify-wrap {
    padding: 0.75rem 15px 0;
}

.rc-email-verify {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0 auto 1rem;
    padding: 0.875rem 1rem 0.875rem 1.15rem;
    max-width: var(--rc-content-max);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, rgba(234, 179, 8, 0.05) 45%, rgba(83, 82, 237, 0.06) 100%),
        var(--rc-surface-raised);
    border: 1px solid rgba(234, 179, 8, 0.38);
    border-radius: var(--rc-radius-sm);
    box-shadow:
        0 0 0 1px rgba(234, 179, 8, 0.06),
        0 4px 24px rgba(234, 179, 8, 0.1);
}

.rc-email-verify::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #fbbf24, var(--rc-warning));
    border-radius: var(--rc-radius-sm) 0 0 var(--rc-radius-sm);
}

.rc-email-verify__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: rgba(234, 179, 8, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    font-size: 0.9375rem;
}

.rc-email-verify__icon .fas,
.rc-email-verify__icon .far,
.rc-email-verify__icon .fal {
    float: none !important;
    padding: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
}

.rc-email-verify__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    font-weight: 500;
    color: #fef3c7;
}

.rc-email-verify__actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.rc-email-verify__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 !important;
    padding: 0.4rem 0.75rem !important;
    border: 1px solid rgba(83, 82, 237, 0.45) !important;
    border-radius: 8px !important;
    background: var(--rc-accent-strong) !important;
    background-image: none !important;
    color: #fff !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    line-height: 1.2 !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rc-email-verify__btn:hover,
.rc-email-verify__btn:focus {
    background: var(--rc-accent-hover) !important;
    border-color: var(--rc-accent-hover) !important;
    color: #fff !important;
}

.rc-email-verify__btn .fas,
.rc-email-verify__btn .fa {
    float: none !important;
    padding: 0 !important;
    font-size: 0.7rem !important;
    color: #fff !important;
}

.rc-email-verify__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    color: rgba(254, 243, 199, 0.65) !important;
    font-size: 0.625rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.rc-email-verify__dismiss .fas,
.rc-email-verify__dismiss .far,
.rc-email-verify__dismiss .fal,
.rc-email-verify__dismiss .fa {
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.625rem !important;
    line-height: 1 !important;
    color: inherit !important;
}

.rc-email-verify__dismiss:hover {
    background: rgba(234, 179, 8, 0.15) !important;
    color: #fef3c7 !important;
}

body.rc-theme .verification-banner.email-verification .rc-email-verify__dismiss .fas,
body.rc-theme .verification-banner.email-verification .rc-email-verify__dismiss .far,
body.rc-theme .verification-banner.email-verification .rc-email-verify__dismiss .fal {
    float: none !important;
    padding: 0 !important;
    font-size: 0.625rem !important;
    color: inherit !important;
}

body.rc-theme .verification-banner.email-verification.rc-email-verify {
    background:
        linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, rgba(234, 179, 8, 0.05) 45%, rgba(83, 82, 237, 0.06) 100%),
        var(--rc-surface-raised) !important;
    border: 1px solid rgba(234, 179, 8, 0.38) !important;
    border-bottom: none !important;
    color: #fef3c7 !important;
    padding: 0.875rem 1rem 0.875rem 1.15rem !important;
    font-weight: inherit !important;
}

body.rc-theme .verification-banner.email-verification .rc-email-verify__btn.btn-action {
    background: var(--rc-accent-strong) !important;
    border-color: rgba(83, 82, 237, 0.45) !important;
    color: #fff !important;
}

@media (max-width: 767px) {
    .rc-email-verify {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.875rem;
    }

    .rc-email-verify__text {
        flex: 1 1 calc(100% - 2.75rem);
        order: 1;
    }

    .rc-email-verify__icon {
        order: 0;
    }

    .rc-email-verify__actions {
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }
}

/* Legado — outros alerts rc-alert (se usados) */
.rc-container {
    background: transparent;
    padding: 0.75rem 0 0;
    max-width: 100%;
}

.rc-alert.rc-alert-info-custom {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    color: var(--rc-text);
    border-radius: var(--rc-radius-sm);
    padding: 0.875rem 1rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    box-shadow: var(--rc-shadow);
    max-width: var(--rc-content-max);
}

.rc-alert-icon {
    color: var(--rc-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

.rc-alert-message {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.rc-alert-message .alert-text-content {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rc-text-secondary);
}

.rc-alert-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.rc-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: var(--rc-accent-strong);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.rc-btn-primary:hover {
    background: var(--rc-accent-hover);
    color: #fff;
}

.rc-btn-close-custom {
    background: transparent;
    border: none;
    color: var(--rc-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    line-height: 1;
}

.rc-btn-close-custom:hover {
    color: var(--rc-text);
    background: var(--rc-surface-hover);
}

/* Modal gerar senha */
.rc-generate-pw-modal .modal-dialog {
    max-width: 440px;
}

.rc-generate-pw-modal__content {
    background: var(--rc-surface) !important;
    border: 1px solid var(--rc-border) !important;
    border-radius: var(--rc-radius) !important;
    box-shadow: var(--rc-shadow-hover);
    color: var(--rc-text);
    overflow: hidden;
}

.rc-generate-pw-modal__head {
    background: linear-gradient(105deg, #4342c4 0%, var(--rc-accent-strong) 55%, #3d3bc4 100%) !important;
    border: none !important;
    padding: 1rem 1.25rem !important;
}

.rc-generate-pw-modal__head .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.rc-generate-pw-modal__head .close {
    color: #fff;
    opacity: 0.85;
    text-shadow: none;
}

.rc-generate-pw-modal__body {
    padding: 1.25rem !important;
    background: var(--rc-surface);
}

.rc-generate-pw-modal__body .col-form-label {
    color: var(--rc-text-secondary) !important;
    font-size: 0.875rem;
}

.rc-generate-pw-modal__body .form-control {
    background: var(--rc-surface-raised) !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text) !important;
    border-radius: var(--rc-radius-sm) !important;
}

.rc-generate-pw-modal__body .btn-default {
    background: var(--rc-surface-raised) !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text-secondary) !important;
    border-radius: var(--rc-radius-sm) !important;
}

.rc-generate-pw-modal__body .btn-default:hover {
    background: var(--rc-surface-hover) !important;
    color: var(--rc-text) !important;
}

.rc-generate-pw-modal__foot {
    background: var(--rc-surface-raised) !important;
    border-top: 1px solid var(--rc-border) !important;
    padding: 0.85rem 1.25rem !important;
}

.rc-generate-pw-modal__btn-secondary {
    background: var(--rc-surface) !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text-secondary) !important;
    border-radius: var(--rc-radius-sm) !important;
}

.rc-generate-pw-modal__btn-primary {
    border-radius: var(--rc-radius-sm) !important;
    font-weight: 600;
    border: none !important;
    background: var(--rc-btn-primary-bg) !important;
    box-shadow: 0 4px 16px rgba(83, 82, 237, 0.35);
}

/* Modal AJAX / sistema (2FA, etc.) */
#modalAjax.rc-system-modal .modal-dialog {
    max-width: 520px;
}

#modalAjax.rc-system-modal.twofa-setup .modal-dialog,
#modalAjax.rc-twofa-modal .modal-dialog {
    max-width: 640px;
}

#modalAjax .rc-system-modal__content {
    background: var(--rc-surface) !important;
    border: 1px solid var(--rc-border) !important;
    border-radius: var(--rc-radius) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    color: var(--rc-text);
    overflow: hidden;
}

#modalAjax .rc-system-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(105deg, #4342c4 0%, var(--rc-accent-strong) 55%, #3d3bc4 100%) !important;
    border: none !important;
    padding: 1rem 1.25rem !important;
}

#modalAjax .rc-system-modal__head .modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

#modalAjax .rc-system-modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    font-size: 1.125rem;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
    transition: background 0.15s ease;
}

#modalAjax .rc-system-modal__close:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff !important;
}

#modalAjax .rc-system-modal__close span {
    line-height: 1;
}

#modalAjax .rc-system-modal__body {
    padding: 1.25rem 1.25rem 1rem !important;
    background: var(--rc-surface);
    color: var(--rc-text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

#modalAjax .rc-system-modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--rc-surface-raised) !important;
    border-top: 1px solid var(--rc-border) !important;
    padding: 0.85rem 1.25rem !important;
}

#modalAjax .rc-system-modal__loader {
    margin-right: auto;
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
}

#modalAjax .rc-system-modal__loader .fa-spin {
    color: var(--rc-accent);
    margin-right: 0.35rem;
}

#modalAjax .rc-system-modal__btn-close {
    background: var(--rc-surface) !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text-secondary) !important;
    border-radius: var(--rc-radius-sm) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.45rem 0.875rem;
}

#modalAjax .rc-system-modal__btn-close:hover {
    background: var(--rc-surface-hover) !important;
    color: var(--rc-text) !important;
    border-color: var(--rc-border-hover) !important;
}

#modalAjax .rc-system-modal__btn-submit {
    border-radius: var(--rc-radius-sm) !important;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.45rem 0.875rem;
    border: none !important;
    background: var(--rc-btn-primary-bg) !important;
    box-shadow: 0 4px 16px rgba(83, 82, 237, 0.3);
}

#modalAjax .rc-system-modal__btn-submit.btn-danger {
    background: var(--rc-danger) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

#modalAjax .rc-system-modal__btn-submit.btn-success {
    background: var(--rc-btn-primary-bg) !important;
}

/* 2FA — conteúdo do modal */
#modalAjax.twofa-setup .rc-system-modal__body > p:first-of-type,
#modalAjax.rc-twofa-modal .rc-system-modal__body > p:first-of-type {
    margin: 0 0 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--rc-radius-sm);
    background: var(--rc-accent-soft);
    border: 1px solid var(--rc-accent-muted);
    color: var(--rc-text);
    font-size: 0.8125rem;
    line-height: 1.55;
}

#modalAjax.twofa-setup .rc-system-modal__body > p:nth-of-type(2),
#modalAjax.rc-twofa-modal .rc-system-modal__body > p:nth-of-type(2) {
    margin: 0 0 1rem;
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#modalAjax.twofa-setup .twofa-module,
#modalAjax.rc-twofa-modal .twofa-module {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0 0 0.625rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--rc-border) !important;
    border-radius: var(--rc-radius-sm) !important;
    background: var(--rc-surface-raised) !important;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

#modalAjax.twofa-setup .twofa-module:hover,
#modalAjax.rc-twofa-modal .twofa-module:hover {
    border-color: var(--rc-border-hover) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

#modalAjax.twofa-setup .twofa-module.active,
#modalAjax.rc-twofa-modal .twofa-module.active {
    border-color: var(--rc-accent-strong) !important;
    background: var(--rc-accent-soft) !important;
    box-shadow: 0 0 0 1px var(--rc-ring);
}

#modalAjax.twofa-setup .twofa-module .col-radio,
#modalAjax.rc-twofa-modal .twofa-module .col-radio {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
}

#modalAjax.twofa-setup .twofa-module .col-radio input[type="radio"],
#modalAjax.rc-twofa-modal .twofa-module .col-radio input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--rc-accent-strong);
    cursor: pointer;
}

#modalAjax.twofa-setup .twofa-module .col-logo,
#modalAjax.rc-twofa-modal .twofa-module .col-logo {
    float: none !important;
    width: 3rem !important;
    margin: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#modalAjax.twofa-setup .twofa-module .col-description,
#modalAjax.rc-twofa-modal .twofa-module .col-description {
    float: none !important;
    margin: 0 !important;
    flex: 1;
    min-width: 0;
    color: var(--rc-text-secondary);
    font-size: 0.8125rem;
    line-height: 1.45;
}

#modalAjax.twofa-setup .twofa-module .col-description strong,
#modalAjax.rc-twofa-modal .twofa-module .col-description strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--rc-text);
    font-size: 0.875rem;
    font-weight: 600;
}

#modalAjax.twofa-setup .twofa-module img,
#modalAjax.rc-twofa-modal .twofa-module img {
    max-height: 2rem;
    max-width: 100%;
    filter: brightness(1.05);
}

#modalAjax.twofa-setup .activation-msg,
#modalAjax.rc-twofa-modal .activation-msg {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px dashed var(--rc-accent-muted) !important;
    border-radius: var(--rc-radius-sm);
    background: var(--rc-accent-soft) !important;
    color: var(--rc-text) !important;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.06em;
}

#modalAjax.twofa-setup .backup-code,
#modalAjax.rc-twofa-modal .backup-code {
    margin: 1rem auto;
    padding: 0.875rem 1rem;
    border-radius: var(--rc-radius-sm);
    background: var(--rc-surface-raised) !important;
    border: 1px solid var(--rc-border);
    color: var(--rc-accent) !important;
    text-align: center;
    font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    word-break: break-all;
}

#modalAjax.twofa-setup #twofaactivation .form-control,
#modalAjax.rc-twofa-modal #twofaactivation .form-control,
#modalAjax.twofa-setup .rc-system-modal__body .form-control {
    background: var(--rc-surface-raised) !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text) !important;
    border-radius: var(--rc-radius-sm) !important;
}

#modalAjax.twofa-setup #twofaactivation label,
#modalAjax.rc-twofa-modal #twofaactivation label,
#modalAjax.twofa-setup .rc-system-modal__body label {
    color: var(--rc-text-secondary);
    font-size: 0.8125rem;
}

#modalAjax.twofa-setup .rc-system-modal__body img[src*="qr"],
#modalAjax.rc-twofa-modal .rc-system-modal__body img[src*="QR"],
#modalAjax.twofa-setup .rc-system-modal__body .qr-code img {
    display: block;
    max-width: 180px;
    margin: 0.75rem auto;
    padding: 0.5rem;
    border-radius: var(--rc-radius-sm);
    background: #fff;
}

#modalAjax.twofa-setup .rc-system-modal__body h3,
#modalAjax.rc-twofa-modal .rc-system-modal__body h3 {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--rc-text);
}

#modalAjax.twofa-setup .rc-system-modal__body .alert,
#modalAjax.rc-twofa-modal .rc-system-modal__body .alert {
    border-radius: var(--rc-radius-sm);
    font-size: 0.8125rem;
}

#modalAjax.twofa-setup .modal-submit:not([style*="display: none"]):not(.w-hidden),
#modalAjax.rc-twofa-modal .modal-submit:not([style*="display: none"]):not(.w-hidden) {
    display: inline-flex !important;
}

@media (max-width: 575px) {
    #modalAjax.rc-system-modal .modal-dialog,
    #modalAjax.rc-twofa-modal .modal-dialog {
        margin: 0.75rem;
    }

    #modalAjax.twofa-setup .twofa-module,
    #modalAjax.rc-twofa-modal .twofa-module {
        flex-wrap: wrap;
    }
}

/* ── Markdown editor — neutraliza all.css / theme.css (#f5f5f5, #fff) ── */
body.rc-theme .md-editor,
body.rc-theme div.md-editor.active {
    border: 1px solid var(--rc-border) !important;
    border-radius: var(--rc-radius-sm) !important;
    overflow: hidden;
    background: var(--rc-surface-raised) !important;
    box-shadow: none !important;
    max-width: 100%;
}

body.rc-theme .md-editor .md-footer,
body.rc-theme .md-editor > .md-footer,
body.rc-theme .md-editor > .md-header,
body.rc-theme .md-editor .md-header,
body.rc-theme .md-editor > .btn-toolbar,
body.rc-theme .md-editor .md-header.btn-toolbar {
    display: block;
    margin: 0 !important;
    padding: 0.375rem 0.5rem !important;
    background: var(--rc-surface-raised) !important;
    background-color: var(--rc-surface-raised) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--rc-border) !important;
}

body.rc-theme .md-editor > .btn-toolbar,
body.rc-theme .md-editor .md-header.btn-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

body.rc-theme .md-editor .btn-toolbar .btn,
body.rc-theme .md-editor .btn-toolbar .btn-group .btn {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid var(--rc-border) !important;
    color: var(--rc-text-muted) !important;
    border-radius: var(--rc-radius-sm) !important;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    box-shadow: none !important;
}

body.rc-theme .md-editor .btn-toolbar .btn:hover,
body.rc-theme .md-editor .btn-toolbar .btn:focus,
body.rc-theme .md-editor .btn-toolbar .btn.active {
    background: var(--rc-surface-hover) !important;
    background-color: var(--rc-surface-hover) !important;
    color: var(--rc-text) !important;
    border-color: var(--rc-border-hover) !important;
}

body.rc-theme .md-editor > textarea,
body.rc-theme .md-editor > textarea.markdown-editor,
body.rc-theme .md-editor textarea.md-input,
body.rc-theme .md-editor > .md-preview {
    padding: 1rem !important;
    border: 0 !important;
    border-top: 1px solid var(--rc-border-subtle) !important;
    border-bottom: 0 !important;
    background: var(--rc-surface-raised) !important;
    background-color: var(--rc-surface-raised) !important;
    color: var(--rc-text) !important;
    font-size: 0.875rem;
    line-height: 1.6;
    min-height: 200px;
    max-width: 100%;
    box-shadow: none !important;
}

body.rc-theme .md-editor > textarea:focus,
body.rc-theme .md-editor > textarea.markdown-editor:focus {
    background: var(--rc-surface-raised) !important;
    background-color: var(--rc-surface-raised) !important;
    box-shadow: none !important;
    outline: none;
}

body.rc-theme div.md-editor.active {
    border-color: var(--rc-accent-strong) !important;
    box-shadow: 0 0 0 3px var(--rc-ring) !important;
}

body.rc-theme .md-editor .md-footer,
body.rc-theme .md-editor > .md-footer {
    border-top: 1px solid var(--rc-border-subtle) !important;
    border-bottom: 0 !important;
    padding: 0 !important;
    background: var(--rc-surface) !important;
    background-color: var(--rc-surface) !important;
}

body.rc-theme .md-editor .markdown-editor-status {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--rc-text-muted);
    background: transparent !important;
    border: 0 !important;
    text-align: right;
}

body.rc-theme .md-editor .md-controls .md-control {
    color: var(--rc-text-muted) !important;
}

body.rc-theme .md-editor .md-controls .md-control:hover {
    color: var(--rc-text) !important;
}

body.rc-theme .md-editor.md-fullscreen-mode .md-header,
body.rc-theme .md-editor.md-fullscreen-mode > .md-header {
    background: var(--rc-surface-raised) !important;
    background-color: var(--rc-surface-raised) !important;
}

body.rc-theme .md-editor.md-fullscreen-mode .md-footer {
    background: var(--rc-surface) !important;
    background-color: var(--rc-surface) !important;
}
