/* ═══════════════════════════════════════════════════════
   REAVIVA Admin — adaptado do app.final
   Paleta navy + turquesa + amarelo · Nunito Sans + Open Sans
   ═══════════════════════════════════════════════════════ */

:root {
    --navy-1: #1E2B38;
    --navy-2: #2B3342;
    --brand: #17A39C;
    --brand-dk: #128A84;
    --brand-lt: #E8F6F5;
    --brand-mid: #3F4A5C;
    --turquesa: #17A39C;
    --turquesa-dk: #128A84;
    --turquesa-lt: #5EC5BF;
    --amarelo: #F5BE1A;
    --light-bg: #F2F4F7;
    --light-card: #FFFFFF;
    --light-border: #E4E8EE;
    --text: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --verde: #27AE60;
    --vermelho: #C0392B;
    --ambar: #D4820A;
    --danger: #EF4444;
    --sidebar-width: 234px;
    --sidebar-compact: 64px;
    --sidebar-mobile: 198px;
    --topbar-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 24px 60px -16px rgba(4, 62, 77, 0.24);
    --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Open Sans', 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

/* ═══════════════════════════════════════════════════════
   LOGIN — spec exata REAVIVA (v3, segundo prompt definitivo)
   ═══════════════════════════════════════════════════════ */
.rv-admin-login {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1E2B38 0%, #2B3342 100%);
    padding: 40px 24px;
    color: white;
    font-family: 'Nunito Sans', 'Open Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}

/* keyframes — só from/to (easing fluído, sem stops) */
@keyframes logoIntro {
    from {
        opacity: 0;
        transform: scale(0.30) rotate(-8deg);
        filter: blur(20px) drop-shadow(0 0 0 transparent);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0) drop-shadow(0 0 26px rgba(23,163,156,0.45));
    }
}
@keyframes logoPulseReady {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 26px rgba(23,163,156,0.45));
    }
    50% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 42px rgba(23,163,156,0.75));
    }
}
@keyframes brandFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Hint "vai e volta" — sobe e desce suave + opacidade */
@keyframes hintBlink {
    0%, 100% { opacity: 0.45; transform: translateY(0); }
    50%      { opacity: 1;    transform: translateY(-4px); }
}
@keyframes formSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Coluna central */
.rv-login-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 520px;
}

