/**
 * ═══════════════════════════════════════════════════════════════════
 * RV SYSTEM — Design Tokens & Utilities v3.0
 * Rally de Vendas — Retrofit UX Sprint
 *
 * Mudanças v3: gradientes, menos bordas, mais fluidez, melhor
 * contraste (WCAG AA), micro-animações, suporte 13"+ notebooks.
 * ═══════════════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────────────
   1. TOKENS DE DESIGN
───────────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --rv-red:          #E63946;
    --rv-red-hover:    #D62839;
    --rv-red-dim:      rgba(230, 57, 70, 0.12);
    --rv-red-border:   rgba(230, 57, 70, 0.30);
    --rv-yellow:       #FFE600;
    --rv-yellow-text:  #1a2060;
    --rv-ml-yellow:       #FFE600;
    --rv-ml-yellow-hover: #ffd500;
    --rv-ml-blue:         #1a2060;

    /* Superfícies — Light (v3: mais contraste, menos cinza) */
    --rv-bg:           #F8F9FB;
    --rv-surface:      #FFFFFF;
    --rv-surface-2:    #F1F3F5;
    --rv-surface-3:    #E9ECEF;
    --rv-border:       #E2E5E9;
    --rv-border-2:     #CED4DA;
    --rv-muted:        #868E96;
    --rv-text:         #212529;
    --rv-text-2:       #495057;
    --rv-text-3:       #868E96;

    /* Superfícies — Dark (v3: mais profundidade) */
    --rv-dark-bg:        #0C0C0E;
    --rv-dark-surface:   #161618;
    --rv-dark-surface-2: #1E1E21;
    --rv-dark-surface-3: #28282C;
    --rv-dark-border:    #2E2E33;
    --rv-dark-border-2:  #3E3E44;
    --rv-dark-muted:     #6B6B76;
    --rv-dark-text:      #F1F1F3;
    --rv-dark-text-2:    #A0A0AB;
    --rv-dark-text-3:    #6B6B76;

    /* Gradientes */
    --rv-grad-red:     linear-gradient(135deg, #E63946, #D62839);
    --rv-grad-hero:    linear-gradient(135deg, #E63946 0%, #8B5CF6 100%);
    --rv-grad-surface: linear-gradient(180deg, var(--rv-surface) 0%, var(--rv-bg) 100%);
    --rv-grad-glow:    radial-gradient(ellipse at 50% 0%, rgba(230,57,70,.06) 0%, transparent 70%);

    /* Tipografia */
    --rv-font:     'Inter', system-ui, -apple-system, sans-serif;
    --rv-mono:     'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

    /* Escala de fonte (mínimo 11px para acessibilidade) */
    --rv-text-2xs:  11px;
    --rv-text-xs:   12px;
    --rv-text-sm:   13px;
    --rv-text-base: 14px;
    --rv-text-md:   15px;
    --rv-text-lg:   16px;
    --rv-text-xl:   18px;
    --rv-text-2xl:  20px;
    --rv-text-3xl:  24px;
    --rv-text-4xl:  30px;

    /* Pesos */
    --rv-weight-normal:  400;
    --rv-weight-medium:  500;
    --rv-weight-semi:    600;
    --rv-weight-bold:    700;
    --rv-weight-black:   900;

    /* Espaçamento */
    --rv-sp-1:  4px;  --rv-sp-2:  8px;  --rv-sp-3:  12px;
    --rv-sp-4:  16px; --rv-sp-5:  20px; --rv-sp-6:  24px;
    --rv-sp-8:  32px; --rv-sp-10: 40px; --rv-sp-12: 48px;

    /* Bordas (v3: mais arredondadas) */
    --rv-radius-sm:   8px;
    --rv-radius-md:   12px;
    --rv-radius-lg:   16px;
    --rv-radius-xl:   20px;
    --rv-radius-2xl:  28px;
    --rv-radius-full: 9999px;

    /* Sombras (v3: mais suaves, menos borda-dependente) */
    --rv-shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
    --rv-shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --rv-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --rv-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --rv-shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --rv-shadow-red: 0 4px 14px rgba(230,57,70,0.25);
    --rv-shadow-glow:0 0 20px rgba(230,57,70,0.15);

    /* Layout */
    --rv-sidebar-w:   240px;
    --rv-topbar-h:    60px;
    --rv-bottombar-h: 64px;
    --rv-content-max: 1400px;

    /* Transições (v3: mais suaves) */
    --rv-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --rv-transition-md: 280ms cubic-bezier(0.4, 0, 0.2, 1);
    --rv-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --rv-acc-duration: 280ms;
}

/* Dark mode tokens */
.dark {
    --rv-bg:       var(--rv-dark-bg);
    --rv-surface:  var(--rv-dark-surface);
    --rv-surface-2:var(--rv-dark-surface-2);
    --rv-surface-3:var(--rv-dark-surface-3);
    --rv-border:   var(--rv-dark-border);
    --rv-border-2: var(--rv-dark-border-2);
    --rv-muted:    var(--rv-dark-muted);
    --rv-text:     var(--rv-dark-text);
    --rv-text-2:   var(--rv-dark-text-2);
    --rv-text-3:   var(--rv-dark-text-3);
    --rv-grad-surface: linear-gradient(180deg, var(--rv-dark-surface) 0%, var(--rv-dark-bg) 100%);
    --rv-grad-glow: radial-gradient(ellipse at 50% 0%, rgba(230,57,70,.04) 0%, transparent 70%);
}

/* ─────────────────────────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    /* font-size: NÃO alterar — Tailwind usa 16px como base para rem.
       Mudar para 14px quebra TODAS as classes Tailwind (w-4, p-8, text-xl, etc). */
    scroll-behavior: smooth;
    text-size-adjust: none;
    -webkit-text-size-adjust: none;
}

