/* Dark mode overrides (auto via prefers-color-scheme: dark) */
:root {
    color-scheme: dark;

    /* Overrides dos design tokens compartilhados */
    --ds-bg: #0f1115;
    --ds-surface: #151a1f;
    --ds-border: #1f252d;
    --ds-border-strong: #2a333d;
    --ds-text: #e6e6e6;
    --ds-text-muted: #9aa4b2;
    --ds-text-subtle: #6b7280;
    --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ds-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    --ds-shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
    --ds-shadow-brand: 0 18px 40px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--ds-bg) !important;
    color: var(--ds-text);
}

/* ─── Backgrounds ──────────────────────────────────────────────────────── */
.bg-light            { background-color: #1a1f27 !important; }
.bg-white            { background-color: #151a1f !important; }
.bg-body,
.bg-body-tertiary,
.bg-body-secondary   { background-color: #0f1115 !important; }
.bg-secondary-subtle { background-color: #1e2430 !important; color: #a0acb8 !important; }

/* ─── Text ─────────────────────────────────────────────────────────────── */
.text-dark      { color: #e6e6e6 !important; }
.text-muted     { color: #9aa4b2 !important; }
.text-secondary { color: #a0acb8 !important; }

/* ─── Borders ──────────────────────────────────────────────────────────── */
.border,
.border-top,
.border-bottom,
.border-start,
.border-end          { border-color: #242b33 !important; }
.border-light,
.border-light-subtle { border-color: #1f252d !important; }
hr                   { border-color: #242b33 !important; opacity: 0.6; }

/* ─── Cards ────────────────────────────────────────────────────────────── */
.card,
.modal-content,
.list-group-item {
    background-color: #151a1f !important;
    background-image: none !important;
    color: #e6e6e6;
    border-color: #242b33 !important;
}
.card-header,
.card-footer {
    background-color: #14181e !important;
    background-image: none !important;
    border-color: #242b33 !important;
}
/* Strip inline gradients/backgrounds on cards */
.card[style],
.card-body[style],
.card-header[style],
.card-footer[style] { background: #151a1f !important; }

/* ─── Navbar (generic) ─────────────────────────────────────────────────── */
.navbar,
.navbar.bg-white {
    background-color: #11151a !important;
    border-color: #242b33 !important;
}
.navbar .nav-link              { color: #cbd5e1 !important; }
.navbar .nav-link.active,
.navbar .nav-link:hover        { color: #ffffff !important; }
.navbar-toggler                { border-color: #2a333d !important; }
.navbar-toggler-icon           { filter: invert(0.7); }

/* ─── Admin UI ─────────────────────────────────────────────────────────── */
body.admin-ui {
    background: #0f1115 !important;
    color: #cbd5e1 !important;
}

.admin-ui .admin-navbar,
.admin-ui .admin-navbar.bg-white {
    background: #11151a !important;
    border-bottom: 1px solid #1e252d !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35) !important;
}

.admin-ui .admin-brand    { color: #4ade9f !important; }

.admin-ui .admin-nav-link {
    color: #9ab0c8 !important;
}
.admin-ui .admin-nav-link:hover {
    color: #e2eaf6 !important;
    background: #1c2430 !important;
}
.admin-ui .admin-nav-link.active {
    color: #82b8f5 !important;
    background: #172035 !important;
    box-shadow: inset 0 0 0 1px #1e3558 !important;
}

.admin-ui .admin-search .input-group-text,
.admin-ui .admin-search .form-control {
    background: #151a22 !important;
    border-color: #242d38 !important;
    color: #cbd5e1 !important;
}
.admin-ui .admin-search .form-control:focus {
    background: #1a2130 !important;
    border-color: #2d4a70 !important;
}

.admin-ui .admin-user-avatar {
    background: linear-gradient(145deg, #1a2840 0%, #1e3050 100%) !important;
    border: 1px solid #2d4668 !important;
    color: #82b8f5 !important;
}

.admin-ui .admin-dropdown-menu {
    background: #151a1f !important;
    border: 1px solid #242b33 !important;
    box-shadow: 0 16px 36px rgba(0,0,0,0.5) !important;
}
.admin-ui .admin-dropdown-menu .dropdown-item {
    color: #cbd5e1 !important;
}
.admin-ui .admin-dropdown-menu .dropdown-item:hover {
    background: #1a2230 !important;
    color: #82b8f5 !important;
}

.admin-ui .admin-page-head {
    background: #151a1f !important;
    border: 1px solid #242b33 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}
.admin-ui .admin-module-title { color: #cbd5e1 !important; }

.admin-ui .admin-module-icon {
    background: linear-gradient(140deg, #1a2840 0%, #1e3050 100%) !important;
    border: 1px solid #1e3558 !important;
    color: #82b8f5 !important;
    box-shadow: none !important;
}

.admin-ui .admin-btn-primary {
    background: linear-gradient(135deg, #2563b8 0%, #1a4d9c 100%) !important;
}
.admin-ui .admin-btn-soft {
    background: #1a1f28 !important;
    border-color: #2a333d !important;
    color: #a0b0c8 !important;
}

.admin-ui .card {
    border: 1px solid #1e252d !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3) !important;
}
.admin-ui .table > :not(caption) > * > * {
    border-bottom-color: #1e252d !important;
}
.admin-ui .table thead th { color: #7a8fa8 !important; }

/* Mobile search collapse */
#mobileSearch {
    background: #11151a !important;
    border-color: #1e252d !important;
}

/* ─── Site client UI ───────────────────────────────────────────────────── */
.client-bottom-nav {
    background: rgba(15, 20, 28, 0.92) !important;
    border: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow-lg) !important;
}
.client-bottom-nav .nav-link        { color: var(--ds-text-muted) !important; }
.client-bottom-nav .nav-link.active { color: #4ade9f !important; background: rgba(74, 222, 159, 0.12) !important; }
.client-bottom-nav .nav-link.active i { color: #4ade9f !important; }

.client-soft-card {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    box-shadow: var(--ds-shadow) !important;
}
.client-soft-card:hover {
    border-color: var(--ds-border-strong) !important;
    box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.5) !important;
}

.client-round-icon {
    background: rgba(74, 222, 159, 0.12) !important;
    color: #4ade9f !important;
}

/* ─── Site home hero (versão clean) ──────────────────────────────────── */
.client-home-hero {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text) !important;
}
.client-home-hero .client-hero-value,
.client-home-hero .client-hero-name { color: var(--ds-text) !important; }
.client-home-hero .client-hero-kicker,
.client-home-hero .client-hero-subtitle { color: var(--ds-text-muted) !important; }

.client-icon-btn {
    background: #0f141a !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text-muted) !important;
}
.client-icon-btn:hover {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border-strong) !important;
    color: var(--ds-text) !important;
}
.client-icon-btn--brand {
    background: #1a4535 !important;
    border-color: transparent !important;
    color: #fff !important;
}
.client-icon-btn--brand:hover { background: #1f5a44 !important; }

.client-hero-note {
    background: #0f141a !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text-muted) !important;
}

.client-hero-status--open {
    background: rgba(74, 222, 159, 0.1) !important;
    color: #4ade9f !important;
    border-color: rgba(74, 222, 159, 0.25) !important;
}
.client-hero-status--closed {
    background: rgba(242, 167, 176, 0.08) !important;
    color: #f2a7b0 !important;
    border-color: rgba(242, 167, 176, 0.22) !important;
}

/* ─── Site login ───────────────────────────────────────────────────────── */
.site-login-shell { background: var(--ds-bg) !important; }

.site-login-moon,
.site-login-logo {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.site-login-card {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    box-shadow: var(--ds-shadow-lg) !important;
}

.site-login-card-body { background: var(--ds-surface) !important; }

.site-login-label { color: var(--ds-text-muted) !important; }

.site-login-input {
    background: #0f141a !important;
    border-color: var(--ds-border) !important;
}
.site-login-input:focus-within {
    background: #131922 !important;
    border-color: #1a4535 !important;
    box-shadow: 0 0 0 3px rgba(74, 222, 159, 0.15) !important;
}
.site-login-input .input-group-text  { background: transparent !important; color: #4ade9f !important; }
.site-login-input .form-control      { background: transparent !important; color: var(--ds-text) !important; }
.site-login-input .form-control:focus{ background: transparent !important; }

.site-login-submit { background: #1a4535 !important; color: #fff !important; }
.site-login-submit:hover { background: #1f5a44 !important; }

.site-login-full-submit {
    background: linear-gradient(135deg, #1a8055 0%, #1a4535 100%) !important;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5) !important;
}

.site-login-action {
    background: #1a1f28 !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text) !important;
}
.site-login-action:hover {
    background: #1f2530 !important;
    border-color: var(--ds-border-strong) !important;
}
.site-login-action span {
    background: rgba(74, 222, 159, 0.12) !important;
    color: #4ade9f !important;
}

.site-login-footer {
    background: #12161d !important;
    border-top-color: var(--ds-border) !important;
}

.site-login-contact {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text-muted) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.site-login-contact:hover {
    border-color: var(--ds-border-strong) !important;
    color: var(--ds-text) !important;
}

.site-login-seals {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    box-shadow: var(--ds-shadow) !important;
}
.site-login-seals img { background: transparent !important; }

/* ─── Dropdowns ────────────────────────────────────────────────────────── */
.dropdown-menu {
    background-color: #151a1f !important;
    border-color: #242b33 !important;
}
.dropdown-item                       { color: #e6e6e6 !important; }
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    background-color: #1f252d !important;
    color: #ffffff !important;
}
.dropdown-divider { border-color: #242b33 !important; }

/* ─── Tables ───────────────────────────────────────────────────────────── */
.table {
    color: #e6e6e6;
    --bs-table-bg: #151a1f;
    --bs-table-color: #e6e6e6;
    --bs-table-striped-bg: #1b2128;
    --bs-table-striped-color: #e6e6e6;
    --bs-table-hover-bg: #1e252e;
    --bs-table-hover-color: #ffffff;
    --bs-table-border-color: #242b33;
}
.table thead.bg-light,
.table thead {
    background-color: #1a2028 !important;
    color: #cbd5e1;
}
.table-hover tbody tr:hover { background-color: #1e252e !important; }

/* ─── Forms ────────────────────────────────────────────────────────────── */
.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    background-color: #0f141a !important;
    color: #e6e6e6 !important;
    border-color: #24303a !important;
    box-shadow: none !important;
}
.form-control::placeholder { color: #8b97a6 !important; }
.form-floating > label     { color: #8b97a6 !important; }
.form-check-input {
    background-color: #1a1f28 !important;
    border-color: #3a4552 !important;
}
.form-check-input:checked {
    background-color: #2563b8 !important;
    border-color: #2563b8 !important;
}
.form-label { color: #9aa4b2 !important; }
.input-group-text {
    background-color: #0f141a !important;
    color: #cbd5e1 !important;
    border-color: #24303a !important;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn-light {
    background-color: #1f252d !important;
    color: #e6e6e6 !important;
    border-color: #2a333d !important;
}
.btn-light:hover {
    background-color: #222a33 !important;
    color: #ffffff !important;
}
.btn-outline-secondary {
    color: #9aa4b2 !important;
    border-color: #3a4552 !important;
}
.btn-outline-secondary:hover {
    background-color: #222a33 !important;
    color: #ffffff !important;
}
.btn-outline-primary {
    color: #82b8f5 !important;
    border-color: #2d4a70 !important;
}
.btn-outline-primary:hover {
    background-color: #1a2840 !important;
    color: #ffffff !important;
}
.btn-outline-success {
    color: #4ade9f !important;
    border-color: #1a4535 !important;
}
.btn-outline-success:hover {
    background-color: #103322 !important;
    color: #ffffff !important;
}
.btn-outline-danger {
    color: #f2a7b0 !important;
    border-color: #5a2028 !important;
}
.btn-outline-danger:hover {
    background-color: #3b161a !important;
    color: #ffffff !important;
}
.btn-outline-warning {
    color: #f4d58d !important;
    border-color: #5a3d10 !important;
}
.btn-outline-warning:hover {
    background-color: #3a2b10 !important;
    color: #ffffff !important;
}

/* ─── Badges ───────────────────────────────────────────────────────────── */
.badge.bg-light {
    background-color: #1e252e !important;
    color: #e6e6e6 !important;
    border-color: #2a333d !important;
}
.bg-success-subtle { background-color: #103322 !important; color: #9be7c4 !important; }
.bg-warning-subtle { background-color: #3a2b10 !important; color: #f4d58d !important; }
.bg-danger-subtle  { background-color: #3b161a !important; color: #f2a7b0 !important; }
.bg-info-subtle    { background-color: #102a3a !important; color: #9cc7f0 !important; }
.bg-primary-subtle { background-color: #1b2a4a !important; color: #b3c7f6 !important; }

/* ─── Alerts ───────────────────────────────────────────────────────────── */
.alert {
    background-color: #1f252d !important;
    color: #e6e6e6 !important;
    border-color: #2a333d !important;
}
.alert-success {
    background-color: #0d2b1e !important;
    border-color: #1a4535 !important;
    color: #9be7c4 !important;
}
.alert-warning {
    background-color: #2e2210 !important;
    border-color: #5a3d10 !important;
    color: #f4d58d !important;
}
.alert-danger {
    background-color: #2e1016 !important;
    border-color: #5a2028 !important;
    color: #f2a7b0 !important;
}
.alert-info {
    background-color: #0d2030 !important;
    border-color: #1a3d58 !important;
    color: #9cc7f0 !important;
}
.alert .btn-close { filter: invert(0.8); }

/* ─── Pagination ───────────────────────────────────────────────────────── */
.page-link {
    background-color: #151a1f !important;
    color: #cbd5e1 !important;
    border-color: #2a333d !important;
}
.page-item.active .page-link {
    background-color: #2563b8 !important;
    border-color: #2563b8 !important;
    color: #ffffff !important;
}
.page-item.disabled .page-link { color: #4a5568 !important; }

/* ─── Modals ───────────────────────────────────────────────────────────── */
.modal-header,
.modal-footer { border-color: #242b33 !important; }
.modal-backdrop { background-color: #000000 !important; }

/* ─── Offcanvas ────────────────────────────────────────────────────────── */
.offcanvas,
.offcanvas-start,
.offcanvas-end,
.offcanvas-top,
.offcanvas-bottom {
    background-color: #151a1f !important;
    color: #e6e6e6 !important;
    border-color: #242b33 !important;
}
.offcanvas-header { border-color: #242b33 !important; }
.btn-close        { filter: invert(0.8); }

/* ─── Misc ─────────────────────────────────────────────────────────────── */
.shadow-sm,
.shadow { box-shadow: 0 6px 18px rgba(0,0,0,0.35) !important; }

.input-premium:focus {
    background-color: #0f141a !important;
    outline: 2px solid #2a333d !important;
}

/* ─── Imagens & logos em dark mode ────────────────────────────────────── */

/*
 * Classes utilitárias — adicione a qualquer <img> para testar:
 *
 *   img-dk-invert      inversion total  (ótimo para logos P&B em fundo transparente)
 *   img-dk-white       força branco puro (logos monocromáticas em fundo transparente)
 *   img-dk-hue         inverte + corrige matiz (logos coloridas — reduz distorção)
 *   img-dk-dim         escurece 25 % (fotos que parecem estouradas)
 *   img-dk-none        desativa qualquer filtro do dark mode para aquela imagem
 */
.img-dk-invert { filter: invert(1) !important; }
.img-dk-white  { filter: brightness(0) invert(1) !important; }
.img-dk-hue    { filter: invert(1) hue-rotate(180deg) !important; }
.img-dk-dim    { filter: brightness(0.75) contrast(1.05) !important; }
.img-dk-none   { filter: none !important; }

/* Posições de logo conhecidas — ajuste a classe de acordo com o resultado visual */

/* Logo principal (login page) */
.site-login-logo img {
    filter: invert(1) hue-rotate(180deg);
}

/* Selos de certificação */
.site-login-seals img {
    filter: invert(0.85) hue-rotate(180deg);
}

/* Selos na página inicial (hero) */
.client-home-hero img,
.partner-home-hero img,
.client-full-hero img {
    filter: none; /* fotos/selos dentro do hero já têm fundo verde — não inverter */
}

/* Imagens de produto: reduz brilho levemente para não destoar do fundo escuro */
.card-img-top,
img.product-img {
    filter: brightness(0.9) contrast(1.02);
}

/* Logo no rodapé ou header do site (se existir como <img>) */
.navbar-brand img {
    filter: invert(1) hue-rotate(180deg);
}