/* Botão wrapper da logo (logo INTEIRA é clicável) */
.rv-hero-btn {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.rv-hero-btn:focus { outline: none; }

/* Logo: 480px hero → 300px form. Glow turquesa permanente. */
.rv-hero-logo-img {
    height: 480px;
    width: auto;
    display: block;
    transform-origin: center center;
    will-change: transform, opacity, filter;
    /* Intro mais lenta (3s) + pulse contínuo encadeado */
    animation:
        logoIntro 3s cubic-bezier(0.22, 1, 0.36, 1) both,
        logoPulseReady 2.8s 3s ease-in-out infinite;
    transition: height 0.5s ease;
}
.rv-admin-login.is-form .rv-hero-logo-img { height: 300px; }

/* Wordmark — sempre visível (NÃO some na fase 2) */
.rv-hero-brand-wrap {
    text-align: center;
    animation: brandFadeIn 0.9s 1.8s ease-out both;
}
.rv-hero-brand {
    margin: 0;
    font-family: 'Nunito Sans', 'Open Sans', sans-serif;
    font-size: 1.7rem;       /* 27.2px — mesmo do auth_gate.py */
    font-weight: 600;        /* mais leve, igual produção */
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.25;
    text-transform: uppercase;
}
.rv-hero-brand-sub {
    display: block;
    margin: 4px 0 0;
    font-family: 'Nunito Sans', 'Open Sans', sans-serif;
    font-size: 0.68rem;      /* 10.9px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.55);
}

/* Hint "Clique para acessar" — case normal, lowercase como produção */
.rv-hero-hint {
    -webkit-appearance: none;
    appearance: none;
    margin: 24px 0 0;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 0.85rem;             /* tamanho da produção */
    font-weight: 400;
    text-transform: none;            /* CASE NORMAL — não maiúsculo */
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* "vai e volta" — sobe e desce + fade, começa após intro+wordmark */
    animation: hintBlink 2s 3.5s ease-in-out infinite both;
    will-change: transform, opacity;
}
.rv-hero-hint:focus { outline: none; }
.rv-hero-hint:hover { color: #ffffff; }

/* Form — só aparece na fase 2 (atributo hidden tem que vencer flex) */
.rv-login-form[hidden] { display: none !important; }
.rv-login-form {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    animation: formSlideIn 0.6s ease-out both;
}
.rv-login-form input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.97);
    color: #2B3342;          /* navy — também forçado inline */
    border: 0;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    caret-color: #17A39C;
}
.rv-login-form input:focus { background: #ffffff; }
.rv-login-form input::placeholder {
    color: rgba(63, 74, 92, 0.6);  /* grafite a 60% */
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #2B3342 !important;
    caret-color: #17A39C !important;
    transition: background-color 9999s ease-in-out 0s !important;
}
.rv-login-error {
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: #FCA5A5;
}
.rv-login-warn {
    margin: 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    color: rgba(245, 190, 26, 0.8);  /* amarelo a 80% */
}
.rv-login-btn {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: linear-gradient(135deg, #1F7A8C 0%, #2A9DA6 100%);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
}
.rv-login-btn:active { transform: scale(0.95); }
.rv-login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Footer fixo no rodapé, ambas as fases */
.rv-login-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

/* prefers-reduced-motion: pula animações mas mantém visibilidade */
@media (prefers-reduced-motion: reduce) {
    .rv-hero-logo-anim,
    .rv-hero-brand-wrap,
    .rv-hero-hint,
    .rv-login-form {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ═══════════════════════════════════════════════════════
   APP — sidebar + topbar + content (estilo app.final)
   ═══════════════════════════════════════════════════════ */
.rv-admin {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR — spec app.final
   234px expanded · 64px compact · 198px mobile overlay
   navy gradient · sem border-right · cluster centralizado
   ═══════════════════════════════════════════════════════ */
.rv-sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh; height: 100dvh;
    background: linear-gradient(180deg, #1E2B38 0%, #2B3342 100%);
    display: flex; flex-direction: column;
    z-index: 1000;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

/* Cluster centralizado (logo + divisor + menu) ocupa o espaço
   entre o topo e o footer "dmd v2.0" — flex: 1 + justify-center */
.rv-sidebar-cluster {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center;
    justify-content: center;   /* CENTRO vertical */
    padding: 20px 12px;
    gap: 16px;
    min-height: 0;
}

/* Logo top — clicável, com glow turquesa permanente */
.rv-sidebar-brand {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    text-decoration: none;
    flex-shrink: 0;
}
.rv-sidebar-brand-img {
    width: 153px; height: auto; max-height: 153px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(23,163,156,0.35));
    transition: width 0.25s ease, opacity 0.2s ease;
}

/* Divisor — linha sutil branco/10 logo abaixo da logo */
.rv-sidebar-divider {
    width: 60%;
    height: 1px;
    background: rgba(255,255,255,0.10);
    flex-shrink: 0;
}

/* Nav: lista vertical centralizada */
.rv-sidebar-nav {
    width: 100%;
    display: flex; flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    /* scrollbar discreta */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.rv-sidebar-nav::-webkit-scrollbar { width: 4px; }
.rv-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.rv-nav-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
}
.rv-nav-icon {
    display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; flex-shrink: 0;
}
.rv-nav-icon svg { width: 18px; height: 18px; }
.rv-nav-label {
    flex: 1; overflow: hidden; text-overflow: ellipsis;
    transition: opacity 0.15s;
}

.rv-nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

/* Active: bg-brand/20 + 2px stripe lateral inset */
.rv-nav-item.active {
    color: white;
    background: rgba(23,163,156,0.20);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--brand);
}
.rv-nav-item.active .rv-nav-icon { color: var(--brand); }

/* Badge vermelha com glow */
.rv-nav-badge {
    min-width: 20px; height: 20px;
    padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    font-size: 10px; font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(239,68,68,0.55);
    flex-shrink: 0;
}

/* Footer dmd v2.0 — sem borda, centralizado, branco/25 */
.rv-sidebar-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 12px 14px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: lowercase;
    color: rgba(255,255,255,0.25);
    user-select: none;
}
.rv-sidebar-footer span { opacity: 0.7; }

/* ── COMPACT MODE (desktop) ── */
.rv-sidebar-compact .rv-sidebar { width: var(--sidebar-compact); }
.rv-sidebar-compact .rv-sidebar-cluster { padding: 16px 8px; gap: 14px; }
.rv-sidebar-compact .rv-sidebar-brand-img { width: 40px; max-height: 40px; }
.rv-sidebar-compact .rv-sidebar-divider { width: 70%; }
.rv-sidebar-compact .rv-nav-item {
    justify-content: center;
    padding: 11px 0;
    gap: 0;
}
.rv-sidebar-compact .rv-nav-label { display: none; }
.rv-sidebar-compact .rv-nav-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    font-size: 9px;
}
.rv-sidebar-compact .rv-sidebar-footer { font-size: 9px; letter-spacing: 0.5px; }
.rv-sidebar-compact .rv-sidebar-footer span { display: none; }

/* Overlay (mobile) */
.rv-sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55); z-index: 999;
    opacity: 0; transition: opacity 0.25s;
}
.rv-sidebar-overlay.active { display: block; opacity: 1; }

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT + TOPBAR
   ═══════════════════════════════════════════════════════ */
.rv-main-content {
    flex: 1; margin-left: var(--sidebar-width);
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    transition: margin-left var(--transition);
}
.rv-sidebar-compact .rv-main-content { margin-left: var(--sidebar-compact); }

.rv-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 12px;
    height: var(--topbar-height);
    padding: 0 16px;
    background: white;
    border-bottom: 1px solid var(--light-border);
}
.rv-hamburger {
    background: none; border: none; color: var(--text);
    cursor: pointer; padding: 8px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.rv-hamburger svg { width: 22px; height: 22px; }
.rv-hamburger:hover { background: var(--light-bg); }
.rv-hamburger:active { background: var(--light-border); }

.rv-topbar-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px; font-weight: 700; color: var(--text);
}
.rv-topbar-spacer { flex: 1; }