body {
    font-family: var(--rv-font);
    font-size: var(--rv-text-base);
    line-height: 1.6;
    color: var(--rv-text);
    background: var(--rv-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Skip to content (acessibilidade) */
.rv-skip-link {
    position: absolute;
    left: -9999px;
    top: -9999px;
    z-index: 9999;
    background: var(--rv-red);
    color: #fff;
    padding: 8px 24px;
    border-radius: 0 0 var(--rv-radius-md) var(--rv-radius-md);
    font-weight: var(--rv-weight-bold);
}
.rv-skip-link:focus {
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* Mínimo 11px — apenas para small e .text-2xs (não forçar em Tailwind arbitrários) */
small, .text-2xs {
    font-size: var(--rv-text-2xs);
}

/* ─────────────────────────────────────────────────────────────────
   3. TIPOGRAFIA
───────────────────────────────────────────────────────────────── */
.rv-label      { font-size: var(--rv-text-xs); font-weight: var(--rv-weight-semi); letter-spacing: 0.02em; color: var(--rv-text-3); }
.rv-caption    { font-size: var(--rv-text-xs);  color: var(--rv-text-2); }
.rv-body       { font-size: var(--rv-text-base); }
.rv-body-lg    { font-size: var(--rv-text-md); }
.rv-heading-sm { font-size: var(--rv-text-xl);  font-weight: var(--rv-weight-black); letter-spacing: -0.02em; }
.rv-heading    { font-size: var(--rv-text-2xl); font-weight: var(--rv-weight-black); letter-spacing: -0.03em; }
.rv-display    { font-size: var(--rv-text-4xl); font-weight: var(--rv-weight-black); letter-spacing: -0.04em; }

/* ─────────────────────────────────────────────────────────────────
   4. SCROLLBAR (sutil, elegante)
───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--rv-border-2); border-radius: var(--rv-radius-full); }
::-webkit-scrollbar-thumb:hover  { background: var(--rv-muted); }
* { scrollbar-width: thin; scrollbar-color: var(--rv-border-2) transparent; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ─────────────────────────────────────────────────────────────────
   4b. LAYOUT RESPONSIVO — Ajusta altura do container principal em mobile
───────────────────────────────────────────────────────────────── */
/* Em mobile: #rv-main ocupa calc(100dvh - 64px) para não sobrepor bottom bar */
@media (max-width: 767px) {
    #rv-main {
        height: calc(100dvh - var(--rv-bottombar-h));
        max-height: calc(100dvh - var(--rv-bottombar-h));
    }
}
/* Em desktop: #rv-main ocupa 100% (sem bottom bar) */
@media (min-width: 768px) {
    #rv-main {
        height: 100dvh;
    }
}

/* ─────────────────────────────────────────────────────────────────
   5. FOCO ACESSÍVEL (WCAG 2.1 AA)
───────────────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--rv-red);
    outline-offset: 2px;
    border-radius: var(--rv-radius-sm);
}
/* Área mínima de toque 44x44px — apenas para botões primários e CTAs.
   Não aplicar globalmente: quebraria sidebar, badges, pills e elementos compactos. */
@media (pointer: coarse) {
    .rv-btn, .rv-btn-race, .rv-btn-ml, .campo, select.campo {
        min-height: 44px;
    }
}

/* ─────────────────────────────────────────────────────────────────
   6. ACCORDION (Sidebar)
───────────────────────────────────────────────────────────────── */
.rv-acc-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--rv-acc-duration) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.rv-acc-body.open { grid-template-rows: 1fr; }
.rv-acc-body > * { min-height: 0; overflow: hidden; }
.rv-acc-arrow { transition: transform var(--rv-acc-duration) cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.rv-acc-arrow.open { transform: rotate(180deg); }

/* ─────────────────────────────────────────────────────────────────
   7. LAYOUT (v3: melhor scroll, menos overflow-hidden)
───────────────────────────────────────────────────────────────── */
.rv-layout { display: flex; min-height: 100dvh; }

.rv-sidebar {
    width: var(--rv-sidebar-w);
    flex-shrink: 0;
    height: 100dvh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--rv-surface);
    border-right: 1px solid var(--rv-border);
    overflow: hidden;
    z-index: 40;
}
.rv-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--rv-sp-3) var(--rv-sp-3) var(--rv-sp-6);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.rv-sidebar-nav::-webkit-scrollbar { width: 3px; }
.rv-sidebar-nav::-webkit-scrollbar-thumb { background: var(--rv-border); }

