/* Tema: Verde (marca WA) — paleta oficial do SaaS */
:root {
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: var(--font-sans);

    /* Backgrounds */
    --bg-base: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-elevated: #ffffff;
    --bg-hover: #E8F5EC;
    --bg-active: rgba(46, 204, 113, 0.18);

    /* Texto neutro */
    --text-primary: #1C1C1C;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-inverse: #ffffff;

    /* Bordas */
    --border: #E5E7EB;
    --border-strong: #D1D5DB;
    --divider: #E5E7EB;

    /* Acento — verde principal (botões) com hover verde médio */
    --accent: #1E7A45;
    --accent-hover: #2ECC71;
    --accent-soft: rgba(30, 122, 69, 0.14);
    --on-accent: #ffffff;

    --grad-brand: linear-gradient(135deg, #0F3D2E 0%, #1E7A45 50%, #2ECC71 100%);

    --shadow-sm: 0 1px 2px rgba(15, 61, 46, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 61, 46, 0.10);
    --shadow-lg: 0 20px 60px rgba(15, 61, 46, 0.16);
    --shadow-window: 0 30px 80px rgba(15, 61, 46, 0.22), 0 0 0 0.5px rgba(15, 61, 46, 0.10);

    --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
    --blur: blur(20px) saturate(170%);
}

/* ===== Sidebar verde escura (topbar do sistema) ===== */
[data-theme="verde"] body {
    background:
        radial-gradient(circle at 0% 0%, rgba(46, 204, 113, 0.08), transparent 50%),
        var(--bg-base);
}
/* Variáveis de sidebar dark — derivadas da cor da marca quando branding aplica.
   Quando ainda não foi aplicado nenhum branding, usa os defaults verdes oficiais. */
:root {
    --sidebar-bg: #0F3D2E;
    --sidebar-active: #2ECC71;
    --sidebar-active-shadow: rgba(46, 204, 113, 0.4);
    --sidebar-icon-hover: #7ED957;
}

[data-theme="verde"] .ui-sidebar {
    background: var(--sidebar-bg);
    border-right-color: rgba(255, 255, 255, 0.06);
    backdrop-filter: none;
}
[data-theme="verde"] .ui-sidebar-label { color: rgba(255, 255, 255, 0.45); }
[data-theme="verde"] .ui-sidebar-item { color: rgba(255, 255, 255, 0.86); }
[data-theme="verde"] .ui-sidebar-item i { color: rgba(255, 255, 255, 0.55); }
[data-theme="verde"] .ui-sidebar-item:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
[data-theme="verde"] .ui-sidebar-item:hover i { color: var(--sidebar-icon-hover); }
[data-theme="verde"] .ui-sidebar-item.active {
    background: var(--sidebar-active); color: #ffffff;
    box-shadow: 0 4px 12px var(--sidebar-active-shadow);
}
[data-theme="verde"] .ui-sidebar-item.active i { color: #ffffff; }
[data-theme="verde"] .sidebar-brand { border-bottom-color: rgba(255, 255, 255, 0.10); }
[data-theme="verde"] .sidebar-brand .name { color: #ffffff; }
[data-theme="verde"] .sidebar-brand .name small { color: rgba(255, 255, 255, 0.5); }

/* Sidebar colapsado: mantém as mesmas cores do estado expandido */
[data-theme="verde"] body[data-sidebar="collapsed"] .ui-sidebar .ui-sidebar-item i { color: rgba(255, 255, 255, 0.86); }
[data-theme="verde"] body[data-sidebar="collapsed"] .ui-sidebar .ui-sidebar-item:hover i { color: var(--sidebar-icon-hover); }
[data-theme="verde"] body[data-sidebar="collapsed"] .ui-sidebar .ui-sidebar-item.active i { color: #ffffff; }
[data-theme="verde"] body[data-sidebar="collapsed"] .ui-sidebar .ui-sidebar-item.active {
    background: var(--sidebar-active);
    box-shadow: 0 4px 12px var(--sidebar-active-shadow);
}
[data-theme="verde"] body[data-sidebar="collapsed"] .ui-sidebar .ui-sidebar-item:hover { background: rgba(255, 255, 255, 0.08); }

/* ===== Top bar mobile (mesma cor da sidebar) ===== */
[data-theme="verde"] .app-mobile-top {
    background: var(--sidebar-bg); color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.10);
}
[data-theme="verde"] .app-mobile-top .title { color: #ffffff; }
[data-theme="verde"] .app-mobile-top .top-action { background: rgba(255, 255, 255, 0.10); color: #ffffff; }
[data-theme="verde"] .app-mobile-top .top-action:hover { background: rgba(255, 255, 255, 0.18); }

/* ===== Botão primário ===== */
[data-theme="verde"] .ui-btn-primary {
    background: var(--accent); color: var(--on-accent);
    box-shadow: 0 1px 2px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
}
[data-theme="verde"] .ui-btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }

/* ===== Bottom nav mobile ===== */
[data-theme="verde"] .app-mobile-nav-item.active { color: #1E7A45; }
[data-theme="verde"] .app-mobile-nav-item.active i { color: #2ECC71; }

/* ===== Cards e inputs com sutileza verde ===== */
[data-theme="verde"] .ui-card { border-color: var(--border); }
[data-theme="verde"] .ui-input:focus,
[data-theme="verde"] .ui-textarea:focus,
[data-theme="verde"] .ui-select:focus {
    border-color: #1E7A45;
    box-shadow: 0 0 0 3px rgba(30, 122, 69, 0.18);
}

/* ===== Badge accent ===== */
[data-theme="verde"] .ui-badge.accent { background: #1E7A45; color: #ffffff; }
[data-theme="verde"] .ui-badge.green { background: #2ECC71; }