.rv-topbar-actions {
    display: flex; align-items: center; gap: 6px;
}
.rv-topbar-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
}
.rv-topbar-btn svg { width: 18px; height: 18px; }
.rv-topbar-btn:hover {
    background: var(--light-bg);
    color: var(--brand);
    border-color: var(--light-border);
}
.rv-topbar-btn-danger:hover {
    background: rgba(239,68,68,0.08);
    color: var(--danger);
    border-color: rgba(239,68,68,0.2);
}

.rv-topbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 100px;
    border: 1px solid var(--light-border);
    text-decoration: none;
    transition: all 0.15s;
    background: white;
}
.rv-topbar-user:hover {
    background: var(--brand-lt);
    border-color: var(--brand);
}
.rv-topbar-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dk) 100%);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
    flex-shrink: 0;
}
.rv-topbar-userinfo {
    display: flex; flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}
.rv-topbar-username {
    color: var(--text); font-size: 12.5px; font-weight: 700;
    max-width: 140px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rv-topbar-userrole {
    color: var(--text-muted); font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600;
}

.rv-page-container { flex: 1; padding: 24px; overflow-y: auto; }
.rv-page-content { max-width: 1200px; margin: 0 auto; }
.rv-section-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 20px;
}

/* KPI cards (dashboard) */
.rv-kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.rv-kpi-card {
    background: var(--light-card); border: 1px solid var(--light-border);
    border-radius: var(--radius); padding: 20px;
    display: flex; flex-direction: column; gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.rv-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rv-kpi-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.rv-kpi-value {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 26px; font-weight: 800; color: var(--brand);
    line-height: 1;
}
.rv-kpi-value.positive { color: var(--verde); }
.rv-kpi-value.negative { color: var(--vermelho); }
.rv-kpi-sub { font-size: 12px; color: var(--text-light); }

/* Card / Table */
.rv-card {
    background: var(--light-card); border: 1px solid var(--light-border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.rv-card-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.rv-card-subtitle {
    margin: -10px 0 16px;
    color: var(--text-muted); font-size: 13px;
}

.rv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .rv-grid-2 { grid-template-columns: 1fr; } }

.rv-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rv-data-table, .rv-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: white;
}
.rv-data-table th, .rv-table th {
    text-align: left; padding: 10px 12px;
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--light-border); white-space: nowrap;
    background: var(--light-bg);
}
.rv-data-table td, .rv-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--light-border);
    color: var(--text); vertical-align: middle;
}
.rv-data-table tr:last-child td, .rv-table tr:last-child td { border-bottom: none; }
.rv-data-table tr:hover td, .rv-table tr:hover td { background: var(--light-bg); }
.rv-table img.rv-thumb {
    width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block;
}
.rv-table-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 14px; }
.rv-table-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Badges */
.rv-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
    background: var(--light-bg); color: var(--text-muted);
}
.rv-badge-success { background: rgba(39,174,96,0.1); color: var(--verde); }
.rv-badge-warn    { background: rgba(245,190,26,0.18); color: var(--ambar); }
.rv-badge-info    { background: rgba(23,163,156,0.1); color: var(--brand); }