.rv-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

/* ─────────────────────────────────────────────────────────────────
   8. NAV COMPONENTS
───────────────────────────────────────────────────────────────── */
.rv-nav-link {
    display: flex; align-items: center; gap: var(--rv-sp-3);
    padding: var(--rv-sp-2) var(--rv-sp-3);
    border-radius: var(--rv-radius-lg);
    font-size: var(--rv-text-sm); font-weight: var(--rv-weight-semi);
    color: var(--rv-text-2);
    transition: all var(--rv-transition);
    width: 100%; min-height: 40px;
    position: relative; text-decoration: none; cursor: pointer;
    border: none; background: transparent; text-align: left; line-height: 1.3;
}
.rv-nav-link:hover { background: var(--rv-surface-2); color: var(--rv-text); }
.rv-nav-link.active, .rv-nav-link[aria-current="page"] {
    background: var(--rv-red); color: #fff;
    font-weight: var(--rv-weight-bold);
    box-shadow: var(--rv-shadow-red);
}
.rv-nav-link.active-ml {
    background: var(--rv-yellow); color: var(--rv-yellow-text);
    box-shadow: 0 4px 14px rgba(255,230,0,0.30);
}

.rv-nav-group-btn {
    display: flex; align-items: center; gap: var(--rv-sp-3);
    padding: var(--rv-sp-2) var(--rv-sp-3);
    border-radius: var(--rv-radius-lg);
    font-size: var(--rv-text-2xs); font-weight: var(--rv-weight-black);
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--rv-text-3);
    transition: all var(--rv-transition);
    width: 100%; min-height: 36px; cursor: pointer;
    border: none; background: transparent; text-align: left;
    margin-top: var(--rv-sp-2); user-select: none;
}
.rv-nav-group-btn:hover { background: var(--rv-surface-2); color: var(--rv-text); }

