/**
 * WooHUB Design System v2 — tokens, layout, botões, dark mode
 * Paleta: teal + slate (substitui azul AdminLTE #4e73df)
 */

:root {
    /* Marca */
    --wh-primary: #0d9488;
    --wh-primary-hover: #0f766e;
    --wh-primary-light: #14b8a6;
    --wh-primary-soft: rgba(13, 148, 136, 0.12);
    --wh-primary-ring: rgba(13, 148, 136, 0.35);

    /* Semânticas */
    --wh-success: #10b981;
    --wh-success-dark: #059669;
    --wh-warning: #f59e0b;
    --wh-warning-dark: #d97706;
    --wh-danger: #ef4444;
    --wh-danger-dark: #dc2626;
    --wh-info: #6366f1;
    --wh-info-dark: #4f46e5;

    /* Superfícies — light */
    --wh-page-bg: #f1f5f9;
    --wh-card-bg: #ffffff;
    --wh-card-border: #e2e8f0;
    --wh-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --wh-navbar-bg: #ffffff;
    --wh-sidebar-bg: #0f172a;
    --wh-sidebar-hover: #1e293b;
    --wh-sidebar-active: rgba(13, 148, 136, 0.18);
    --wh-sidebar-text: #94a3b8;
    --wh-sidebar-text-active: #f8fafc;
    --wh-footer-bg: #ffffff;

    /* Texto */
    --wh-text: #0f172a;
    --wh-text-muted: #64748b;
    --wh-text-subtle: #94a3b8;

    /* Formulários */
    --wh-input-bg: #ffffff;
    --wh-input-border: #cbd5e1;
    --wh-input-focus: var(--wh-primary);

    /* Radius & tipo */
    --wh-radius-sm: 0.375rem;
    --wh-radius: 0.625rem;
    --wh-radius-lg: 0.875rem;
    --wh-radius-xl: 1rem;
    --wh-font: 'Inter', ui-sans-serif, system-ui, sans-serif;

    /* AdminLTE overrides */
    --primary: var(--wh-primary);
    --blue: var(--wh-primary);
}

html.dark-mode,
body.dark-mode {
    --wh-page-bg: #0f172a;
    --wh-card-bg: #1e293b;
    --wh-card-border: #334155;
    --wh-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --wh-navbar-bg: #1e293b;
    --wh-sidebar-bg: #020617;
    --wh-sidebar-hover: #0f172a;
    --wh-footer-bg: #1e293b;
    --wh-text: #f1f5f9;
    --wh-text-muted: #94a3b8;
    --wh-text-subtle: #64748b;
    --wh-input-bg: #0f172a;
    --wh-input-border: #475569;
    --wh-primary-soft: rgba(20, 184, 166, 0.15);
}

/* ── Base ── */
body {
    font-family: var(--wh-font) !important;
    background-color: var(--wh-page-bg) !important;
    color: var(--wh-text);
}

.content-wrapper {
    background-color: var(--wh-page-bg) !important;
}

.content-wrapper > .content {
    padding-top: 0.75rem !important;
}

.main-footer {
    background: var(--wh-footer-bg) !important;
    border-top: 1px solid var(--wh-card-border) !important;
    color: var(--wh-text-muted) !important;
}

/* Skip link */
.wh-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 99999;
    padding: 0.5rem 1rem;
    background: var(--wh-primary);
    color: #fff;
    border-radius: var(--wh-radius);
}
.wh-skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

/* ── Navbar ── */
.main-header.navbar {
    background: var(--wh-navbar-bg) !important;
    border-bottom: 1px solid var(--wh-card-border) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.main-header .nav-link {
    color: var(--wh-text-muted) !important;
}

.main-header .nav-link:hover {
    color: var(--wh-primary) !important;
}

body.dark-mode .main-header.navbar.navbar-white .nav-link,
body.dark-mode .main-header.navbar.navbar-light .nav-link {
    color: var(--wh-text-muted) !important;
}

/* ── Sidebar ── */
.main-sidebar.wh-sidebar,
.main-sidebar.sidebar-dark-primary {
    background: var(--wh-sidebar-bg) !important;
}

.wh-sidebar .brand-link {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
    padding: 1rem 0.65rem !important;
}

.wh-sidebar .wh-sidebar-brand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.wh-sidebar .wh-brand-logo__img--sidebar {
    height: 82px;
    width: auto;
    max-width: calc(100% - 0.5rem);
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(2, 6, 23, 0.35));
}