/* Buttons */
.rv-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 18px;
    font: inherit; font-size: 13px; font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #1F7A8C 0%, #2A9DA6 100%);
    border: none; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.rv-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(23, 163, 156, 0.25);
    color: white;
}
.rv-btn:active { transform: scale(0.98); }
.rv-btn-sm { padding: 6px 12px; font-size: 11px; }
.rv-btn-ghost {
    background: white;
    color: var(--brand);
    border: 1px solid var(--light-border);
    text-transform: none; letter-spacing: 0;
    font-weight: 600;
}
.rv-btn-ghost:hover {
    background: var(--brand-lt);
    color: var(--brand-dk);
    border-color: var(--brand);
    box-shadow: none;
}
.rv-btn-danger {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
}
.rv-btn-danger:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(239,68,68,0.3); }
.rv-btn-link {
    background: transparent; color: var(--brand);
    border: none; padding: 6px 10px;
    text-transform: none; letter-spacing: 0; font-weight: 600;
    cursor: pointer;
}
.rv-btn-link:hover { background: var(--brand-lt); color: var(--brand-dk); box-shadow: none; }

/* Form inputs (light style — diferente do login dark) */
.rv-form-row { margin-bottom: 14px; }
.rv-form-row label {
    display: block;
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.rv-form-row input[type=text],
.rv-form-row input[type=email],
.rv-form-row input[type=tel],
.rv-form-row input[type=url],
.rv-form-row input[type=number],
.rv-form-row input[type=password],
.rv-form-row textarea,
.rv-form-row select {
    width: 100%; padding: 11px 14px;
    font: inherit; font-size: 14px;
    background: white;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rv-form-row textarea {
    min-height: 80px; resize: vertical; font-family: inherit;
}
.rv-form-row input:focus,
.rv-form-row textarea:focus,
.rv-form-row select:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23,163,156,0.15);
}
.rv-form-row .rv-hint {
    margin-top: 4px;
    font-size: 12px; color: var(--text-muted);
}

/* Toast */
.rv-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--text);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
}
.rv-toast-success { background: var(--verde); }
.rv-toast-error { background: var(--vermelho); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile — sidebar vira overlay 198px com backdrop, justify-start */
@media (max-width: 900px) {
    .rv-sidebar {
        width: var(--sidebar-mobile);
        transform: translateX(-100%);
    }
    .rv-sidebar.open { transform: translateX(0); }
    .rv-sidebar-cluster {
        justify-content: flex-start;     /* mobile: justify-start (não centraliza) */
        padding-top: 24px;
    }
    /* Mobile: esconde logo no topo do sidebar */
    .rv-sidebar-brand,
    .rv-sidebar-divider { display: none; }

    .rv-main-content { margin-left: 0 !important; }
    .rv-sidebar-compact .rv-main-content { margin-left: 0 !important; }
    .rv-sidebar-compact .rv-sidebar { width: var(--sidebar-mobile); }
    .rv-sidebar-compact .rv-nav-item { justify-content: flex-start; padding: 10px 14px; gap: 12px; }
    .rv-sidebar-compact .rv-nav-label { display: block; }

    .rv-page-container { padding: 16px; }
    .rv-topbar { padding: 0 12px; gap: 8px; }
    .rv-topbar-title { font-size: 15px; }
    .rv-topbar-userinfo { display: none; }   /* só avatar no mobile */
    .rv-topbar-user { padding: 4px; border-radius: 50%; }
    .rv-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .rv-kpi-card { padding: 14px; }
    .rv-kpi-value { font-size: 20px; }
    .rv-section-title { font-size: 18px; }
    .rv-grid-2 { grid-template-columns: 1fr; }
}