/* Badge */
.rv-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--rv-radius-full);
    font-size: var(--rv-text-2xs); font-weight: var(--rv-weight-black);
    line-height: 1; white-space: nowrap; flex-shrink: 0;
}
.rv-badge-red    { background: var(--rv-red); color: #fff; }
.rv-badge-yellow { background: var(--rv-yellow); color: var(--rv-yellow-text); }
.rv-badge-muted  { background: var(--rv-surface-2); color: var(--rv-text-3); border: 1px solid var(--rv-border); }
.rv-badge-pro    { background: linear-gradient(135deg, rgb(99 102 241), rgb(139 92 246)); color: #fff; }

/* ─────────────────────────────────────────────────────────────────
   9. TABLES
───────────────────────────────────────────────────────────────── */
.rv-table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: var(--rv-radius-xl);
    background: var(--rv-surface);
    box-shadow: var(--rv-shadow-sm);
}
.rv-table { width: 100%; border-collapse: collapse; font-size: var(--rv-text-sm); }
.rv-table th {
    padding: var(--rv-sp-3) var(--rv-sp-4);
    font-size: var(--rv-text-2xs); font-weight: var(--rv-weight-black);
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--rv-text-3); background: var(--rv-surface-2);
    border-bottom: 1px solid var(--rv-border);
    text-align: left; white-space: nowrap;
}
.rv-table th[data-sort] { cursor: pointer; user-select: none; }
.rv-table th[data-sort]:hover { color: var(--rv-red); }
.rv-table td {
    padding: var(--rv-sp-3) var(--rv-sp-4);
    border-bottom: 1px solid var(--rv-surface-2);
    color: var(--rv-text); vertical-align: middle;
}
.rv-table tr:last-child td { border-bottom: none; }
.rv-table tbody tr { transition: background var(--rv-transition); }
.rv-table tbody tr:hover { background: var(--rv-surface-2); }

/* ─────────────────────────────────────────────────────────────────
   10. CARDS (v3: menos borda, mais sombra)
───────────────────────────────────────────────────────────────── */
.rv-card {
    background: var(--rv-surface);
    border-radius: var(--rv-radius-xl);
    box-shadow: var(--rv-shadow-sm);
    border: 1px solid transparent;
}
.dark .rv-card { border-color: var(--rv-border); box-shadow: none; }
.rv-card-hover {
    transition: all var(--rv-transition-md);
    cursor: pointer;
}
.rv-card-hover:hover {
    box-shadow: var(--rv-shadow-lg);
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────
   11. BUTTONS (v3: gradientes, glow, melhor feedback)
───────────────────────────────────────────────────────────────── */
.rv-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--rv-sp-2);
    padding: var(--rv-sp-2) var(--rv-sp-4);
    border-radius: var(--rv-radius-lg);
    font-size: var(--rv-text-xs); font-weight: var(--rv-weight-black);
    text-transform: uppercase; letter-spacing: 0.06em;
    cursor: pointer; border: none;
    transition: all var(--rv-transition);
    white-space: nowrap; min-height: 40px;
    text-decoration: none; line-height: 1;
    position: relative; overflow: hidden;
}
.rv-btn:active            { transform: scale(0.96); }
.rv-btn:disabled          { opacity: 0.5; cursor: not-allowed; transform: none; }

.rv-btn-primary {
    background: var(--rv-grad-red); color: #fff;
    box-shadow: var(--rv-shadow-red);
}
.rv-btn-primary:hover { box-shadow: var(--rv-shadow-glow), var(--rv-shadow-red); filter: brightness(1.08); }

.rv-btn-secondary { background: var(--rv-surface); color: var(--rv-text); box-shadow: var(--rv-shadow-sm); }
.rv-btn-secondary:hover { box-shadow: var(--rv-shadow-md); }

.rv-btn-ghost { background: transparent; color: var(--rv-text-2); }
.rv-btn-ghost:hover { background: var(--rv-surface-2); color: var(--rv-text); }