.wh-sidebar .brand-text {
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.02em;
    color: #f8fafc !important;
}

.wh-sidebar .brand-text b {
    color: var(--wh-primary-light) !important;
    font-weight: 800 !important;
}

.wh-sidebar .sidebar {
    padding-top: 0.25rem !important;
    padding-bottom: 0.5rem !important;
}

.wh-sidebar .nav-sidebar > .nav-item {
    margin-bottom: 0 !important;
}

.wh-sidebar .nav-sidebar .nav-link {
    color: var(--wh-sidebar-text) !important;
    border-radius: var(--wh-radius-sm) !important;
    margin: 0 0.45rem !important;
    padding: 0.32rem 0.55rem !important;
    width: calc(100% - 0.9rem) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.wh-sidebar .nav-sidebar .nav-link p {
    margin: 0 !important;
    line-height: 1.25 !important;
    font-size: inherit !important;
}

.wh-sidebar .nav-sidebar .nav-link .nav-icon {
    color: inherit !important;
    opacity: 0.85;
    font-size: 0.9rem !important;
    width: 1.35rem !important;
    margin-right: 0.3rem !important;
    text-align: center;
}

.wh-sidebar .nav-sidebar .nav-link:hover {
    background: var(--wh-sidebar-hover) !important;
    color: #e2e8f0 !important;
}

.wh-sidebar .nav-sidebar .nav-link.active {
    background: var(--wh-sidebar-active) !important;
    color: var(--wh-sidebar-text-active) !important;
    box-shadow: inset 3px 0 0 var(--wh-primary-light);
}

.wh-sidebar .nav-header {
    color: #64748b !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 0.45rem 0.85rem 0.15rem !important;
    margin-top: 0.1rem !important;
}

.wh-sidebar .nav-sidebar > .nav-item:first-child .nav-header,
.wh-sidebar .nav-header:first-child {
    padding-top: 0.25rem !important;
    margin-top: 0 !important;
}

.wh-sidebar .nav-item.mt-3,
.wh-sidebar .nav-item.mt-2 {
    margin-top: 0.35rem !important;
}

.wh-sidebar .nav-sidebar .badge,
.wh-sidebar .nav-sidebar .right.badge {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.35rem !important;
    margin-top: 0 !important;
}

.wh-sidebar .nav-link.text-danger {
    color: #f87171 !important;
}

.wh-sidebar .nav-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

/* ── Navbar + context capsule ── */
.wh-topbar {
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    gap: 0.25rem;
}

.wh-navbar-context {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    margin: 0 0.5rem;
}

/* ── Context banner (cápsula na navbar) ── */
.wh-context-banner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    color: #e2e8f0;
}

.wh-context-banner--navbar {
    padding: 0.38rem 1rem;
    min-height: 2.15rem;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #0f172a 0%,
        #1e293b 28%,
        #134e4a 58%,
        #0f766e 82%,
        #0d9488 100%
    );
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
}

html.dark-mode .wh-context-banner--navbar {
    background: linear-gradient(
        90deg,
        #020617 0%,
        #0f172a 25%,
        #115e59 55%,
        #0f766e 78%,
        #14b8a6 100%
    );
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.wh-context-banner__trail {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wh-context-banner__crumb {
    color: rgba(226, 232, 240, 0.72);
    flex-shrink: 0;
}

.wh-context-banner__crumb--current {
    color: #f8fafc;
    font-weight: 700;
}

.wh-context-banner__sep {
    color: rgba(148, 163, 184, 0.65);
    font-weight: 400;
    flex-shrink: 0;
}

.wh-context-banner__meta {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.78);
    white-space: nowrap;
    flex-shrink: 0;
}

.wh-context-banner__end {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 0;
}

.wh-context-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.wh-context-banner--navbar .wh-chip {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(248, 250, 252, 0.9);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.wh-context-banner--navbar .wh-chip:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.wh-context-banner--navbar .wh-chip.is-active {
    background: #fff;
    border-color: #fff;
    color: var(--wh-primary-hover);
}

/* ── User menu (navbar) ── */
.wh-user-menu-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.55rem !important;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.wh-user-menu-trigger:hover,
.wh-user-menu.show .wh-user-menu-trigger {
    background: var(--wh-primary-soft) !important;
}

.wh-user-menu-trigger-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--wh-text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-user-menu-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    background: linear-gradient(145deg, #ffffff, #ecfeff);
    color: var(--wh-primary-hover);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(13, 148, 136, 0.22);
}

.wh-user-menu-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 0.6875rem;
}

.wh-user-menu-avatar--lg {
    width: 56px;
    height: 56px;
    font-size: 1rem;
}

.wh-user-menu-dropdown {
    min-width: 320px;
    max-width: calc(100vw - 1.5rem);
    padding: 0 !important;
    margin-top: 0.55rem !important;
    border: 1px solid var(--wh-card-border) !important;
    border-radius: var(--wh-radius-xl) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06) !important;
    overflow: hidden;
}