.rv-btn-danger { background: var(--rv-red-dim); color: var(--rv-red); }
.rv-btn-danger:hover { background: var(--rv-red); color: #fff; box-shadow: var(--rv-shadow-red); }

.rv-btn-sm { min-height: 32px; padding: var(--rv-sp-1) var(--rv-sp-3); font-size: var(--rv-text-2xs); }
.rv-btn-lg { min-height: 48px; padding: var(--rv-sp-3) var(--rv-sp-6); font-size: var(--rv-text-sm); border-radius: var(--rv-radius-xl); }

/* ─────────────────────────────────────────────────────────────────
   12. INPUTS (v3: mais espaçamento, foco mais visível)
───────────────────────────────────────────────────────────────── */
.rv-input {
    display: block; width: 100%;
    padding: 10px var(--rv-sp-3);
    background: var(--rv-surface);
    border: 1.5px solid var(--rv-border);
    border-radius: var(--rv-radius-md);
    font-size: var(--rv-text-base); font-family: var(--rv-font);
    color: var(--rv-text);
    transition: border-color var(--rv-transition), box-shadow var(--rv-transition);
    outline: none; min-height: 44px; line-height: 1.4;
}
.rv-input::placeholder { color: var(--rv-muted); }
.rv-input:focus {
    border-color: var(--rv-red);
    box-shadow: 0 0 0 3px var(--rv-red-dim);
}
.rv-input:disabled { opacity: 0.5; cursor: not-allowed; }

.rv-label-field {
    display: block;
    font-size: var(--rv-text-xs); font-weight: var(--rv-weight-semi);
    color: var(--rv-text-2); margin-bottom: 6px;
}

/* ─────────────────────────────────────────────────────────────────
   13. MOBILE — Bottom Bar
───────────────────────────────────────────────────────────────── */
.rv-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--rv-bottombar-h);
    background: var(--rv-surface);
    border-top: 1px solid var(--rv-border);
    z-index: 50;
    display: flex; align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(10px);
}
.rv-bottom-bar-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    font-size: var(--rv-text-2xs); font-weight: var(--rv-weight-bold);
    color: var(--rv-text-3); cursor: pointer;
    transition: color var(--rv-transition);
    padding: var(--rv-sp-1) 0;
    border: none; background: transparent; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.rv-bottom-bar-item:hover, .rv-bottom-bar-item.active { color: var(--rv-red); }

@media (max-width: 767px) {
    .rv-main {
        padding-bottom: calc(var(--rv-bottombar-h) + env(safe-area-inset-bottom, 0px) + 8px);
    }
}

/* ─────────────────────────────────────────────────────────────────
   14. DRAWER MOBILE
───────────────────────────────────────────────────────────────── */
.rv-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0; pointer-events: none;
    transition: opacity var(--rv-transition-md);
}
.rv-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.rv-drawer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--rv-surface);
    border-radius: var(--rv-radius-2xl) var(--rv-radius-2xl) 0 0;
    transform: translateY(100%);
    transition: transform var(--rv-transition-md);
    max-height: 88dvh;
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}
.rv-drawer.open { transform: translateY(0); }
.rv-drawer-handle { width: 40px; height: 4px; border-radius: var(--rv-radius-full); background: var(--rv-border-2); margin: 12px auto 4px; flex-shrink: 0; }
.rv-drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* ─────────────────────────────────────────────────────────────────
   15. PAGE HEADER