.wh-user-menu-header {
    position: relative;
    padding: 1.15rem 1.15rem 1rem;
    background: linear-gradient(
        135deg,
        #0f172a 0%,
        #134e4a 42%,
        #0f766e 72%,
        #14b8a6 100%
    );
}

.wh-user-menu-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.14), transparent 45%);
    pointer-events: none;
}

.wh-user-menu-profile {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.wh-user-menu-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wh-user-menu-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-user-menu-company {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-user-menu-role {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 0.2rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ccfbf1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.wh-user-menu-actions {
    padding: 0.45rem;
    background: var(--wh-card-bg);
}

.wh-user-menu-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--wh-radius-lg);
    text-decoration: none !important;
    color: var(--wh-text) !important;
    transition: background 0.15s ease, transform 0.15s ease;
}

.wh-user-menu-action:hover {
    background: var(--wh-primary-soft);
    transform: translateX(2px);
}

.wh-user-menu-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
    color: var(--wh-primary);
    font-size: 0.9375rem;
}

.wh-user-menu-action--support .wh-user-menu-action-icon {
    background: #dcfce7;
    color: #16a34a;
}

.wh-user-menu-action-text {
    flex: 1;
    min-width: 0;
}

.wh-user-menu-action-text strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.wh-user-menu-action-text small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.6875rem;
    color: var(--wh-text-muted);
}

.wh-user-menu-action-arrow {
    font-size: 0.625rem;
    color: var(--wh-text-subtle);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.wh-user-menu-action:hover .wh-user-menu-action-arrow {
    opacity: 1;
    transform: translateX(0);
}

.wh-user-menu-footer {
    padding: 0.65rem 0.85rem 0.85rem;
    background: var(--wh-card-bg);
    border-top: 1px solid var(--wh-card-border);
}

.wh-user-menu-logout {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wh-user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark-mode .wh-user-menu-action-icon {
    background: #0f172a;
}

body.dark-mode .wh-user-menu-action--support .wh-user-menu-action-icon {
    background: rgba(22, 163, 74, 0.15);
}

body.dark-mode .wh-user-menu-avatar {
    background: linear-gradient(145deg, #f8fafc, #ccfbf1);
}

@media (max-width: 767px) {
    .wh-user-menu-dropdown {
        min-width: 280px;
    }
}

.wh-context-banner__meta strong {
    color: #f8fafc;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .wh-context-banner__meta {
        display: none;
    }

    .wh-context-banner__actions {
        overflow-x: auto;
        max-width: min(100%, 280px);
        scrollbar-width: none;
    }

    .wh-context-banner__actions::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .wh-navbar-context {
        margin: 0 0.25rem;
    }

    .wh-context-banner--navbar {
        padding: 0.32rem 0.75rem;
    }

    .wh-context-banner__trail {
        font-size: 0.75rem;
    }
}

/* ── Page header ── */
.wh-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wh-page-head h1,
.wh-page-head .wh-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--wh-text);
    margin: 0;
    line-height: 1.3;
}

.wh-page-head .wh-page-sub {
    font-size: 0.8125rem;
    color: var(--wh-text-muted);
    margin-top: 0.2rem;
}

/* ── Cards ── */
.wh-card {
    background: var(--wh-card-bg);
    border: 1px solid var(--wh-card-border);
    border-radius: var(--wh-radius-lg);
    box-shadow: var(--wh-card-shadow);
}

.wh-card .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--wh-card-border) !important;
    padding: 0.85rem 1.1rem !important;
}

.wh-card .card-body {
    padding: 1rem 1.1rem !important;
}

.card.card-primary.card-outline,
.card.card-outline {
    border-radius: var(--wh-radius-lg) !important;
    border-color: var(--wh-card-border) !important;
    box-shadow: var(--wh-card-shadow) !important;
}

.card-primary.card-outline .card-header {
    border-bottom-color: var(--wh-card-border) !important;
}

/* ── Botões WooHUB (.wh-btn) ── */
.wh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: var(--wh-font);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.45rem 0.95rem;
    border-radius: var(--wh-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    text-decoration: none !important;
    white-space: nowrap;
}

.wh-btn:hover {
    transform: translateY(-1px);
    text-decoration: none !important;
}

.wh-btn:disabled,
.wh-btn.disabled {
    opacity: 0.55;
    pointer-events: none;
    transform: none;
}

.wh-btn-sm {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

.wh-btn-lg {
    font-size: 0.875rem;
    padding: 0.55rem 1.15rem;
}

.wh-btn-primary {
    background: linear-gradient(135deg, var(--wh-primary-light), var(--wh-primary));
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.wh-btn-primary:hover {
    background: linear-gradient(135deg, var(--wh-primary), var(--wh-primary-hover));
    color: #fff !important;
}

.wh-btn-success {
    background: linear-gradient(135deg, #34d399, var(--wh-success));
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.wh-btn-warning {
    background: linear-gradient(135deg, #fcd34d, var(--wh-warning));
    color: #422006 !important;
}

.wh-btn-danger {
    background: linear-gradient(135deg, #f87171, var(--wh-danger));
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.wh-btn-secondary,
.wh-btn-ghost {
    background: var(--wh-card-bg);
    color: var(--wh-text-muted) !important;
    border-color: var(--wh-card-border);
}

.wh-btn-secondary:hover,
.wh-btn-ghost:hover {
    background: var(--wh-page-bg);
    color: var(--wh-text) !important;
    border-color: var(--wh-input-border);
}

.wh-btn-return {
    background: linear-gradient(135deg, #ecfdf5, #ccfbf1);
    color: var(--wh-primary-hover) !important;
    border: 1px solid #5eead4;
    box-shadow: 0 1px 4px rgba(13, 148, 136, 0.14);
}

.wh-btn-return:hover {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #115e59 !important;
    border-color: var(--wh-primary-light);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.22);
}

html.dark-mode .wh-btn-return {
    background: rgba(13, 148, 136, 0.2);
    color: #5eead4 !important;
    border-color: rgba(94, 234, 212, 0.45);
    box-shadow: none;
}

html.dark-mode .wh-btn-return:hover {
    background: rgba(13, 148, 136, 0.32);
    color: #99f6e4 !important;
    border-color: #5eead4;
}

/* AdminLTE / Bootstrap overrides */
.btn-primary {
    background: linear-gradient(135deg, var(--wh-primary-light), var(--wh-primary)) !important;
    border-color: var(--wh-primary) !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--wh-primary-hover) !important;
    border-color: var(--wh-primary-hover) !important;
}

.btn-success {
    background: linear-gradient(135deg, #34d399, var(--wh-success)) !important;
    border-color: var(--wh-success) !important;
}

.btn-info {
    background: linear-gradient(135deg, #818cf8, var(--wh-info)) !important;
    border-color: var(--wh-info) !important;
}

.btn-outline-primary {
    color: var(--wh-primary) !important;
    border-color: var(--wh-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--wh-primary-soft) !important;
    color: var(--wh-primary-hover) !important;
}

.bg-primary,
.user-header.bg-primary {
    background: linear-gradient(135deg, #134e4a, var(--wh-primary)) !important;
}

.badge-primary,
.badge-info {
    background-color: var(--wh-primary) !important;
}

.text-primary {
    color: var(--wh-primary) !important;
}

a {
    color: var(--wh-primary);
}

a:hover {
    color: var(--wh-primary-hover);
}

/* ── Pills / badges status ── */
.wh-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wh-pill--success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.wh-pill--warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.wh-pill--danger  { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.wh-pill--info    { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }
.wh-pill--neutral { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.wh-pill--primary { background: var(--wh-primary-soft); color: var(--wh-primary-hover); }

html.dark-mode .wh-pill--success { color: #6ee7b7; }
html.dark-mode .wh-pill--warning { color: #fcd34d; }
html.dark-mode .wh-pill--danger  { color: #fca5a5; }

/* ── KPI / widgets (global) ── */
.wh-kpi {
    background: var(--wh-card-bg);
    border: 1px solid var(--wh-card-border);
    border-radius: var(--wh-radius-lg);
    padding: 1rem 1.1rem;
    box-shadow: var(--wh-card-shadow);
    position: relative;
    overflow: hidden;
}

.wh-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--wh-kpi-accent, var(--wh-primary));
}

.wh-kpi-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wh-text-muted);
}

.wh-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--wh-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    margin-top: 0.15rem;
}

/* ── Forms ── */
.form-control {
    border-radius: var(--wh-radius) !important;
    border-color: var(--wh-input-border) !important;
    background: var(--wh-input-bg) !important;
    color: var(--wh-text) !important;
    font-size: 0.875rem !important;
}

.form-control:focus {
    border-color: var(--wh-input-focus) !important;
    box-shadow: 0 0 0 3px var(--wh-primary-ring) !important;
}

/* ── Bootstrap modals ── */
.modal-content {
    border: 1px solid var(--wh-card-border) !important;
    border-radius: var(--wh-radius-xl) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
    background: var(--wh-card-bg) !important;
    color: var(--wh-text) !important;
}

.modal-header {
    border-bottom-color: var(--wh-card-border) !important;
    background: var(--wh-page-bg) !important;
    border-radius: var(--wh-radius-xl) var(--wh-radius-xl) 0 0 !important;
}

.modal-footer {
    border-top-color: var(--wh-card-border) !important;
    background: var(--wh-page-bg) !important;
}

.modal-title {
    font-weight: 700 !important;
    font-size: 1.05rem !important;
}

/* ── Tables / DataTables ── */
.table {
    color: var(--wh-text) !important;
}

.table thead th {
    font-size: 0.6875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--wh-text-muted) !important;
    border-bottom-color: var(--wh-card-border) !important;
}

.table-hover tbody tr:hover {
    background: var(--wh-primary-soft) !important;
}

/* ── Processing modal WooHUB ── */
.wh-processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    pointer-events: none;
}

.wh-processing-overlay.is-visible {
    display: flex;
    pointer-events: auto;
}

.wh-processing-overlay__scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.14);
    pointer-events: none;
}

.wh-processing-overlay__panel {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        #0f172a 0%,
        #134e4a 18%,
        #0d9488 42%,
        #ecfdf5 78%,
        #ffffff 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 20px;
    padding: 1.65rem 2rem 1.45rem;
    min-width: min(100%, 252px);
    max-width: 280px;
    text-align: center;
    box-shadow:
        0 22px 50px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(13, 148, 136, 0.12);
    transform: scale(0.9) translateY(14px);
    opacity: 0;
    transition:
        transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
        opacity 0.28s ease;
}

.wh-processing-overlay.is-visible .wh-processing-overlay__panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.wh-processing-overlay__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 38%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 62%
    );
    transform: translateX(-120%);
    animation: wh-processing-shine 2.8s ease-in-out infinite;
    pointer-events: none;
}

.wh-processing-overlay__glow {
    position: absolute;
    top: -24px;
    left: 50%;
    width: 90px;
    height: 90px;
    margin-left: -45px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.wh-processing-loader {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
}

.wh-processing-loader__orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(255, 255, 255, 0.85);
    animation: wh-spin 1s linear infinite;
}

.wh-processing-loader__dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
    animation: wh-processing-orbit 1.35s linear infinite;
}

.wh-processing-loader__dot:nth-child(2) {
    animation-delay: -0.45s;
    opacity: 0.75;
    width: 6px;
    height: 6px;
    margin: -3px;
}

.wh-processing-loader__dot:nth-child(3) {
    animation-delay: -0.9s;
    opacity: 0.5;
    width: 5px;
    height: 5px;
    margin: -2.5px;
}

.wh-processing-loader__core {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wh-processing-loader__mark {
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.88;
    filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.32));
    animation: wh-processing-mark-breathe 2.6s ease-in-out infinite;
}

@keyframes wh-processing-mark-breathe {
    0%, 100% { opacity: 0.82; transform: scale(1); }
    50% { opacity: 0.96; transform: scale(1.04); }
}

.wh-processing-overlay__title {
    position: relative;
    z-index: 1;
    font-size: 0.975rem;
    font-weight: 800;
    color: #134e4a;
    line-height: 1.35;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wh-processing-overlay__dots span {
    opacity: 0;
    animation: wh-processing-dot 1.2s ease-in-out infinite;
}

.wh-processing-overlay__dots span:nth-child(1) { animation-delay: 0s; }
.wh-processing-overlay__dots span:nth-child(2) { animation-delay: 0.15s; }
.wh-processing-overlay__dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wh-processing-dot {
    0%, 20%, 100% { opacity: 0; }
    40%, 80% { opacity: 1; }
}

@keyframes wh-processing-orbit {
    from { transform: rotate(0deg) translateX(28px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(28px) rotate(-360deg); }
}

@keyframes wh-processing-shine {
    0%, 72%, 100% { transform: translateX(-120%); }
    38% { transform: translateX(120%); }
}

html.dark-mode .wh-processing-overlay__scrim,
body.dark-mode .wh-processing-overlay__scrim {
    background: rgba(2, 6, 23, 0.45);
}

html.dark-mode .wh-processing-overlay__panel,
body.dark-mode .wh-processing-overlay__panel {
    background: linear-gradient(
        180deg,
        #020617 0%,
        #0f766e 22%,
        #115e59 48%,
        #1e293b 100%
    );
    border-color: rgba(45, 212, 191, 0.25);
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(45, 212, 191, 0.1);
}

html.dark-mode .wh-processing-overlay__title,
body.dark-mode .wh-processing-overlay__title {
    color: #ecfdf5;
}

html.dark-mode .wh-processing-loader__mark,
body.dark-mode .wh-processing-loader__mark {
    opacity: 0.85;
    filter: drop-shadow(0 0 5px rgba(94, 234, 212, 0.22));
}

/* DataTables — modal WooHUB em vez do box padrão */
.dataTables_wrapper .dataTables_processing {
    display: none !important;
}

@keyframes wh-spin {
    to { transform: rotate(360deg); }
}

/* ── Dark mode — AdminLTE legacy ── */
body.dark-mode .card,
body.dark-mode .info-box,
body.dark-mode .wh-card {
    background: var(--wh-card-bg) !important;
    color: var(--wh-text) !important;
}

body.dark-mode .main-footer,
body.dark-mode .content-wrapper {
    background-color: var(--wh-page-bg) !important;
}

body.dark-mode .dropdown-menu {
    background: var(--wh-card-bg) !important;
    border-color: var(--wh-card-border) !important;
}

body.dark-mode .dropdown-item {
    color: var(--wh-text) !important;
}

body.dark-mode .dropdown-item:hover {
    background: var(--wh-sidebar-hover) !important;
}

body.dark-mode .table {
    color: var(--wh-text) !important;
}

body.dark-mode .bg-light {
    background-color: var(--wh-sidebar-hover) !important;
}

body.dark-mode .text-muted {
    color: var(--wh-text-muted) !important;
}

body.dark-mode .main-sidebar {
    background: var(--wh-sidebar-bg) !important;
}

/* Money display */
.wh-money {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-variant-numeric: tabular-nums;
}

.wh-money__currency {
    font-size: 0.72em;
    font-weight: 600;
    opacity: 0.85;
}

.wh-money__amount {
    font-weight: 600;
}

/* ── Filter chips (Analytics, Notificações, etc.) ── */
.wh-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--wh-card-border);
    background: var(--wh-card-bg);
    color: var(--wh-text-muted);
    text-decoration: none !important;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.wh-chip:hover {
    border-color: var(--wh-primary);
    color: var(--wh-primary);
    text-decoration: none !important;
}

.wh-chip.is-active {
    background: var(--wh-primary);
    border-color: var(--wh-primary);
    color: #fff !important;
}

/* Hero gradients (substituem bg-w-total / bg-custom-total) */
.wh-hero-primary {
    background: linear-gradient(135deg, var(--wh-primary-light) 0%, var(--wh-primary) 55%, var(--wh-primary-hover) 100%);
    color: #fff;
}

.wh-icon-primary {
    background: linear-gradient(135deg, var(--wh-primary-light), var(--wh-primary)) !important;
}