───────────────────────────────────────────────────────────────── */
.rv-page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--rv-sp-4); margin-bottom: var(--rv-sp-6); flex-wrap: wrap; }
.rv-page-title { font-size: var(--rv-text-2xl); font-weight: var(--rv-weight-black); letter-spacing: -0.03em; color: var(--rv-text); line-height: 1.2; }
.rv-page-subtitle { font-size: var(--rv-text-xs); font-weight: var(--rv-weight-bold); text-transform: uppercase; letter-spacing: 0.07em; color: var(--rv-text-3); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────────
   16. SEARCH BAR
───────────────────────────────────────────────────────────────── */
.rv-searchbar { position: relative; width: 100%; }
.rv-searchbar-icon { position: absolute; left: var(--rv-sp-3); top: 50%; transform: translateY(-50%); color: var(--rv-muted); pointer-events: none; font-size: 16px; }
.rv-searchbar .rv-input { padding-left: calc(var(--rv-sp-3) + 16px + var(--rv-sp-2)); }

/* ─────────────────────────────────────────────────────────────────
   17. FLASH MESSAGES
───────────────────────────────────────────────────────────────── */
.rv-flash {
    display: flex; align-items: flex-start; gap: var(--rv-sp-3);
    padding: var(--rv-sp-4); border-radius: var(--rv-radius-xl);
    font-size: var(--rv-text-base); font-weight: var(--rv-weight-medium);
    margin-bottom: var(--rv-sp-5);
}
.rv-flash-ok     { background: rgba(34,197,94,.08);  border-left: 4px solid #22c55e; color: #15803d; }
.rv-flash-aviso  { background: rgba(245,158,11,.08); border-left: 4px solid #f59e0b; color: #b45309; }
.rv-flash-erro   { background: rgba(230,57,70,.08);  border-left: 4px solid var(--rv-red); color: var(--rv-red); }
.dark .rv-flash-ok     { color: #4ade80; }
.dark .rv-flash-aviso  { color: #fbbf24; }
.dark .rv-flash-erro   { color: #ff6b74; }

/* ─────────────────────────────────────────────────────────────────
   18. UTILITIES (v3)
───────────────────────────────────────────────────────────────── */
.rv-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* SVG: vertical-align para alinhamento com texto (sem !important, sem forçar display) */
svg { vertical-align: middle; }

/* Gradiente sutil no topo da página */
.rv-glow-top { position: relative; }
.rv-glow-top::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 200px;
    background: var(--rv-grad-glow);
    pointer-events: none; z-index: 0;
}

/* Glass header */
.rv-glass {
    background: rgba(255,255,255,0.8) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}
.dark .rv-glass {
    background: rgba(22,22,24,0.85) !important;
}

/* Animações (respeita prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
    .rv-fade-in { animation: rvFadeIn 0.25s ease-out; }
    @keyframes rvFadeIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .rv-slide-up { animation: rvSlideUp 0.3s cubic-bezier(0.4,0,0.2,1); }
    @keyframes rvSlideUp {
        from { opacity: 0; transform: translateY(16px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .rv-spin { animation: rvSpin 1s linear infinite; }
    @keyframes rvSpin { to { transform: rotate(360deg); } }

    /* Hover lift para cards */
    .rv-lift { transition: transform var(--rv-transition), box-shadow var(--rv-transition); }
    .rv-lift:hover { transform: translateY(-2px); box-shadow: var(--rv-shadow-lg); }
}
@media (prefers-reduced-motion: reduce) {
    .rv-fade-in, .rv-slide-up, .rv-spin { animation: none !important; }
    .rv-lift:hover { transform: none; }
}

/* Aspect ratios */
.rv-ratio-square { aspect-ratio: 1; }
.rv-ratio-video  { aspect-ratio: 16/9; }

/* Divider sem borda (gradiente) */
.rv-divider {
    height: 1px; border: none;
    background: linear-gradient(90deg, transparent, var(--rv-border), transparent);
    margin: var(--rv-sp-4) 0;
}

/* Loading overlay */
.rv-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    border-radius: inherit; z-index: 10;
}
.dark .rv-loading-overlay { background: rgba(12,12,14,0.7); }

/* ─────────────────────────────────────────────────────────────────
   19. RESPONSIVO 13" NOTEBOOKS
───────────────────────────────────────────────────────────────── */
@media (max-height: 768px) {
    :root {
        --rv-sp-6: 20px;
        --rv-sp-8: 24px;
    }
    .rv-sidebar { --rv-sidebar-w: 220px; width: var(--rv-sidebar-w); }
    .rv-nav-link { min-height: 36px; padding: 6px var(--rv-sp-3); font-size: 12px; }
    .rv-nav-group-btn { min-height: 30px; font-size: 10px; }
}

/* ─────────────────────────────────────────────────────────────────
   20. CONTRASTE WCAG AA (min 4.5:1 para texto normal)
───────────────────────────────────────────────────────────────── */
@media (prefers-contrast: more) {
    :root { --rv-text-3: #495057; --rv-muted: #495057; }
    .dark { --rv-text-3: #A0A0AB; --rv-muted: #A0A0AB; }
}

/* ─────────────────────────────────────────────────────────────────
   21. TYPOGRAPHY POLISH — Suaviza Tailwind font-black + uppercase
   Problema: text-[10px] font-black uppercase tracking-widest fica
   muito agressivo (GRITANDO). Estas regras reduzem para visual
   profissional sem alterar cada view individualmente.
───────────────────────────────────────────────────────────────── */

/* Font weight: não sobrescrever Tailwind .font-black globalmente.
   Se quiser suavizar, usar classes específicas nas views, não override global. */

/* Tracking/uppercase: não sobrescrever Tailwind globalmente.
   Ajustar individualmente nas views se necessário. */

/* Sidebar: word wrap para não truncar */
.rv-nav-link, .rv-nav-group-btn {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
}

/* ─────────────────────────────────────────────────────────────────
   22. RESPONSIVIDADE — Anti-quebra de botões e overflow
───────────────────────────────────────────────────────────────── */

/* Botões RV: nowrap apenas em componentes do design system */
.rv-btn { white-space: nowrap; }
