/* Tokens :root vêm de hypergestor-design-system.css (CRM). */

.hg-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--hg-font-sans);
    color: var(--hg-foreground);
    background: var(--hg-background);
}

.hg-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    background: var(--hg-background);
}

.hg-sidebar {
    --hg-sidebar-width: 17rem;
    --hg-sidebar-width-collapsed: 4.25rem;
    width: var(--hg-sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--hg-sidebar-border);
    background: var(--hg-sidebar);
    color: var(--hg-sidebar-foreground);
    transition: width 0.2s ease;
    overflow: visible;
    position: relative;
    z-index: 25;
}

.hg-sidebar.is-collapsed {
    width: var(--hg-sidebar-width-collapsed);
}

.hg-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--hg-sidebar-border);
    min-height: 4.25rem;
    overflow: hidden;
}

.hg-sidebar-brand-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 0 1 auto;
    border-radius: var(--hg-radius-sm);
    padding: 0.15rem 0.25rem;
}

.hg-sidebar-brand-link:hover {
    background: transparent;
}

.hg-sidebar-brand-logo {
    display: block;
    height: 2.5rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.hg-sidebar-brand-logo--icon {
    display: none;
    height: 1.85rem;
    width: auto;
    max-width: none;
    flex-shrink: 0;
}

.hg-sidebar-toggle {
    position: absolute;
    top: 1.35rem;
    right: 0;
    transform: translateX(50%);
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border: 1px solid rgb(255 255 255 / 0.4);
    border-radius: 9999px;
    background: var(--hg-sidebar);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.28);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hg-sidebar-toggle:hover,
.hg-sidebar-toggle:focus-visible {
    background: color-mix(in srgb, var(--hg-sidebar) 85%, white);
    border-color: rgb(255 255 255 / 0.65);
    color: #fff;
}

.hg-sidebar.is-collapsed .hg-sidebar-brand {
    justify-content: center;
    padding: 1rem 0.5rem;
    overflow: visible;
}

.hg-sidebar.is-collapsed .hg-sidebar-brand-link {
    flex: 0 0 auto;
    justify-content: center;
    width: auto;
    max-width: 100%;
    padding: 0.25rem;
}

.hg-sidebar.is-collapsed .hg-sidebar-brand-logo--full {
    display: none !important;
}

.hg-sidebar.is-collapsed .hg-sidebar-brand-logo--icon {
    display: block !important;
    height: 1.85rem;
    width: auto;
    max-width: none;
}

.hg-sidebar.is-collapsed .hg-nav-link span,
.hg-sidebar.is-collapsed .hg-nav-group-label,
.hg-sidebar.is-collapsed .hg-nav-chevron,
.hg-sidebar.is-collapsed .hg-sidebar-footer-version {
    display: none;
}

.hg-sidebar.is-collapsed .hg-nav {
    padding-inline: 0.5rem;
    align-items: stretch;
    overflow: visible;
}

.hg-sidebar.is-collapsed .hg-nav-link-top,
.hg-sidebar.is-collapsed .hg-nav-group-btn,
.hg-sidebar.is-collapsed .hg-nav-sub-link,
.hg-sidebar.is-collapsed .hg-nav-collapsed-link {
    justify-content: center;
    padding-inline: 0.5rem;
    gap: 0;
}

.hg-sidebar.is-collapsed .hg-sidebar-footer {
    padding: 0.5rem;
}

.hg-nav-collapsed {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    margin-top: 0.25rem;
}

.hg-nav-collapsed-link {
    position: relative;
}

/* Tooltip do menu recolhido */
.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip] {
    position: relative;
}

.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%) translateX(-0.15rem);
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
    z-index: 80;
}

.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(100% + 0.4rem);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #111827;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 81;
}

.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:hover::after,
.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:focus-visible::after,
.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:hover::before,
.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:hover::after,
.hg-sidebar.is-collapsed .hg-nav-link[data-tooltip]:focus-visible::after {
    transform: translateY(-50%) translateX(0);
}

.hg-sidebar > .hg-nav,
.hg-sidebar > .hg-sidebar-footer {
    overflow-x: hidden;
}

.hg-sidebar-brand-icon {
    border-radius: var(--hg-radius-sm);
    background: var(--hg-sidebar-accent-strong);
    padding: 0.375rem;
    color: var(--hg-sidebar-primary);
}

.hg-sidebar-brand-text {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--hg-sidebar-foreground);
}

.hg-nav {
    flex: 1;
    padding: 0.875rem 0.625rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hg-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}

.hg-nav-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.5625rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: hsl(0 0% 100% / 0.88);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.hg-nav-group-btn > svg:first-child {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: hsl(0 0% 100% / 0.75);
}

.hg-nav-group-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    color: inherit;
}

.hg-nav-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: hsl(0 0% 100% / 0.45);
}

.hg-nav-group-btn:hover,
.hg-nav-group-btn:focus-visible,
.hg-nav-group-btn:active,
.hg-nav-link:hover,
.hg-nav-link:focus-visible,
.hg-nav-link:active {
    background: hsl(0 0% 100% / 0.1);
    color: #fff;
}

.hg-nav-group-btn:hover > svg:first-child,
.hg-nav-group-btn:hover .hg-nav-chevron,
.hg-nav-link-top:hover svg {
    color: #fff;
}

.hg-nav-sub {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    margin: 0;
    /* Recuo leve sob o grupo + respiro vertical */
    padding: 0.25rem 0.25rem 0.375rem 0.875rem;
    border-left: none;
}

.hg-nav-link {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: hsl(0 0% 100% / 0.82);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Subitens com ícone + texto completo */
.hg-nav-sub-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: hsl(0 0% 100% / 0.72);
    padding: 0.5rem 0.75rem;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.hg-nav-sub-link > span {
    flex: 1;
    min-width: 0;
}

.hg-nav-sub-link > svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: hsl(0 0% 100% / 0.55);
}

.hg-nav-sub-link:hover,
.hg-nav-sub-link:focus-visible,
.hg-nav-sub-link:active {
    color: #fff;
    background: hsl(0 0% 100% / 0.14);
}

.hg-nav-sub-link:hover > svg,
.hg-nav-sub-link:focus-visible > svg,
.hg-nav-sub-link:active > svg {
    color: #fff;
}

.hg-nav-sub-link.is-active > svg,
.hg-nav-sub-link.is-active:hover > svg {
    color: var(--hg-sidebar-primary);
}

.hg-nav-link-top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.125rem;
    padding: 0.5625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.hg-nav-link-top svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: hsl(0 0% 100% / 0.75);
}

.hg-nav-link.is-active,
.hg-nav-link.is-active:hover,
.hg-nav-link.is-active:focus-visible,
.hg-nav-link.is-active:active,
.hg-nav-sub-link.is-active,
.hg-nav-sub-link.is-active:hover {
    background: hsl(var(--hg-hsl-brand) / 0.18);
    color: var(--hg-sidebar-primary);
    font-weight: 600;
}

.hg-nav-link.is-active svg,
.hg-nav-link-top.is-active svg {
    color: var(--hg-sidebar-primary);
}

.hg-sidebar-footer {
    border-top: 1px solid var(--hg-sidebar-border);
    padding: 0.75rem;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hg-sidebar-footer-version {
    color: #FFF;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

.hg-app a:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--hg-primary) 55%, transparent);
    outline-offset: 2px;
}

.hg-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hg-main-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    position: relative;
    z-index: 1;
    background: var(--hg-background);
}

.hg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-card);
    position: sticky;
    top: 0;
    z-index: 20;
}

/*
 * Overlay/drawer vivem dentro de .hg-main-content (irmão do .hg-topbar).
 * Com z-index no topbar, o header fica sempre por cima da modal.
 * Solução: ao abrir overlay, o conteúdo sobe e o topbar desce no stacking.
 */
body:has(.hg-drawer-overlay) .hg-topbar,
body:has(.hg-sheet-root) .hg-topbar,
body:has(.hg-modal-overlay) .hg-topbar,
body:has(.hg-whatsapp-fullscreen) .hg-topbar,
.hg-app:has(.hg-drawer-overlay) .hg-topbar,
.hg-app:has(.hg-sheet-root) .hg-topbar,
.hg-app:has(.hg-modal-overlay) .hg-topbar,
.hg-app:has(.hg-whatsapp-fullscreen) .hg-topbar {
    z-index: 0 !important;
}

body:has(.hg-drawer-overlay) .hg-main-content,
body:has(.hg-sheet-root) .hg-main-content,
body:has(.hg-modal-overlay) .hg-main-content,
body:has(.hg-whatsapp-fullscreen) .hg-main-content,
.hg-app:has(.hg-drawer-overlay) .hg-main-content,
.hg-app:has(.hg-sheet-root) .hg-main-content,
.hg-app:has(.hg-modal-overlay) .hg-main-content,
.hg-app:has(.hg-whatsapp-fullscreen) .hg-main-content {
    z-index: 40 !important;
}

.hg-topbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 28rem;
    min-width: 0;
    position: relative;
}

.hg-topbar-search-label {
    display: flex;
    color: var(--hg-muted-foreground);
    flex-shrink: 0;
}

.hg-topbar-search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.hg-topbar-search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: var(--hg-muted);
    box-shadow: none;
    padding-right: 2rem;
}

.hg-topbar-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--hg-primary) 25%, transparent);
}

.hg-topbar-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--hg-muted-foreground);
    cursor: pointer;
}

.hg-topbar-search-clear:hover {
    background: color-mix(in srgb, var(--hg-muted-foreground) 12%, transparent);
    color: var(--hg-foreground);
}

.hg-topbar-search-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    min-width: min(28rem, calc(100vw - 2rem));
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-card);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.12);
    z-index: 40;
    overflow: hidden;
}

.hg-topbar-search-panel.is-loading {
    opacity: 0.85;
}

.hg-topbar-search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hg-foreground);
}

.hg-topbar-search-panel-hint {
    font-weight: 500;
    color: var(--hg-muted-foreground);
}

.hg-topbar-search-empty {
    padding: 1rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
}

.hg-topbar-search-list {
    list-style: none;
    margin: 0;
    padding: 0.375rem;
    max-height: 20rem;
    overflow-y: auto;
}

.hg-topbar-search-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: none;
    background: transparent;
    border-radius: calc(var(--hg-radius) - 4px);
    padding: 0.625rem 0.625rem;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.hg-topbar-search-item:hover,
.hg-topbar-search-item:focus-visible {
    background: var(--hg-muted);
    outline: none;
}

.hg-topbar-search-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.hg-topbar-search-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hg-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-topbar-search-item-sub {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-topbar-search-item-badge {
    flex-shrink: 0;
}

.hg-topbar-search-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border: none;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 50%, transparent);
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--hg-primary);
    cursor: pointer;
}

.hg-topbar-search-footer:hover {
    background: color-mix(in srgb, var(--hg-primary) 8%, transparent);
}

.hg-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hg-topbar-dropdown {
    position: relative;
}

.hg-topbar-icon-btn,
.hg-topbar-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--hg-foreground);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.hg-topbar-icon-btn {
    padding: 0.5rem;
}

.hg-topbar-icon-btn:hover,
.hg-topbar-user-btn:hover {
    background: var(--hg-muted);
    border-color: var(--hg-border);
}

.hg-topbar-user-btn {
    padding: 0.375rem 0.5rem 0.375rem 0.375rem;
    max-width: 16rem;
}

.hg-topbar-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
}

.hg-topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}

.hg-topbar-user-email,
.hg-topbar-user-meta {
    font-size: 0.6875rem;
    color: var(--hg-muted-foreground);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}

.hg-topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-primary) 15%, transparent);
    color: var(--hg-primary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hg-topbar-avatar-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.hg-topbar-panel {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    width: min(20rem, calc(100vw - 2rem));
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-card);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
    padding: 0.75rem;
    z-index: 30;
}

.hg-topbar-panel-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hg-topbar-panel-empty {
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    padding: 0.5rem 0;
}

.hg-topbar-user-panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--hg-border);
}

.hg-topbar-logout-form {
    margin: 0;
}

.hg-topbar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--hg-destructive);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.hg-topbar-logout-btn:hover {
    background: color-mix(in srgb, var(--hg-destructive) 8%, transparent);
}

.hg-topbar-logout-form--inline {
    display: none;
}

.hg-topbar-logout-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    color: var(--hg-foreground);
}

.hg-topbar-logout-inline:hover {
    background: var(--hg-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 900px) {
    .hg-topbar-logout-form--inline {
        display: block;
    }

    .hg-topbar-user-panel .hg-topbar-logout-form {
        display: none;
    }
}

@media (max-width: 640px) {
    .hg-topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .hg-topbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .hg-topbar-user-text {
        display: none;
    }
}

.hg-page {
    margin: 0 auto;
    max-width: 1600px;
    padding: 1.5rem;
}

.hg-page--dashboard {
    padding-bottom: 0.75rem;
}

.hg-page-stack > * + * {
    margin-top: 1rem;
}

.hg-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.hg-page-header-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.hg-page-icon {
    border-radius: var(--hg-radius);
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    padding: 0.625rem;
    color: var(--hg-primary);
}

.hg-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hg-page-subtitle {
    margin-top: 0.125rem;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
}

.hg-card {
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
}

.hg-card-padded {
    padding: 1rem 1.25rem;
}

.hg-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.hg-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hg-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-input,
.hg-select {
    height: 2.25rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-input);
    background: var(--hg-card);
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: var(--hg-foreground);
}

.hg-input:focus,
.hg-select:focus {
    outline: 2px solid color-mix(in srgb, var(--hg-primary) 30%, transparent);
    outline-offset: 1px;
}

.hg-input-date {
    width: 10rem;
}

.hg-input-search {
    width: 100%;
    min-width: 220px;
}

.hg-select {
    min-width: 15rem;
}

.hg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.25rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: var(--hg-foreground);
    cursor: pointer;
}

.hg-btn:hover,
.hg-btn:focus,
.hg-btn:focus-visible,
.hg-btn:active {
    background: var(--hg-muted);
    color: var(--hg-foreground);
}

.hg-btn-primary,
.hg-btn-primary:hover,
.hg-btn-primary:focus,
.hg-btn-primary:focus-visible,
.hg-btn-primary:active,
.hg-btn.hg-btn-primary,
.hg-btn.hg-btn-primary:hover,
.hg-btn.hg-btn-primary:focus,
.hg-btn.hg-btn-primary:focus-visible,
.hg-btn.hg-btn-primary:active {
    background: var(--hg-primary) !important;
    border-color: var(--hg-primary) !important;
    color: var(--hg-primary-foreground) !important;
    color: #ffffff !important;
    filter: none !important;
}

.hg-btn-primary:hover,
.hg-btn-primary:focus,
.hg-btn-primary:focus-visible,
.hg-btn-primary:active,
.hg-btn.hg-btn-primary:hover,
.hg-btn.hg-btn-primary:focus,
.hg-btn.hg-btn-primary:focus-visible,
.hg-btn.hg-btn-primary:active {
    background: var(--hg-primary-hover) !important;
    border-color: var(--hg-primary-hover) !important;
    color: #ffffff !important;
}

.hg-btn-icon {
    width: 2.25rem;
    padding: 0;
}

.hg-btn-sm {
    height: 1.75rem;
    padding: 0 0.5rem;
    font-size: 0.75rem;
}

.hg-tabs {
    display: inline-flex;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    padding: 0.125rem;
    background: var(--hg-muted);
}

.hg-tab {
    border: none;
    background: transparent;
    border-radius: calc(var(--hg-radius) - 4px);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
    cursor: pointer;
}

.hg-tab.is-active {
    background: var(--hg-card);
    color: var(--hg-foreground);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.hg-totalizers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .hg-totalizers {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .hg-totalizers {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* 7 cards numa linha só (Eventos no modo LINX, que tem Retornos a mais).
   Modificador em vez de mudar a base: a view mock de Eventos também usa
   .hg-totalizers e tem 6 cards. */
@media (min-width: 1024px) {
    .hg-totalizers--7 {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

.hg-totalizer {
    position: relative;
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.hg-totalizer:hover {
    background: color-mix(in oklch, var(--hg-muted) 40%, transparent);
}

.hg-totalizer.is-active {
    border-color: color-mix(in oklch, var(--hg-primary) 40%, transparent);
    box-shadow: 0 0 0 2px color-mix(in oklch, var(--hg-primary) 50%, transparent);
}

.hg-totalizer-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ícone de ajuda: fica na ponta direita do cabeçalho do card. O balão é
   absoluto e escapa do card, então .hg-totalizer precisa de position: relative. */
.hg-totalizer-info {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    color: var(--hg-muted-foreground);
    line-height: 0;
}

.hg-totalizer-info:hover {
    color: var(--hg-foreground);
}

.hg-totalizer-tip {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 30;
    width: max-content;
    max-width: 22rem;
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-primary);
    color: #fff;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s;
    pointer-events: none;
}

/* Nos últimos cards o balão sairia da tela pela direita: ancora pela direita. */
.hg-totalizer-tip--fim {
    left: auto;
    right: 0;
}

.hg-totalizer-info:hover .hg-totalizer-tip {
    opacity: 1;
    visibility: visible;
}

.hg-totalizer-count {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
}

.hg-totalizer-label {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-totalizer-meta {
    margin-top: 0.2rem;
    font-size: 0.6875rem;
    color: color-mix(in srgb, var(--hg-muted-foreground) 85%, transparent);
}

.hg-totalizer-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.hg-totalizer-todos .hg-totalizer-dot {
    background: var(--hg-status-bloqueado);
}

.hg-totalizer.is-active {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--hg-primary) 35%, transparent), 0 8px 18px rgb(0 0 0 / 8%);
    transform: translateY(-1px);
}

.hg-status-panel {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: color-mix(in srgb, var(--hg-muted) 42%, transparent);
    padding: 0.625rem 0.75rem;
}

.hg-status-panel__main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.hg-status-panel__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
}

.hg-status-panel__value {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--hg-foreground);
}

.hg-status-panel__count {
    font-size: 0.78rem;
    color: var(--hg-muted-foreground);
}

.hg-status-panel__clear {
    flex-shrink: 0;
}

.hg-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-event-row {
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.hg-event-row-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
}

.hg-event-row-main:hover {
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
}

.hg-event-expand {
    border: none;
    background: transparent;
    color: var(--hg-muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
}

.hg-whatsapp-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: #d1fae5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hg-event-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
}

/* Largura fixa da coluna de status. Sem isso o badge, que é inline-flex sem
   largura, deixa sobras diferentes para o grid conforme o texto ("Agendado" vs
   "Não compareceu") e as 12 colunas caem em x diferente em cada linha. */
.hg-event-status {
    flex: 0 0 8.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Decorativo: marca o canal de contato. Fica FORA do grid para não consumir
   uma das 12 colunas e reintroduzir o desalinhamento. */
.hg-event-whatsapp {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: var(--hg-status-recebido-bg);
    color: var(--hg-status-recebido);
    line-height: 0;
}

.hg-col-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    line-height: 1;
}

.hg-col-value {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-col-span-3 { grid-column: span 3 / span 3; }
.hg-col-span-2 { grid-column: span 2 / span 2; }
.hg-col-span-1 { grid-column: span 1 / span 1; }

.hg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 9999px;
    border: 1px solid;
    padding: 0.26rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
    white-space: nowrap;
}

.hg-badge-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
}

@media (max-width: 900px) {
    .hg-event-status {
        flex: 0 0 7.25rem;
        justify-content: center;
    }

    .hg-badge {
        min-width: 6.5rem;
        padding-inline: 0.55rem;
        font-size: 0.78rem;
    }

    .hg-badge-dot {
        display: none;
    }
}

.hg-event-expanded {
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
    padding: 1rem;
}

.hg-detail-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.hg-detail-sidebar {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .hg-detail-sidebar {
        grid-column: span 2;
    }

    .hg-detail-content {
        grid-column: span 10;
    }
}

.hg-detail-table {
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .hg-detail-table {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.hg-detail-cell {
    padding: 0.75rem;
    border-right: 1px solid var(--hg-border);
    border-bottom: 1px solid var(--hg-border);
}

.hg-detail-cell-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.25rem;
}

.hg-detail-cell-value {
    font-size: 0.875rem;
}

.hg-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hg-empty {
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 4rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
}

.hg-empty p {
    margin: 0;
}

.hg-empty-hint {
    margin-top: 0.5rem !important;
    font-size: 0.8125rem !important;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.hg-empty-action {
    margin-top: 0.75rem;
}

/* Label sem caixa alta — formulários curtos de modal, onde o protótipo usa o
   rótulo em texto normal e não a versão "etiqueta" de filtro. */
.hg-label--plain {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--hg-foreground);
}

.hg-label-optional {
    font-weight: 400;
    color: var(--hg-muted-foreground);
}

.hg-date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-date-range-sep {
    color: var(--hg-muted-foreground);
}

.hg-pagination {
    margin-top: 0.75rem;
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hg-legend {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.hg-legend-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.hg-legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
}

.hg-callout {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid color-mix(in oklch, var(--hg-primary) 30%, transparent);
    background: color-mix(in oklch, var(--hg-primary) 5%, transparent);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.hg-agenda-wrap {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.hg-agenda-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.hg-agenda-table th,
.hg-agenda-table td {
    border-right: 1px solid var(--hg-border);
    border-bottom: 1px solid var(--hg-border);
}

.hg-agenda-consultor {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 16rem;
    background: var(--hg-card);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.hg-agenda-consultor-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-agenda-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
}

.hg-agenda-slot-head {
    min-width: 110px;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, var(--hg-muted) 50%, transparent);
    position: sticky;
    top: 0;
    z-index: 1;
}

.hg-agenda-cell {
    width: 110px;
    height: 76px;
    padding: 0.125rem;
    vertical-align: top;
}

.hg-agenda-card {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--hg-radius) - 4px);
    border: 1px solid;
    padding: 0.25rem 0.375rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.6875rem;
    line-height: 1.3;
}

.hg-agenda-card-placa {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
}

.hg-agenda-block {
    height: 100%;
    border-radius: calc(var(--hg-radius) - 4px);
    border: 1px solid var(--hg-status-bloqueado-border);
    background: var(--hg-status-bloqueado-bg);
    color: var(--hg-status-bloqueado);
    padding: 0.25rem 0.375rem;
}

.hg-callout-split {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .hg-callout-split {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }
}

.hg-callout-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    min-width: 0;
    flex: 1;
}

.hg-callout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.375rem;
    box-sizing: border-box;
    border-radius: 0.375rem;
    background: color-mix(in oklch, var(--hg-primary) 15%, transparent);
    color: var(--hg-primary);
}

.hg-callout-icon svg {
    display: block;
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    flex-shrink: 0;
}

.hg-callout-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    line-height: 1.35;
}

.hg-callout-item strong,
.hg-callout-text strong {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--hg-foreground);
}

.hg-callout-item span,
.hg-callout-text span {
    color: var(--hg-muted-foreground);
    font-size: 0.75rem;
}

.hg-callout-divider {
    display: none;
    width: 1px;
    height: 2rem;
    background: var(--hg-border);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .hg-callout-divider {
        display: block;
    }
}

.hg-agenda-interactive {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-agenda-shell {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    overflow: hidden;
}

.hg-agenda-scroll {
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.hg-agenda-grid {
    min-width: max-content;
}

.hg-agenda-grid-head,
.hg-agenda-grid-row {
    display: flex;
    border-bottom: 1px solid var(--hg-border);
}

.hg-agenda-grid-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--hg-card) 95%, transparent);
    backdrop-filter: blur(6px);
}

.hg-agenda-grid-consultor-head {
    position: sticky;
    left: 0;
    z-index: 30;
    width: 16rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--hg-border);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, var(--hg-card) 95%, transparent);
    white-space: nowrap;
}

.hg-agenda-consultor-head-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    display: block;
}

.hg-agenda-grid-slot-head {
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
}

.hg-agenda-grid-consultor {
    position: sticky;
    left: 0;
    z-index: 10;
    width: 16rem;
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
}

.hg-agenda-grid-cell {
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    padding: 0.125rem;
}

.hg-agenda-grid-cell-empty {
    cursor: cell;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.hg-agenda-grid-cell-empty:hover {
    background: color-mix(in srgb, var(--hg-primary) 5%, transparent);
}

.hg-agenda-grid-cell-empty.is-selected {
    background: color-mix(in srgb, var(--hg-primary) 15%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hg-primary) 50%, transparent);
}

.hg-agenda-grid-cell-empty.is-drop-ok {
    background: color-mix(in srgb, var(--hg-drop-ok) 14%, transparent);
    box-shadow: inset 0 0 0 2px var(--hg-drop-ok);
}

.hg-agenda-grid-cell-empty.is-drop-bad {
    background: color-mix(in srgb, var(--hg-drop-bad) 14%, transparent);
    box-shadow: inset 0 0 0 2px var(--hg-drop-bad);
}

.hg-agenda-card-draggable {
    cursor: grab;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hg-agenda-card-draggable:active {
    cursor: grabbing;
}

.hg-agenda-card-draggable.is-dragging {
    opacity: 0.45;
    box-shadow: 0 0 0 2px var(--hg-primary);
}

.hg-agenda-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
}

.hg-agenda-grip {
    opacity: 0.4;
    font-size: 0.625rem;
    line-height: 1;
}

.hg-agenda-card-owner {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    text-align: left;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s ease;
}

.hg-agenda-card-owner:hover,
.hg-agenda-week-card-owner:hover {
    text-decoration-color: currentColor;
}

.hg-agenda-card-time {
    margin-top: 0.125rem;
    font-size: 0.625rem;
    opacity: 0.7;
}

.hg-agenda-block-indisponivel {
    border-color: var(--hg-border);
    background: var(--hg-status-indisponivel-bg);
    color: var(--hg-status-indisponivel);
}

.hg-agenda-selection-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 10px 40px rgb(0 0 0 / 0.15);
}

.hg-agenda-selection-bar > span {
    padding-right: 0.5rem;
    margin-right: 0.25rem;
    border-right: 1px solid var(--hg-border);
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    white-space: nowrap;
}

[x-cloak] {
    display: none !important;
}

.hg-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: flex-end;
    background: rgb(0 0 0 / 0.8);
    overscroll-behavior: contain;
}

body:has(.hg-drawer-overlay),
html:has(.hg-drawer-overlay),
body:has(.hg-sheet-root),
html:has(.hg-sheet-root) {
    overflow: hidden !important;
}

.hg-atendimento-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--hg-card);
    border-left: 1px solid var(--hg-border);
    box-shadow: -12px 0 40px rgb(0 0 0 / 0.15);
    overflow: hidden;
    pointer-events: auto;
    will-change: transform;
    animation: hg-sheet-slide-in-from-right 500ms ease-in-out both;
}

.hg-sheet-root.is-closing .hg-atendimento-drawer {
    animation: hg-sheet-slide-out-to-right 300ms ease-in-out both;
}

@media (min-width: 768px) {
    .hg-atendimento-drawer {
        width: 85vw;
    }
}

@media (min-width: 1024px) {
    .hg-atendimento-drawer {
        width: 82vw;
    }
}

@media (min-width: 1280px) {
    .hg-atendimento-drawer {
        width: 80vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hg-atendimento-drawer,
    .hg-sheet-root.is-closing .hg-atendimento-drawer {
        animation: none;
    }
}

.hg-drawer-close-fab {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    line-height: 0;
    cursor: pointer;
}

.hg-drawer-close-fab:hover {
    background: var(--hg-border);
    color: var(--hg-foreground);
}

.hg-atendimento-header {
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-card);
    flex-shrink: 0;
    padding: 0;
    position: relative;
}

.hg-atendimento-header-inner {
    padding: 1rem 3.5rem 1rem 1.5rem;
}

.hg-atendimento-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.hg-atendimento-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.5rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
    line-height: 0;
}

.hg-atendimento-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.hg-atendimento-id {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
    background: var(--hg-muted);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.hg-atendimento-header .hg-badge--status {
    border-radius: 0.375rem;
    padding: 0.125rem 0.625rem;
    font-size: 11px;
    font-weight: 600;
    gap: 0;
}

.hg-atendimento-body {
    flex: 1;
    min-height: 0;
    display: flex;
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
}

.hg-atendimento-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

.hg-atendimento-split {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.hg-atendimento-split-whatsapp {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .hg-atendimento-split {
        grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
    }

    .hg-atendimento-split-whatsapp {
        min-height: 0;
    }
}

.hg-atendimento-nav {
    width: 3.5rem;
    flex-shrink: 0;
    border-left: 1px solid var(--hg-border);
    background: var(--hg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0;
    gap: 0.25rem;
}

.hg-atendimento-nav-btn {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--hg-muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-atendimento-nav-btn:hover {
    background: var(--hg-muted);
    color: var(--hg-foreground);
}

.hg-atendimento-nav-btn.is-active {
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
}

.hg-atendimento-nav-btn.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.5rem;
    border-radius: 3px 0 0 3px;
    background: var(--hg-primary);
}

/* Rótulo da seção no hover, à esquerda do ícone (protótipo). Vem do
   data-label do botão: sem markup extra e sem depender do tooltip nativo,
   que aparece atrasado, embaixo do cursor e sem a cor da marca. */
.hg-atendimento-nav-btn::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 0.375rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    padding: 0.3125rem 0.625rem;
    border-radius: 999px;
    background: var(--hg-primary);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease-out;
    pointer-events: none;
}

.hg-atendimento-nav-btn:hover::before,
.hg-atendimento-nav-btn:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .hg-atendimento-nav-btn::before {
        transition: none;
    }
}

.hg-quadrant {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    overflow: hidden;
}

.hg-quadrant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.hg-quadrant-icon,
.hg-solicitacoes-card-icon {
    color: var(--hg-primary);
    flex-shrink: 0;
}

.hg-quadrant-head:has(.hg-quadrant-icon) {
    justify-content: flex-start;
}

/* Ação no cabeçalho do card (ex.: "+" de nova anotação). O head com ícone é
   flex-start para o título colar no ícone, então a ação precisa do empurrão. */
.hg-quadrant-head-action {
    margin-left: auto;
}

.hg-quadrant-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.hg-section-card {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.hg-section-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-section-card-body {
    padding: 0.25rem 1rem;
}

.hg-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.875rem;
}

.hg-field-row:last-child {
    border-bottom: none;
}

.hg-field-row-label {
    color: var(--hg-muted-foreground);
}

.hg-field-row-value {
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-resumo-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

.hg-resumo-agendamento { grid-column: span 12; min-height: 0; }
.hg-resumo-os { grid-column: span 12; min-height: 0; }
.hg-resumo-anotacoes { grid-column: span 12; min-height: 0; }
.hg-resumo-obs { grid-column: span 12; min-height: 0; }

@media (min-width: 1024px) {
    .hg-resumo-agendamento { grid-column: span 7; grid-row: span 1; }
    .hg-resumo-os { grid-column: span 5; grid-row: span 2; }
    .hg-resumo-anotacoes { grid-column: span 4; grid-row: span 1; }
    .hg-resumo-obs { grid-column: span 3; grid-row: span 1; }
}

/* Resumo LINX — Dados 7 + OS 5 rowspan / Observações 7 / Anotação Interna 7 */
.hg-resumo-solicitacoes { grid-column: span 12; min-height: 8rem; overflow: visible; }

@media (min-width: 1024px) {
    .hg-resumo-grid--linx .hg-resumo-agendamento { grid-column: span 7; grid-row: span 1; }
    .hg-resumo-grid--linx .hg-resumo-os { grid-column: span 5; grid-row: span 3; }
    .hg-resumo-grid--linx .hg-resumo-solicitacoes { grid-column: span 7; grid-row: span 1; }
    .hg-resumo-grid--linx .hg-resumo-anotacoes { grid-column: span 7; grid-row: span 1; }
}

.hg-solicitacoes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    min-width: 0;
}

.hg-solicitacoes-erro {
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid color-mix(in srgb, var(--hg-destructive) 40%, transparent);
    background: color-mix(in srgb, var(--hg-destructive) 6%, transparent);
    color: var(--hg-destructive);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.hg-solicitacoes-empty-card {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
}

.hg-solicitacoes-card,
.hg-solicitacoes-add {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: visible;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hg-solicitacoes-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-solicitacoes-card-icon {
    color: var(--hg-primary);
    flex-shrink: 0;
}

.hg-solicitacoes-empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-solicitacoes-rows {
    display: flex;
    flex-direction: column;
}

.hg-solicitacoes-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.875rem;
}

.hg-solicitacoes-row:last-child {
    border-bottom: none;
}

.hg-solicitacoes-row-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-solicitacoes-nro {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.625rem;
    color: var(--hg-muted-foreground);
    margin-right: 0.35rem;
}

.hg-solicitacoes-desc {
    font-weight: 500;
}

.hg-solicitacoes-tipo {
    color: var(--hg-muted-foreground);
}

.hg-solicitacoes-trash {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: calc(var(--hg-radius) - 4px);
    border: 0;
    background: transparent;
    color: var(--hg-muted-foreground);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.hg-solicitacoes-trash:hover {
    background: color-mix(in srgb, var(--hg-destructive) 10%, transparent);
    color: var(--hg-destructive);
}

.hg-solicitacoes-add {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-solicitacoes-add-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-primary);
}

.hg-solicitacoes-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.25rem;
}

.hg-solicitacoes-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hg-solicitacoes-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.hg-solicitacoes-field--grow {
    flex: 1 1 180px;
}

.hg-solicitacoes-field--tipo {
    flex: 0 0 190px;
}

.hg-solicitacoes-field--classif {
    flex: 0 0 180px;
}

.hg-solicitacoes-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}

.hg-whatsapp-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 280px;
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
}

.hg-whatsapp-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hg-whatsapp-expand-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--hg-border);
    border-radius: 0.375rem;
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    cursor: pointer;
}

.hg-whatsapp-expand-btn:hover {
    background: var(--hg-border);
    color: var(--hg-foreground);
}

.hg-whatsapp-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
    flex-shrink: 0;
}

.hg-whatsapp-toolbar--fullscreen {
    border-bottom: 1px solid var(--hg-border);
}

.hg-whatsapp-toolbar-hint-only {
    padding-block: 0.375rem;
}

.hg-whatsapp-toolbar-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
    white-space: nowrap;
}

.hg-whatsapp-modelo-select {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
}

.hg-whatsapp-modelo-list {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-card);
    flex-shrink: 0;
}

.hg-whatsapp-modelo-list--fullscreen {
    flex-wrap: wrap;
    overflow-x: visible;
    max-height: 7rem;
    overflow-y: auto;
}

.hg-whatsapp-modelo-chip {
    border: 1px solid var(--hg-border);
    border-radius: 9999px;
    background: var(--hg-muted);
    color: var(--hg-foreground);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.75rem;
    line-height: 1.2;
    max-width: 16rem;
    overflow: hidden;
    padding: 0.375rem 0.625rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-whatsapp-modelo-chip:hover,
.hg-whatsapp-modelo-chip.is-active {
    border-color: #059669;
    background: color-mix(in srgb, #059669 12%, white);
    color: #047857;
}

.hg-whatsapp-toolbar-hint {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    line-height: 1.35;
}

.hg-whatsapp-modelo-preview {
    flex-shrink: 0;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--hg-border);
    background: #efeae2;
}

.hg-whatsapp-modelo-preview--fullscreen {
    max-height: 8rem;
    overflow: auto;
}

.hg-whatsapp-modelo-preview-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.375rem;
}

.hg-whatsapp-modelo-preview-body {
    font-size: 0.8125rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.hg-whatsapp-modelo-use {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

.hg-whatsapp-modelo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hg-whatsapp-modelo-send {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

.hg-whatsapp-title {
    color: #059669;
}

/* Classe própria em vez de .hg-quadrant-icon: o ícone do WhatsApp acompanha o
   verde do título, não o laranja primário das outras seções. */
.hg-whatsapp-icon {
    color: #059669;
    flex-shrink: 0;
}

.hg-whatsapp-subtitle {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    font-weight: 400;
}

.hg-whatsapp-iframe-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #f6f7f9;
}

.hg-whatsapp-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hg-whatsapp-loading,
.hg-whatsapp-unavailable {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: #efeae2;
}

.hg-whatsapp-loading p,
.hg-whatsapp-unavailable p {
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
    margin: 0;
}

.hg-whatsapp-loading-lead {
    font-size: 0.6875rem !important;
    opacity: 0.7;
}

.hg-whatsapp-loading-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.hg-whatsapp-loading-dots span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #9ca3af;
    animation: hg-whatsapp-bounce 0.8s infinite ease-in-out;
}

.hg-whatsapp-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.hg-whatsapp-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes hg-whatsapp-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

.hg-whatsapp-unavailable svg {
    width: 5rem;
    height: 5rem;
    opacity: 0.2;
    color: var(--hg-muted-foreground);
}

.hg-whatsapp-unavailable-hint {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    opacity: 0.7;
    max-width: 16rem;
}

.hg-whatsapp-empty {
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    text-align: center;
    padding: 2rem 1rem;
}

.hg-whatsapp-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    background: #efe6dc;
}

.hg-whatsapp-bubble {
    max-width: 70%;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.06);
    margin-bottom: 0.5rem;
}

.hg-whatsapp-bubble.me {
    margin-left: auto;
    background: #d9fdd3;
}

.hg-whatsapp-bubble.them {
    background: white;
}

.hg-whatsapp-time {
    font-size: 10px;
    color: var(--hg-muted-foreground);
    text-align: right;
    margin-top: 0.125rem;
}

.hg-whatsapp-input-bar {
    border-top: 1px solid var(--hg-border);
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 0.5rem;
    background: var(--hg-card);
}

.hg-whatsapp-input-bar input {
    flex: 1;
    min-width: 0;
}

.hg-whatsapp-iframe-wrap--fullscreen {
    flex: 1;
    min-height: 0;
}

.hg-whatsapp-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: rgb(0 0 0 / 0.65);
}

.hg-whatsapp-fullscreen-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.25);
}

.hg-whatsapp-fullscreen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-card);
    flex-shrink: 0;
}

.hg-whatsapp-fullscreen-lead {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--hg-muted-foreground);
}

/* Dropdowns do chat legado (select2/bootstrap) acima do drawer */
body:has(.hg-drawer-overlay) .select2-container--open,
body:has(.hg-drawer-overlay) .select2-dropdown,
body:has(.hg-drawer-overlay) .select2-container--open .select2-dropdown,
body:has(.hg-drawer-overlay) .modal,
body:has(.hg-drawer-overlay) .modal-backdrop,
body:has(.hg-drawer-overlay) .dropdown-menu.show,
body:has(.hg-sheet-root) .select2-container--open,
body:has(.hg-sheet-root) .select2-dropdown,
body:has(.hg-sheet-root) .select2-container--open .select2-dropdown,
body:has(.hg-sheet-root) .modal,
body:has(.hg-sheet-root) .modal-backdrop,
body:has(.hg-sheet-root) .dropdown-menu.show {
    z-index: 100 !important;
}

body:has(.hg-whatsapp-fullscreen) .select2-container--open,
body:has(.hg-whatsapp-fullscreen) .select2-dropdown,
body:has(.hg-whatsapp-fullscreen) .modal,
body:has(.hg-whatsapp-fullscreen) .modal-backdrop,
body:has(.hg-whatsapp-fullscreen) .dropdown-menu.show {
    z-index: 130 !important;
}

.hg-btn-emerald,
.hg-btn-emerald:hover,
.hg-btn-emerald:focus,
.hg-btn-emerald:focus-visible,
.hg-btn-emerald:active,
.hg-btn.hg-btn-emerald,
.hg-btn.hg-btn-emerald:hover,
.hg-btn.hg-btn-emerald:focus,
.hg-btn.hg-btn-emerald:focus-visible,
.hg-btn.hg-btn-emerald:active {
    background: #34d399 !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    filter: none !important;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.hg-btn-emerald:hover,
.hg-btn-emerald:focus,
.hg-btn-emerald:focus-visible,
.hg-btn-emerald:active,
.hg-btn.hg-btn-emerald:hover,
.hg-btn.hg-btn-emerald:focus,
.hg-btn.hg-btn-emerald:focus-visible,
.hg-btn.hg-btn-emerald:active {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.hg-btn-danger-outline,
.hg-btn-danger-outline:hover,
.hg-btn-danger-outline:focus,
.hg-btn-danger-outline:focus-visible,
.hg-btn-danger-outline:active {
    border: 2px solid color-mix(in srgb, var(--hg-destructive) 60%, transparent) !important;
    color: var(--hg-destructive) !important;
    background: transparent !important;
    filter: none !important;
}

.hg-btn-danger-outline:hover,
.hg-btn-danger-outline:focus,
.hg-btn-danger-outline:focus-visible,
.hg-btn-danger-outline:active {
    background: color-mix(in srgb, var(--hg-destructive) 10%, transparent) !important;
    color: var(--hg-destructive) !important;
}

/* Ação destrutiva confirmada (ex.: "Marcar como Perdido"): preenchida, como a
   primária. Desabilitada, o opacity 0.5 de .hg-btn dá o vermelho claro do protótipo. */
.hg-btn-danger,
.hg-btn-danger:hover,
.hg-btn-danger:focus,
.hg-btn-danger:focus-visible,
.hg-btn-danger:active,
.hg-btn.hg-btn-danger,
.hg-btn.hg-btn-danger:hover,
.hg-btn.hg-btn-danger:focus,
.hg-btn.hg-btn-danger:focus-visible,
.hg-btn.hg-btn-danger:active {
    background: var(--hg-destructive) !important;
    border-color: var(--hg-destructive) !important;
    color: #ffffff !important;
    filter: none !important;
}

.hg-btn-danger:hover:not(:disabled),
.hg-btn-danger:focus-visible:not(:disabled) {
    background: color-mix(in srgb, var(--hg-destructive) 88%, #000) !important;
    border-color: color-mix(in srgb, var(--hg-destructive) 88%, #000) !important;
}

/* Links do app: contraste legível em hover/focus/active (exceto botões e menu lateral) */
.hg-app a:not(.hg-btn):not(.hg-quick-link-card):not(.hg-nav-link):not(.hg-sidebar-brand-link):not(.hg-sidebar-footer a):hover,
.hg-app a:not(.hg-btn):not(.hg-quick-link-card):not(.hg-nav-link):not(.hg-sidebar-brand-link):not(.hg-sidebar-footer a):focus,
.hg-app a:not(.hg-btn):not(.hg-quick-link-card):not(.hg-nav-link):not(.hg-sidebar-brand-link):not(.hg-sidebar-footer a):focus-visible,
.hg-app a:not(.hg-btn):not(.hg-quick-link-card):not(.hg-nav-link):not(.hg-sidebar-brand-link):not(.hg-sidebar-footer a):active {
    color: #1f2937;
}

.hg-app a.hg-btn-primary:hover,
.hg-app a.hg-btn-primary:focus,
.hg-app a.hg-btn-primary:focus-visible,
.hg-app a.hg-btn-primary:active,
.hg-app a.hg-btn-emerald:hover,
.hg-app a.hg-btn-emerald:focus,
.hg-app a.hg-btn-emerald:focus-visible,
.hg-app a.hg-btn-emerald:active {
    color: #ffffff !important;
}

.hg-sidebar a.hg-nav-link,
.hg-sidebar a.hg-nav-sub-link {
    color: hsl(0 0% 100% / 0.78) !important;
}

.hg-sidebar a.hg-nav-sub-link {
    color: hsl(0 0% 100% / 0.7) !important;
}

.hg-sidebar a.hg-nav-link:hover,
.hg-sidebar a.hg-nav-link:focus-visible,
.hg-sidebar a.hg-nav-link:active,
.hg-sidebar a.hg-nav-sub-link:hover,
.hg-sidebar a.hg-nav-sub-link:focus-visible,
.hg-sidebar a.hg-nav-sub-link:active {
    color: #fff !important;
    background: hsl(0 0% 100% / 0.12);
}

.hg-sidebar a.hg-nav-link.is-active,
.hg-sidebar a.hg-nav-link.is-active:hover,
.hg-sidebar a.hg-nav-link.is-active:focus-visible,
.hg-sidebar a.hg-nav-link.is-active:active,
.hg-sidebar a.hg-nav-sub-link.is-active,
.hg-sidebar a.hg-nav-sub-link.is-active:hover {
    color: var(--hg-sidebar-primary) !important;
    background: hsl(var(--hg-hsl-brand) / 0.18);
    font-weight: 600;
}

.hg-sidebar a.hg-nav-sub-link:hover > svg,
.hg-sidebar a.hg-nav-sub-link:focus-visible > svg,
.hg-sidebar a.hg-nav-sub-link:active > svg {
    color: #fff !important;
}

.hg-sidebar a.hg-nav-sub-link.is-active > svg,
.hg-sidebar a.hg-nav-sub-link.is-active:hover > svg {
    color: var(--hg-sidebar-primary) !important;
}

.hg-anotacao-card {
    border-radius: 0.5rem;
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.5rem;
}

.hg-timeline {
    position: relative;
    padding-left: 1.25rem;
}

.hg-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 1px;
    background: var(--hg-border);
}

.hg-timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.hg-timeline-dot {
    position: absolute;
    left: -1.125rem;
    top: 0.375rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    border: 2px solid var(--hg-card);
}

.hg-os-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border: none;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.75rem;
}

.hg-os-item-btn:hover {
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
}

.hg-agendamento-ativo {
    border-left: 4px solid var(--hg-status-agendado);
    border-radius: 0.5rem;
    border: 1px solid var(--hg-border);
    border-left: 4px solid var(--hg-status-agendado);
    background: var(--hg-card);
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

/* Rótulos de quem é quem quando a seção passa a listar mais de um agendamento:
   o do evento aberto fica destacado (borda lateral, sombra), os do cliente vêm
   depois em cartões planos, para o operador não confundir contexto com ação. */
.hg-agendamento-ativo-label,
.hg-agendamento-outros-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-agendamento-outros-head {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hg-border);
}

.hg-agendamento-outros {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-agendamento-outro {
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
}

/* Sumiu do DMS: fica visível para consulta, mas apagado — tracejado e sem cor de
   status, para não competir com o que ainda é operável. */
.hg-agendamento-outro.is-fora-do-dms {
    border-style: dashed;
    background: transparent;
    opacity: 0.7;
}

.hg-badge--fora-do-dms {
    background: color-mix(in srgb, var(--hg-muted-foreground) 12%, transparent);
    color: var(--hg-muted-foreground);
    border-color: color-mix(in srgb, var(--hg-muted-foreground) 30%, transparent);
    cursor: help;
}

.hg-agendamento-outro-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hg-agendamento-outro-data {
    font-weight: 600;
}

.hg-agendamento-outro-linha {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.hg-agendamento-outro-rodape {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-textarea {
    width: 100%;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-input);
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 4.5rem;
}

@keyframes hg-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hg-modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes hg-modal-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes hg-modal-zoom-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.hg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 0.8);
    padding: 1rem;
    animation: hg-modal-fade-in 150ms ease-out both;
}

/* Overlay teleportado ao body — acima de topbar, sidebar e grades */
.hg-modal-overlay--top {
    z-index: 100000;
}

.hg-modal-overlay--confirm {
    z-index: 100001;
}

/* Toasts Filament acima dos modais teleportados (senão o erro fica invisível). */
.fi-no {
    z-index: 100050 !important;
}

.hg-agendar-erro {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.4;
}

.hg-email-suggest {
    position: relative;
    width: 100%;
}

.hg-email-suggest--full,
.hg-input--full {
    width: 100%;
}

.hg-field--full {
    grid-column: 1 / -1;
    width: 100%;
}

.hg-email-domain-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.hg-email-domain-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--hg-border);
    background: var(--hg-muted);
    color: var(--hg-foreground);
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.3;
}

.hg-email-domain-pill:hover,
.hg-email-domain-pill.is-active {
    background: color-mix(in srgb, var(--hg-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--hg-primary) 35%, transparent);
    color: var(--hg-primary);
}

.hg-email-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-popover, var(--hg-card));
    box-shadow: 0 12px 28px rgb(0 0 0 / 0.14);
    max-height: 16rem;
    overflow: auto;
    width: 100%;
}

.hg-email-suggest-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--hg-foreground);
    cursor: pointer;
}

.hg-email-suggest-item:hover,
.hg-email-suggest-item.is-active {
    background: color-mix(in oklch, var(--hg-muted) 70%, transparent);
}

.hg-email-suggest-item strong {
    font-weight: 600;
    color: var(--hg-primary);
}

.hg-modal-overlay.is-closing {
    animation: hg-modal-fade-out 150ms ease-in both;
}

.hg-modal {
    width: 100%;
    max-width: 28rem;
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0;
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.15);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    animation: hg-modal-zoom-in 200ms ease-out both;
}

.hg-modal-overlay.is-closing .hg-modal {
    animation: hg-modal-zoom-out 150ms ease-in both;
}

@media (prefers-reduced-motion: reduce) {
    .hg-modal-overlay,
    .hg-modal,
    .hg-modal-overlay.is-closing,
    .hg-modal-overlay.is-closing .hg-modal {
        animation: none;
    }
}

.hg-modal-lg {
    max-width: 40rem;
}

.hg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hg-border);
}

.hg-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.hg-modal-title--lg {
    font-size: 1.125rem;
}

.hg-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    overflow-x: visible;
}

.hg-modal-lg .hg-email-suggest-list {
    /* evita clip pelo scroll do body: lista sobe se necessário no fim do form */
    z-index: 40;
}

.hg-modal-lg .hg-email-suggest--full {
    overflow: visible;
}

.hg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--hg-border);
}

.hg-modal-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hg-muted-foreground);
}

.hg-form-grid {
    display: grid;
    gap: 0.75rem;
}

.hg-form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .hg-form-grid-2 {
        grid-template-columns: 1fr;
    }
}

.hg-section-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.hg-atendimento-header-grid {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
}

@media (min-width: 768px) {
    .hg-atendimento-header-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hg-atendimento-header-col {
        padding-right: 1.5rem;
    }

    .hg-atendimento-header-col-right {
        border-left: 1px solid var(--hg-border);
        padding-left: 1.5rem;
        padding-right: 0;
    }
}

.hg-atendimento-block-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.5rem;
}

.hg-atendimento-fields-grid {
    display: grid;
    gap: 0.375rem 1rem;
}

.hg-atendimento-fields-grid-2 {
    grid-template-columns: 1fr;
}

.hg-atendimento-fields-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .hg-atendimento-fields-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hg-atendimento-fields-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hg-atendimento-kv {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.hg-atendimento-kv-label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-atendimento-kv-value {
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hg-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-atendimento-kv-value--placa {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.hg-atendimento-header-divider {
    height: 1px;
    background: var(--hg-border);
    margin: 1rem 0;
}

.hg-btn-atendimento-action {
    height: 2.5rem;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Status badges — eventos */
.hg-status-pendente,
.hg-status-nao_compareceu {
    background: var(--hg-status-nao-compareceu-bg);
    color: var(--hg-status-nao-compareceu);
    border-color: var(--hg-status-nao-compareceu-border);
}

.hg-status-pendente .hg-badge-dot,
.hg-status-nao_compareceu .hg-badge-dot {
    background: var(--hg-status-nao-compareceu);
}

.hg-status-agendado {
    background: var(--hg-status-agendado-bg);
    color: var(--hg-status-agendado);
    border-color: var(--hg-status-agendado-border);
}

.hg-status-agendado .hg-badge-dot {
    background: var(--hg-status-agendado);
}

.hg-status-compareceu {
    background: var(--hg-status-compareceu-bg);
    color: var(--hg-status-compareceu);
    border-color: var(--hg-status-compareceu-border);
}

.hg-status-compareceu .hg-badge-dot {
    background: var(--hg-status-compareceu);
}

/* Temperatura da anotação — mesma estrutura dos badges de status. */
.hg-temp-quente {
    background: var(--hg-temp-quente-bg);
    color: var(--hg-temp-quente);
    border-color: var(--hg-temp-quente-border);
}

.hg-temp-morno {
    background: var(--hg-temp-morno-bg);
    color: var(--hg-temp-morno);
    border-color: var(--hg-temp-morno-border);
}

.hg-temp-frio {
    background: var(--hg-temp-frio-bg);
    color: var(--hg-temp-frio);
    border-color: var(--hg-temp-frio-border);
}

.hg-status-perdido {
    background: var(--hg-status-bloqueado-bg);
    color: var(--hg-status-bloqueado);
    border-color: var(--hg-status-bloqueado-border);
}

.hg-status-perdido .hg-badge-dot {
    background: var(--hg-status-bloqueado);
}

/* Agenda cards — tokens do prototipo-rafaela */
.hg-agenda-agendado {
    background: var(--hg-status-agendado-bg);
    color: var(--hg-status-agendado);
    border-color: var(--hg-status-agendado-border);
}

.hg-agenda-confirmado {
    background: var(--hg-status-confirmado-bg);
    color: var(--hg-status-confirmado);
    border-color: var(--hg-status-confirmado-border);
}

.hg-agenda-compareceu,
.hg-agenda-recebido {
    background: var(--hg-status-recebido-bg);
    color: var(--hg-status-recebido);
    border-color: var(--hg-status-recebido-border);
}

.hg-agenda-os-aberta {
    background: var(--hg-status-os-aberta-bg);
    color: var(--hg-status-os-aberta);
    border-color: var(--hg-status-os-aberta-border);
}

.hg-agenda-entrega {
    background: var(--hg-status-entrega-bg);
    color: var(--hg-status-entrega);
    border-color: var(--hg-status-entrega-border);
}

.hg-agenda-nao_compareceu {
    background: var(--hg-status-nao-compareceu-bg);
    color: var(--hg-status-nao-compareceu);
    border-color: var(--hg-status-nao-compareceu-border);
}

.hg-agenda-bloqueado {
    background: var(--hg-status-bloqueado-bg);
    color: var(--hg-status-bloqueado);
    border-color: var(--hg-status-bloqueado-border);
}

.hg-agenda-fora-expediente {
    background: var(--hg-status-fora-expediente-bg);
    color: var(--hg-status-fora-expediente);
    border-color: var(--hg-status-fora-expediente-border);
}

/* Eventos DB: mesma paleta do monitor-de-agendamento v2 */
.hg-page--eventos-linx .hg-badge.hg-agenda-agendado {
    background: var(--mn-status-agendado-bg, var(--hg-status-agendado-bg));
    color: var(--mn-status-agendado, var(--hg-status-agendado));
    border-color: var(--mn-status-agendado-border, var(--hg-status-agendado-border));
}

.hg-page--eventos-linx .hg-badge.hg-agenda-confirmado {
    background: var(--mn-status-confirmado-bg, var(--hg-status-confirmado-bg));
    color: var(--mn-status-confirmado, var(--hg-status-confirmado));
    border-color: var(--mn-status-confirmado-border, var(--hg-status-confirmado-border));
}

.hg-page--eventos-linx .hg-badge.hg-agenda-recebido,
.hg-page--eventos-linx .hg-badge.hg-agenda-compareceu {
    background: var(--mn-status-compareceu-bg, var(--hg-status-recebido-bg));
    color: var(--mn-status-compareceu, var(--hg-status-recebido));
    border-color: var(--mn-status-compareceu-border, var(--hg-status-recebido-border));
}

.hg-page--eventos-linx .hg-badge.hg-agenda-nao_compareceu {
    background: var(--mn-status-nao-bg, var(--hg-status-nao-compareceu-bg));
    color: var(--mn-status-nao, var(--hg-status-nao-compareceu));
    border-color: var(--mn-status-nao-border, var(--hg-status-nao-compareceu-border));
}

.hg-page--eventos-linx .hg-badge.hg-agenda-bloqueado,
.hg-page--eventos-linx .hg-badge.hg-status-perdido {
    background: var(--mn-status-bloqueado-bg, var(--hg-status-bloqueado-bg));
    color: var(--mn-status-bloqueado, var(--hg-status-bloqueado));
    border-color: var(--mn-status-bloqueado-border, var(--hg-status-bloqueado-border));
}

.hg-page--eventos-linx .hg-badge.hg-agenda-fora-expediente,
.hg-page--eventos-linx .hg-badge.hg-agenda-indisponivel {
    background: var(--mn-status-indisponivel-bg, var(--hg-status-fora-expediente-bg));
    color: var(--mn-status-indisponivel, var(--hg-status-fora-expediente));
    border-color: var(--mn-status-indisponivel-border, var(--hg-status-fora-expediente-border));
}

.hg-totalizer-pendente .hg-totalizer-dot { background: var(--hg-status-nao-compareceu); }
.hg-totalizer-agendado .hg-totalizer-dot { background: var(--hg-status-agendado); }
.hg-totalizer-compareceu .hg-totalizer-dot { background: var(--hg-status-recebido); }
.hg-totalizer-nao_compareceu .hg-totalizer-dot { background: var(--hg-status-nao-compareceu); }
.hg-totalizer-retorno .hg-totalizer-dot { background: var(--hg-primary); }
.hg-totalizer-perdido .hg-totalizer-dot { background: var(--hg-status-bloqueado); }

.hg-legend-agendado { background: var(--hg-status-agendado); }
.hg-legend-confirmado { background: var(--hg-status-confirmado); }
.hg-legend-compareceu,
.hg-legend-recebido { background: var(--hg-status-recebido); }
.hg-legend-os-aberta { background: var(--hg-status-os-aberta); }
.hg-legend-entrega { background: var(--hg-status-entrega); }
.hg-legend-nao_compareceu { background: var(--hg-status-nao-compareceu); }
.hg-legend-bloqueado { background: var(--hg-status-bloqueado); }
.hg-legend-fora-expediente,
.hg-legend-indisponivel { background: var(--hg-status-fora-expediente); border: 1px solid var(--hg-border); }

.hg-main .fi-page {
    padding: 1.5rem;
}

.hg-main .fi-section,
.hg-main .fi-ta-ctn {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.hg-main .fi-header-heading {
    font-size: 1.5rem;
    font-weight: 600;
}

.hg-impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: oklch(0.55 0.18 150);
    color: oklch(0.98 0.02 150);
    border-bottom: 1px solid oklch(0.52 0.14 150);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}

.hg-impersonation-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
}

.hg-impersonation-banner-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.hg-impersonation-banner-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: oklch(0.45 0.14 150);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hg-impersonation-banner-content strong {
    font-weight: 700;
}

.hg-impersonation-banner-email {
    opacity: 0.9;
}

.hg-impersonation-banner-btn {
    background: oklch(0.99 0.01 150);
    color: oklch(0.32 0.12 150);
    border: 1px solid oklch(0.88 0.04 150);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.hg-impersonation-banner-btn:hover {
    background: oklch(1 0 0);
}

body:has(.hg-impersonation-banner) .hg-app {
    padding-top: 3.25rem;
}

.hg-debug-info {
    padding: 1rem;
}

.hg-debug-info-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hg-debug-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.hg-debug-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 35%, transparent);
}

.hg-debug-info-key {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
}

.hg-debug-info-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    word-break: break-word;
}

.hg-debug-info-value--ok {
    color: oklch(0.52 0.14 145);
}

.hg-debug-info-value--bad {
    color: oklch(0.52 0.18 27);
}

.hg-debug-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 0.75rem;
}

.hg-log-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}

.hg-log-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-card, #fff);
    text-align: left;
    cursor: default;
}

button.hg-log-metric {
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

button.hg-log-metric:hover,
button.hg-log-metric.is-active {
    border-color: var(--hg-primary);
    transform: translateY(-1px);
}

.hg-log-metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hg-muted-foreground);
}

.hg-log-metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.hg-log-metric-hint {
    font-size: 0.6875rem;
    color: var(--hg-muted-foreground);
}

.hg-log-metric--ERROR .hg-log-metric-value,
.hg-log-metric--EXCEPTION .hg-log-metric-value {
    color: oklch(0.55 0.2 27);
}

.hg-log-metric--WARNING .hg-log-metric-value {
    color: oklch(0.58 0.14 75);
}

.hg-log-metric--INFO .hg-log-metric-value {
    color: oklch(0.5 0.14 250);
}

.hg-log-metric--DEBUG .hg-log-metric-value {
    color: oklch(0.45 0.03 260);
}

.hg-log-channel-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-log-channel-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.hg-log-channel-bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
}

.hg-log-channel-bar-track {
    display: block;
    height: 0.4rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-muted) 70%, transparent);
    overflow: hidden;
}

.hg-log-channel-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--hg-primary);
}

.hg-filters--logs {
    align-items: flex-end;
}

.hg-filters--logs .hg-field--search {
    flex: 1 1 16rem;
    min-width: 16rem;
}

.hg-log-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hg-log-search-row .hg-input {
    flex: 1;
}

.hg-log-viewer-wrap {
    overflow: hidden;
}

.hg-log-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hg-log-live {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.75rem;
    padding: 0 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: oklch(0.32 0.06 145);
    color: oklch(0.92 0.05 145);
}

.hg-log-live--off {
    background: oklch(0.28 0.02 260);
    color: oklch(0.75 0.02 260);
}

.hg-log-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: oklch(0.72 0.2 145);
}

.hg-log-live:not(.hg-log-live--off) .hg-log-live-dot {
    animation: hg-log-pulse 1.2s ease-in-out infinite;
}

@keyframes hg-log-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.45;
        transform: scale(0.85);
    }
}

.hg-log-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
}

.hg-log-viewer {
    max-height: calc(100vh - 280px);
    min-height: 22rem;
    overflow: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: oklch(0.16 0.02 260);
}

.hg-log-entry {
    border-radius: calc(var(--hg-radius) - 4px);
    border: 1px solid oklch(0.28 0.02 260);
    background: oklch(0.2 0.02 260);
    overflow: hidden;
}

.hg-log-entry-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid oklch(0.28 0.02 260);
    background: oklch(0.22 0.02 260);
}

.hg-log-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: oklch(0.75 0.02 260);
}

.hg-log-level-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background: oklch(0.35 0.03 260);
    color: oklch(0.92 0.02 260);
}

.hg-log-channel {
    font-size: 0.75rem;
    color: oklch(0.7 0.02 260);
}

.hg-log-exception {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: oklch(0.35 0.12 27);
    color: oklch(0.9 0.05 27);
}

.hg-log-lines {
    font-size: 0.6875rem;
    color: oklch(0.65 0.02 260);
    margin-left: auto;
}

.hg-log-toggle {
    border: 0;
    background: transparent;
    color: oklch(0.78 0.04 250);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
}

.hg-log-toggle:hover {
    color: oklch(0.9 0.04 250);
}

.hg-log-preview {
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    color: oklch(0.82 0.02 260);
}

.hg-log-message {
    margin: 0;
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: oklch(0.9 0.02 260);
    white-space: pre-wrap;
    word-break: break-word;
}

.hg-log-message--context {
    background: oklch(0.14 0.02 260);
    border-top: 1px solid oklch(0.28 0.02 260);
}

.hg-log-context-title {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: oklch(0.7 0.04 250);
}

.hg-log-empty {
    padding: 2rem;
    text-align: center;
    color: oklch(0.7 0.02 260);
    font-size: 0.875rem;
}

.hg-log-level-error .hg-log-level-badge,
.hg-log-level-critical .hg-log-level-badge,
.hg-log-level-alert .hg-log-level-badge,
.hg-log-level-emergency .hg-log-level-badge {
    background: oklch(0.55 0.2 27);
}

.hg-log-level-warning .hg-log-level-badge,
.hg-log-level-notice .hg-log-level-badge {
    background: oklch(0.62 0.16 75);
    color: oklch(0.2 0.04 75);
}

.hg-log-level-info .hg-log-level-badge {
    background: oklch(0.5 0.14 250);
}

.hg-log-level-debug .hg-log-level-badge {
    background: oklch(0.45 0.03 260);
}

.hg-code-block {
    margin: 0;
    padding: 0.75rem;
    border-radius: calc(var(--hg-radius) - 4px);
    border: 1px solid oklch(0.28 0.02 260);
    background: oklch(0.16 0.02 260);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: oklch(0.9 0.02 260);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.hg-code-block-sm {
    max-height: 220px;
    overflow: auto;
}

.hg-api-test {
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid oklch(0.32 0.02 260);
    padding: 0.75rem;
    background: oklch(0.19 0.02 260);
}

.hg-api-test.is-ok {
    border-color: oklch(0.52 0.14 145);
}

.hg-api-test.is-fail {
    border-color: oklch(0.55 0.18 27);
}

.hg-api-test-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.hg-api-test-head code {
    font-size: 0.75rem;
    color: oklch(0.75 0.02 260);
}

.hg-api-test-msg {
    font-size: 0.8125rem;
    color: oklch(0.78 0.02 260);
    margin-bottom: 0.5rem;
}

.hg-badge-success {
    background: oklch(0.45 0.12 145);
    color: oklch(0.95 0.02 145);
    border-color: transparent;
}

.hg-badge-danger {
    background: oklch(0.52 0.18 27);
    color: oklch(0.98 0.02 27);
    border-color: transparent;
}

.hg-muted {
    color: oklch(0.7 0.02 260);
    font-size: 0.875rem;
}

.hg-eligibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.hg-eligibility-card {
    padding: 0.875rem 1rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 35%, transparent);
}

.hg-eligibility-card.is-ok {
    border-color: oklch(0.72 0.12 145);
}

.hg-eligibility-card.is-fail {
    border-color: oklch(0.72 0.14 27);
}

.hg-eligibility-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.hg-eligibility-card-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-eligibility-card-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    line-height: 1.4;
}

.hg-card-section-lead {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: oklch(0.7 0.02 260);
    line-height: 1.45;
}

.hg-eligibility-summary {
    margin-top: 1rem;
}

.hg-eligibility-reasons {
    margin: 1rem 0 0 1rem;
    padding: 0;
    font-size: 0.875rem;
    color: oklch(0.7 0.02 260);
    line-height: 1.45;
}

.hg-quick-link-groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hg-quick-link-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-quick-link-group-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hg-quick-link-group-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hg-foreground);
}

.hg-quick-link-group-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    line-height: 1.4;
}

.hg-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
}

.hg-quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 10.5rem;
    padding: 1.25rem 1rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    color: inherit;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hg-quick-link-card:hover,
.hg-quick-link-card:focus-visible,
.hg-quick-link-card:active {
    border-color: color-mix(in srgb, var(--hg-primary) 45%, var(--hg-border));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--hg-primary) 12%, transparent);
    transform: translateY(-1px);
    color: inherit;
}

.hg-quick-link-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: calc(var(--hg-radius) - 4px);
    background: color-mix(in srgb, var(--hg-primary) 12%, var(--hg-muted));
    color: var(--hg-primary);
}

.hg-quick-link-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.hg-quick-link-card-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.hg-quick-link-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hg-foreground);
}

.hg-quick-link-card-arrow {
    font-size: 1rem;
    color: var(--hg-muted-foreground);
    transition: transform 0.15s ease, color 0.15s ease;
}

.hg-quick-link-card:hover .hg-quick-link-card-arrow {
    color: var(--hg-primary);
    transform: translateX(2px);
}

.hg-quick-link-card-desc {
    margin: 0;
    max-width: 18rem;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    line-height: 1.45;
    text-align: center;
}

.hg-agendamento-detalhes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.hg-agendamento-detalhes-span {
    grid-column: 1 / -1;
}

.hg-agendamento-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hg-border);
}

.hg-agendamento-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--hg-border);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--hg-muted-foreground);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* API LINX */
.hg-linx-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.hg-linx-page-header {
    margin-bottom: 0;
}

.hg-linx-deprecation-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid color-mix(in srgb, var(--hg-destructive) 45%, transparent);
    background: color-mix(in srgb, var(--hg-destructive) 12%, transparent);
    color: var(--hg-destructive);
}

.hg-linx-deprecation-alert-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.hg-linx-deprecation-alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.hg-linx-deprecation-alert-content strong {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
}

.hg-linx-deprecation-alert-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: color-mix(in srgb, var(--hg-destructive) 85%, var(--hg-foreground));
}

.hg-linx-empresa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.hg-linx-empresa-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hg-linx-empresa-item strong {
    font-size: 0.9375rem;
    color: var(--hg-foreground);
}

.hg-linx-empresa-alert {
    padding: 0.875rem 1rem;
    border-radius: calc(var(--hg-radius) - 2px);
    font-size: 0.8125rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.hg-linx-empresa-alert--error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.hg-linx-empresa-alert--warning {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.hg-linx-callout--warning {
    border-left-color: #f59e0b;
}

.hg-linx-var-example.is-configured {
    color: var(--hg-foreground);
    font-weight: 500;
}

.hg-linx-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-linx-section-head {
    margin-bottom: 0.25rem;
}

.hg-linx-section-head--standalone {
    padding: 0 0.125rem;
}

.hg-linx-section-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    line-height: 1.3;
}

.hg-linx-section-desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
    line-height: 1.55;
    max-width: 72ch;
}

.hg-linx-card {
    padding: 1.25rem 1.5rem;
}

.hg-linx-card--section {
    padding: 1.5rem 1.75rem;
}

.hg-linx-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.hg-linx-info-label,
.hg-linx-meta-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.5rem;
}

.hg-linx-stat {
    display: block;
    font-size: 1.375rem;
    line-height: 1.2;
    margin-bottom: 0.125rem;
}

.hg-linx-stat-hint {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-linx-code-block-inline {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
    word-break: break-all;
    padding: 0.5rem 0.625rem;
    margin-top: 0.125rem;
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-muted);
    border: 1px solid var(--hg-border);
}

.hg-linx-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--hg-muted);
    border: 1px solid var(--hg-border);
}

.hg-linx-table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0 1rem;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
}

.hg-linx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hg-linx-table th,
.hg-linx-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--hg-border);
}

.hg-linx-table th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, var(--hg-muted) 50%, transparent);
}

.hg-linx-table tbody tr:last-child td {
    border-bottom: 0;
}

.hg-linx-table tbody tr:hover td {
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
}

.hg-linx-var {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hg-primary, #2563eb);
    white-space: nowrap;
}

.hg-linx-var-example {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    word-break: break-all;
}

.hg-linx-callout {
    margin: 0;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
    border-left: 3px solid var(--hg-primary, #2563eb);
    border-radius: 0 calc(var(--hg-radius) - 2px) calc(var(--hg-radius) - 2px) 0;
}

.hg-linx-postman-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hg-linx-postman-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-linx-postman-step-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.hg-linx-request-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: var(--hg-muted);
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
}

.hg-linx-method {
    flex-shrink: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hg-linx-request-url {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
    word-break: break-all;
    color: inherit;
}

.hg-linx-postman-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-linx-headers-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    overflow: hidden;
}

.hg-linx-header-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 25%, transparent);
}

.hg-linx-header-row:last-child {
    border-bottom: 0;
}

.hg-linx-header-key {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hg-primary, #2563eb);
}

.hg-linx-header-val {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.hg-linx-header-val--full {
    grid-column: 1 / -1;
}

.hg-linx-code-pre {
    margin: 0;
    max-height: 280px;
    overflow: auto;
}

.hg-linx-response-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, #059669 8%, var(--hg-muted));
    border: 1px solid color-mix(in srgb, #059669 20%, var(--hg-border));
    border-radius: calc(var(--hg-radius) - 2px);
}

.hg-linx-response-hint svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #059669;
}

.hg-linx-search-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
}

.hg-linx-search-field {
    flex: 1;
    min-width: 240px;
    margin: 0;
}

.hg-linx-endpoints-card {
    padding: 0;
    overflow: hidden;
}

.hg-linx-endpoint {
    border-top: 1px solid var(--hg-border);
}

.hg-linx-endpoint:first-child {
    border-top: 0;
}

.hg-linx-endpoint.is-open {
    background: color-mix(in srgb, var(--hg-muted) 35%, transparent);
}

.hg-linx-endpoint-head {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hg-linx-endpoint-head:hover {
    background: color-mix(in srgb, var(--hg-muted) 25%, transparent);
}

.hg-linx-endpoint-head-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.hg-linx-endpoint-name {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
}

.hg-linx-chevron {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--hg-muted-foreground);
    transition: transform 0.2s ease;
}

.hg-linx-endpoint.is-open .hg-linx-chevron {
    transform: rotate(180deg);
}

.hg-linx-action {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--hg-muted);
    border: 1px solid var(--hg-border);
}

.hg-linx-path {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    word-break: break-all;
    line-height: 1.45;
}

.hg-linx-endpoint-body {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hg-linx-endpoint-desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--hg-foreground);
}

.hg-linx-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem 1.5rem;
}

.hg-linx-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hg-linx-empty {
    margin: 0;
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
}

.hg-linx-muted-inline {
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    font-style: italic;
}

.hg-linx-architecture-card {
    border-color: color-mix(in srgb, var(--hg-primary) 35%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 6%, var(--hg-card));
}

.hg-linx-tabs-bar {
    margin-bottom: 1.25rem;
}

.hg-linx-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hg-linx-db-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.hg-linx-db-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hg-linx-impl-card .hg-linx-impl-motivo {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    text-align: left;
    line-height: 1.45;
}

.hg-linx-impl-module {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
    white-space: nowrap;
}

.hg-linx-impl-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.55;
}

.hg-linx-impl-list li + li {
    margin-top: 0.35rem;
}

.hg-linx-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.hg-linx-access-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-muted);
}

.hg-linx-access-name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.hg-linx-access-auth,
.hg-linx-access-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--hg-muted-foreground);
    line-height: 1.5;
}

.hg-linx-endpoint-head--static {
    cursor: default;
}

.hg-linx-endpoint-head--static:hover {
    background: transparent;
}

.hg-linx-endpoint-body--static {
    border-top: 1px solid var(--hg-border);
}

.hg-linx-field-grid {
    margin-top: 0.75rem;
}

.hg-linx-table--compact th,
.hg-linx-table--compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.hg-linx-response-list,
.hg-linx-limitations-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--hg-foreground);
    line-height: 1.6;
}

.hg-linx-response-list li + li,
.hg-linx-limitations-list li + li {
    margin-top: 0.35rem;
}

@media (max-width: 640px) {
    .hg-linx-card,
    .hg-linx-card--section {
        padding: 1rem 1.125rem;
    }

    .hg-linx-endpoint-head,
    .hg-linx-endpoint-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hg-linx-header-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .hg-linx-table th,
    .hg-linx-table td {
        padding: 0.625rem 0.75rem;
    }
}


/* --- Layout helpers (sem CSS inline) --- */
:root {
    --hg-slot-width: 110px;
    --hg-row-height: 76px;
}

.hg-nav-group-label {
    flex: 1;
    text-align: left;
}

.hg-page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hg-nav-date-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hg-empty--compact {
    padding: 2rem;
}

.hg-empty-title {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--hg-foreground);
}

.hg-empty-hint--spaced {
    margin: 0 0 1rem;
}

.hg-card--padded {
    padding: 1rem;
}

.hg-card--padded-sm {
    padding: 0.75rem;
}

.hg-card--padded-md {
    padding: 0.75rem 1rem;
}

.hg-card--flush {
    padding: 0;
    overflow: hidden;
}

.hg-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-stack--sm {
    gap: 0.75rem;
}

.hg-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hg-row-between--wrap {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hg-inline-actions {
    display: flex;
    gap: 0.25rem;
}

.hg-inline-actions--md {
    gap: 0.5rem;
}

.hg-text-muted {
    color: var(--hg-muted-foreground);
}

.hg-text-sm {
    font-size: 0.875rem;
}

.hg-text-xs {
    font-size: 0.8125rem;
}

.hg-text-caption {
    font-size: 0.75rem;
}

.hg-text-strong {
    font-weight: 600;
}

.hg-text-medium {
    font-weight: 500;
}

.hg-mb-sm {
    margin-bottom: 1rem;
}

.hg-mt-xs {
    margin-top: 0.35rem;
}

.hg-mt-sm {
    margin-top: 0.75rem;
}

.hg-m-0 {
    margin: 0;
}

.hg-required {
    color: var(--hg-destructive);
}

.hg-btn--danger-text {
    color: var(--hg-destructive);
}

.hg-btn--block-left {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 0.25rem;
    height: auto;
    padding: 0.5rem 0.75rem;
}

.hg-link-underline {
    text-decoration: underline;
}

.hg-link {
    color: var(--hg-primary, #FF8205);
    text-decoration: underline;
    font-weight: 500;
}

.hg-link:hover {
    opacity: 0.85;
}

.hg-file {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-file-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.hg-file-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px dashed color-mix(in srgb, var(--hg-border) 80%, var(--hg-primary));
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--hg-card) 92%, var(--hg-primary));
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hg-file-drop:hover,
.hg-file-drop:focus-within {
    border-color: var(--hg-primary);
    background: color-mix(in srgb, var(--hg-card) 85%, var(--hg-primary));
}

.hg-file-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.45rem;
    background: hsl(var(--hg-hsl-brand) / 0.12);
    color: var(--hg-primary);
    flex-shrink: 0;
}

.hg-file-drop-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.hg-file-drop-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hg-foreground, #111);
}

.hg-file-drop-hint {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground, #6b7280);
}

.hg-file-meta {
    min-height: 1.25rem;
}

.hg-file-meta-loading {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground, #6b7280);
}

.hg-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: hsl(var(--hg-hsl-brand) / 0.12);
    color: var(--hg-foreground, #111);
    font-size: 0.75rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-field--span-2,
.hg-field--full {
    grid-column: 1 / -1;
    width: 100%;
}

.hg-input--uppercase {
    text-transform: uppercase;
}

.hg-modal-body--stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-modal-body--stack-sm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-modal-footer--between {
    justify-content: space-between;
}

.hg-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.hg-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
}

.hg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.hg-table thead tr {
    background: color-mix(in oklch, var(--hg-muted) 40%, transparent);
    text-align: left;
}

.hg-table th {
    height: 2.5rem;
    padding: 0.5rem;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    white-space: nowrap;
    border-bottom: 1px solid var(--hg-border);
}

.hg-table td {
    padding: 0.5rem;
    vertical-align: middle;
    color: var(--hg-foreground);
    font-size: 0.875rem;
}

.hg-table tbody tr {
    border-top: 1px solid var(--hg-border);
    transition: background 0.12s ease;
}

.hg-table tbody tr:hover {
    background: color-mix(in oklch, var(--hg-muted) 30%, transparent);
}

.hg-table-cell-name {
    font-weight: 500;
}

.hg-table-cell-actions {
    width: 2.75rem;
    white-space: nowrap;
    text-align: right;
    position: relative;
}

.hg-agenda-grid-slot-head,
.hg-agenda-grid-cell-empty {
    width: var(--hg-slot-width);
    min-height: var(--hg-row-height);
}

.hg-agenda-grid-consultor,
.hg-agenda-grid-cell-span {
    min-height: var(--hg-row-height);
}

/* Mais de um agendamento no mesmo horário do mesmo consultor — acontece quando o
   site da Honda cria direto no DMS sobre um horário já ocupado. Os cards ficam um
   sobre o outro e a célula cresce, em vez de o segundo desaparecer. `height: auto`
   nos cards derruba o `height: 100%`, que dividiria a altura entre eles. */
.hg-agenda-grid-cell-span.is-empilhado,
.hg-agenda-week-cell-span.is-empilhado {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: auto !important;
}

.hg-agenda-grid-cell-span.is-empilhado .hg-agenda-card,
.hg-agenda-week-cell-span.is-empilhado .hg-agenda-week-card {
    height: auto;
    flex: 0 0 auto;
}

.hg-agenda-span-1 { width: calc(var(--hg-slot-width) * 1); }
.hg-agenda-span-2 { width: calc(var(--hg-slot-width) * 2); }
.hg-agenda-span-3 { width: calc(var(--hg-slot-width) * 3); }
.hg-agenda-span-4 { width: calc(var(--hg-slot-width) * 4); }
.hg-agenda-span-5 { width: calc(var(--hg-slot-width) * 5); }
.hg-agenda-span-6 { width: calc(var(--hg-slot-width) * 6); }
.hg-agenda-span-7 { width: calc(var(--hg-slot-width) * 7); }
.hg-agenda-span-8 { width: calc(var(--hg-slot-width) * 8); }
.hg-agenda-span-9 { width: calc(var(--hg-slot-width) * 9); }
.hg-agenda-span-10 { width: calc(var(--hg-slot-width) * 10); }
.hg-agenda-span-11 { width: calc(var(--hg-slot-width) * 11); }
.hg-agenda-span-12 { width: calc(var(--hg-slot-width) * 12); }
.hg-agenda-span-13 { width: calc(var(--hg-slot-width) * 13); }
.hg-agenda-span-14 { width: calc(var(--hg-slot-width) * 14); }
.hg-agenda-span-15 { width: calc(var(--hg-slot-width) * 15); }
.hg-agenda-span-16 { width: calc(var(--hg-slot-width) * 16); }
.hg-agenda-span-17 { width: calc(var(--hg-slot-width) * 17); }
.hg-agenda-span-18 { width: calc(var(--hg-slot-width) * 18); }
.hg-agenda-span-19 { width: calc(var(--hg-slot-width) * 19); }
.hg-agenda-span-20 { width: calc(var(--hg-slot-width) * 20); }
.hg-agenda-span-21 { width: calc(var(--hg-slot-width) * 21); }
.hg-agenda-span-22 { width: calc(var(--hg-slot-width) * 22); }

.hg-agenda-block--clickable {
    cursor: pointer;
}

.hg-agenda-block-title {
    font-weight: 600;
}

.hg-agenda-block-hint {
    font-size: 0.7rem;
    margin-top: 0.15rem;
    opacity: 0.85;
}

.hg-divider {
    height: 1px;
    background: var(--hg-border);
    margin: 1rem 0;
}

.hg-btn-group-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hg-modal-heading {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.hg-modal-heading--spaced {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.hg-modal-lead {
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
    margin: 0 0 1rem;
}

.hg-actions-end {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.hg-actions-end--spaced {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hg-section-card-body--md {
    padding: 0.75rem 1rem;
}

.hg-mb-xs {
    margin-bottom: 0.5rem;
}

.hg-form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.hg-text-foreground {
    color: var(--hg-foreground);
}

.hg-text-primary {
    color: var(--hg-primary);
}

.hg-reagendar-form {
    display: grid;
    gap: 0.75rem;
    border-top: 1px solid var(--hg-border);
    padding-top: 0.75rem;
}

.hg-info-panel {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.hg-info-panel-head {
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
    text-align: center;
}

.hg-info-panel-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--hg-muted-foreground);
}

.hg-info-panel-value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.hg-info-panel-value--lg {
    margin-top: 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.hg-info-panel--rounded {
    border-radius: 0.5rem;
    border: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 40%, transparent);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.hg-empty-inline {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-empty-inline--lg {
    padding: 2.5rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-os-list {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    overflow: hidden;
}

.hg-os-list-item {
    border-bottom: 1px solid var(--hg-border);
}

.hg-os-detail {
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--hg-muted) 20%, transparent);
    font-size: 0.75rem;
}

.hg-os-detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-detail-list {
    border: 1px solid var(--hg-border);
    border-radius: 0.375rem;
    overflow: hidden;
    background: var(--hg-card);
    list-style: none;
    margin: 0;
    padding: 0;
}

.hg-detail-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0.625rem;
    border-bottom: 1px solid var(--hg-border);
}

.hg-detail-list-item:last-child {
    border-bottom: none;
}

.hg-km-form-block {
    margin-bottom: 1rem;
}

.hg-km-form-label {
    margin-bottom: 0.375rem;
}

.hg-km-input-row {
    display: flex;
    gap: 0.5rem;
}

.hg-input--grow {
    flex: 1;
}

.hg-km-history {
    border-radius: 0.5rem;
    border: 1px solid var(--hg-border);
    overflow: hidden;
}

.hg-km-history-head {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.75rem;
    font-weight: 600;
}

.hg-km-history-item {
    padding: 0.75rem;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--hg-border);
}

.hg-km-history-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--hg-border);
    display: flex;
    justify-content: space-between;
    color: var(--hg-muted-foreground);
}

.hg-anotacao-card--flush {
    margin-bottom: 0;
}

.hg-anotacao-card-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-anotacao-card-subtitle {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-anotacao-card-body {
    margin-top: 0.375rem;
    font-size: 0.75rem;
}

.hg-anotacao-card-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.hg-anotacao-card-main {
    min-width: 0;
    flex: 1;
}

.hg-anotacao-card-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    flex-shrink: 0;
}

.hg-icon-btn-ghost {
    border: none;
    background: none;
    color: var(--hg-muted-foreground);
    cursor: pointer;
}

.hg-anotacao-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--hg-border);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--hg-muted-foreground);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hg-evento-card-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--hg-border);
    font-size: 11px;
    color: var(--hg-muted-foreground);
}

.hg-evento-card-desc {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-evento-card-time {
    font-size: 11px;
    color: var(--hg-muted-foreground);
}

.hg-resumo-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.hg-resumo-kv-grid--icons {
    gap: 0.75rem;
}

.hg-resumo-kv-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.hg-resumo-kv-ico {
    color: var(--hg-muted-foreground);
    margin-top: 0.125rem;
    flex-shrink: 0;
    display: inline-flex;
}

.hg-resumo-kv-text {
    min-width: 0;
    flex: 1;
}

.hg-resumo-kv-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-resumo-kv-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-badge--xs {
    font-size: 10px;
}

.hg-dms-obs-meta {
    margin-top: 0.25rem;
    font-size: 11px;
    color: var(--hg-muted-foreground);
}

.hg-field--search {
    flex: 1;
    min-width: 220px;
}

.hg-agenda-avatar--lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.75rem;
}

.hg-consultor-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hg-week-hint {
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
    margin: 0 0 1rem;
}

/* --- Debug / helpers extras --- */
.hg-filters--wrap {
    flex-wrap: wrap;
}

.hg-input--code {
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

.hg-debug-info-title--spaced {
    margin-bottom: 0.75rem;
}

.hg-debug-info-grid--spaced {
    margin-bottom: 1rem;
}

.hg-reasons-list {
    margin: 0 0 1rem 1rem;
}

.hg-page-stack--sm > * + * {
    margin-top: 0.75rem;
}

.hg-page-stack.hg-page-stack--sm > * + * {
    margin-top: 0.75rem;
}

/* --- Gestão de usuários (alinhada ao shell Pós-Vendas) --- */
.hg-users-page.fi-page {
    padding: 1.5rem;
    gap: 1rem;
    display: flex;
    flex-direction: column;
}

.hg-users-page .hg-users-page-header {
    margin-bottom: 0.25rem;
}

.hg-users-page .hg-users-header-actions .fi-ac,
.hg-users-page .hg-users-header-actions .fi-ac-btn-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-users-page .hg-users-header-actions .fi-btn {
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: none;
}

.hg-users-page .hg-users-header-actions .fi-btn.hg-btn-primary,
.hg-users-page .hg-users-header-actions .fi-btn-color-primary {
    background: var(--hg-primary);
    color: #fff;
    border-color: transparent;
}

.hg-users-page .hg-users-header-actions .fi-btn.hg-btn-primary:hover,
.hg-users-page .hg-users-header-actions .fi-btn-color-primary:hover {
    filter: brightness(0.95);
}

.hg-users-page .fi-header {
    display: none; /* header custom hg-page-header */
}

.hg-users-page .fi-page-main,
.hg-users-page .fi-page-content,
.hg-users-page .fi-sc {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-users-page .fi-ta-ctn {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: none;
    overflow: hidden;
}

.hg-users-page .fi-ta-header,
.hg-users-page .fi-ta-header-toolbar {
    background: color-mix(in oklch, var(--hg-muted) 35%, transparent);
    border-bottom: 1px solid var(--hg-border);
    padding: 0.75rem 1rem;
}

.hg-users-page .fi-ta-search-field input,
.hg-users-page .fi-input {
    border-radius: 0.5rem;
    border-color: var(--hg-border);
    background: var(--hg-background, #fff);
}

.hg-users-page .fi-ta-table {
    font-size: 0.875rem;
}

.hg-users-page .fi-ta-table thead th {
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--hg-border);
}

.hg-users-page .fi-ta-table tbody tr {
    border-top: 1px solid var(--hg-border);
}

.hg-users-page .fi-ta-table tbody tr:hover {
    background: color-mix(in oklch, var(--hg-muted) 40%, transparent);
}

.hg-users-page .fi-ta-table td,
.hg-users-page .fi-ta-table th {
    padding: 0.85rem 1rem;
}

.hg-users-page .fi-ta-actions .fi-btn,
.hg-users-page .fi-ac-btn-group .fi-btn {
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.hg-users-page .fi-section {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: none;
}

.hg-users-page .fi-section-header {
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in oklch, var(--hg-muted) 30%, transparent);
}

.hg-users-page .fi-fo-field-wrp input,
.hg-users-page .fi-input,
.hg-users-page .fi-select-input {
    border-radius: 0.5rem;
}

.hg-users-page .fi-form-actions,
.hg-users-page .fi-form-actions .fi-ac {
    gap: 0.5rem;
}

.hg-users-page .fi-form-actions .fi-btn-color-primary {
    background: var(--hg-primary);
    color: #fff;
    border-color: transparent;
    border-radius: 0.5rem;
    font-weight: 600;
}

.hg-users-page .fi-pagination {
    border-top: 1px solid var(--hg-border);
    padding: 0.75rem 1rem;
    background: color-mix(in oklch, var(--hg-muted) 20%, transparent);
}

/* --- Campanhas / Lixeira (protótipo) --- */
.hg-totalizers--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .hg-totalizers--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.hg-totalizer-dot--primary { background: var(--hg-primary); }
.hg-totalizer-dot--agendado { background: var(--hg-status-agendado); }
.hg-totalizer-dot--compareceu { background: var(--hg-status-compareceu); }

.hg-campanha-exec {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 8rem;
    font-size: 0.8125rem;
}

.hg-progress {
    height: 0.375rem;
    border-radius: 9999px;
    background: var(--hg-muted);
    overflow: hidden;
}

.hg-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: var(--hg-primary);
    width: 0;
}

.hg-progress-bar--0 { width: 0; }
.hg-progress-bar--10 { width: 10%; }
.hg-progress-bar--20 { width: 20%; }
.hg-progress-bar--30 { width: 30%; }
.hg-progress-bar--40 { width: 40%; }
.hg-progress-bar--50 { width: 50%; }
.hg-progress-bar--60 { width: 60%; }
.hg-progress-bar--70 { width: 70%; }
.hg-progress-bar--80 { width: 80%; }
.hg-progress-bar--90 { width: 90%; }
.hg-progress-bar--100 { width: 100%; }

.hg-table-cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.hg-table-cell-icon {
    width: 2.5rem;
}

.hg-table-cell-ellipsis {
    max-width: 20rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-table-row--clickable {
    cursor: pointer;
}

.hg-table-row--clickable:hover,
.hg-table-row--nested {
    background: color-mix(in oklch, var(--hg-muted) 35%, transparent);
}

.hg-badge--primary {
    background: color-mix(in oklch, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
    border-color: color-mix(in oklch, var(--hg-primary) 30%, transparent);
}

.hg-badge-muted {
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    border-color: var(--hg-border);
}

.hg-text-xs {
    font-size: 0.75rem;
}

.hg-filters-filtrar {
    align-self: flex-end;
    gap: 0.5rem;
}


/* --- Agenda week grid (prototipo AgendaWeekGrid) --- */
.hg-agenda-week {
    --hg-agenda-week-consultor: 200px;
    --hg-agenda-week-time: 64px;
    --hg-agenda-week-day: 170px;
    --hg-agenda-week-slot-h: 56px;
}

.hg-agenda-week-shell {
    border-radius: calc(var(--hg-radius) + 4px);
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    overflow: hidden;
}

.hg-agenda-week-scroll {
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.hg-agenda-week-grid {
    min-width: max-content;
}

.hg-agenda-week-head {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-card) 95%, transparent);
    backdrop-filter: blur(6px);
}

.hg-agenda-week-consultor-head {
    position: sticky;
    left: 0;
    z-index: 30;
    width: var(--hg-agenda-week-consultor);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--hg-border);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    background: color-mix(in srgb, var(--hg-card) 95%, transparent);
}

.hg-agenda-week-time-head {
    position: sticky;
    left: var(--hg-agenda-week-consultor);
    z-index: 20;
    width: var(--hg-agenda-week-time);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--hg-border);
    padding: 0.5rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
    text-align: center;
    background: color-mix(in srgb, var(--hg-card) 95%, transparent);
}

.hg-agenda-week-day-head {
    width: var(--hg-agenda-week-day);
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    text-transform: capitalize;
    color: var(--hg-foreground, inherit);
}

.hg-agenda-week-consultor-block {
    display: flex;
    border-bottom: 1px solid var(--hg-border);
}

.hg-agenda-week-consultor-block:last-child {
    border-bottom: none;
}

.hg-agenda-week-consultor {
    position: sticky;
    left: 0;
    z-index: 10;
    width: var(--hg-agenda-week-consultor);
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.75rem;
    align-self: stretch;
}

.hg-agenda-week-consultor-inner {
    position: sticky;
    top: 3rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.hg-agenda-week-consultor-name {
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
    word-break: break-word;
}

.hg-agenda-week-slots {
    flex: 1;
    min-width: 0;
}

.hg-agenda-week-slot-row {
    display: flex;
    height: var(--hg-agenda-week-slot-h);
    border-bottom: 1px solid var(--hg-border);
}

.hg-agenda-week-slot-row:last-child {
    border-bottom: none;
}

.hg-agenda-week-time-cell {
    width: var(--hg-agenda-week-time);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-muted) 20%, transparent);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
    font-variant-numeric: tabular-nums;
}

.hg-agenda-week-cell {
    width: var(--hg-agenda-week-day);
    flex-shrink: 0;
    border-right: 1px solid var(--hg-border);
    box-sizing: border-box;
}

.hg-agenda-week-cell-span {
    position: relative;
    z-index: 2;
    padding: 0.25rem;
    overflow: visible;
}

.hg-agenda-week-cell-continuation {
    height: 0;
    border-right: 1px solid var(--hg-border);
    overflow: hidden;
    pointer-events: none;
}

.hg-agenda-week-cell-empty {
    height: var(--hg-agenda-week-slot-h);
    cursor: cell;
    user-select: none;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.hg-agenda-week-cell-empty:hover {
    background: color-mix(in srgb, var(--hg-primary) 5%, transparent);
}

.hg-agenda-week-cell-empty.is-selected {
    background: color-mix(in srgb, var(--hg-primary) 15%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hg-primary) 50%, transparent);
}

.hg-agenda-week-cell-empty.is-drop-ok {
    background: color-mix(in srgb, var(--hg-drop-ok) 14%, transparent);
    box-shadow: inset 0 0 0 2px var(--hg-drop-ok);
}

.hg-agenda-week-cell-empty.is-drop-bad {
    background: color-mix(in srgb, var(--hg-drop-bad) 14%, transparent);
    box-shadow: inset 0 0 0 2px var(--hg-drop-bad);
}

.hg-agenda-week-card,
.hg-agenda-week-block {
    height: 100%;
    width: 100%;
    min-width: 0;
    border-radius: 0.375rem;
    border: 1px solid;
    font-size: 0.6875rem;
    line-height: 1.2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hg-agenda-week-card {
    padding: 0.375rem 0.5rem;
    gap: 0.125rem;
}

.hg-agenda-week-card--compact {
    padding: 0.125rem 0.375rem;
    gap: 0;
}

.hg-agenda-week-card-compact-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    min-width: 0;
    line-height: 1;
}

.hg-agenda-week-card-placa {
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-agenda-week-card-slot {
    flex-shrink: 0;
    font-size: 0.5625rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.hg-agenda-week-card-owner {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    text-align: left;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
}

.hg-agenda-week-card--compact .hg-agenda-week-card-owner {
    font-size: 0.625rem;
    font-weight: 400;
    text-transform: none;
}

.hg-agenda-week-card-time {
    font-size: 0.625rem;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-agenda-week-block {
    padding: 0.375rem 0.5rem;
    text-align: left;
    background: var(--hg-status-bloqueado-bg, #fef2f2);
    color: var(--hg-status-bloqueado, #b91c1c);
    border-color: var(--hg-status-bloqueado-border, #fecaca);
}

/* --- Campanhas / Lixeira — drawers, totalizers com ícone, badges --- */
.hg-totalizer-with-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hg-totalizer-main {
    min-width: 0;
}

.hg-totalizer-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
}

.hg-totalizer-icon--primary {
    background: color-mix(in oklch, var(--hg-primary) 12%, transparent);
    color: var(--hg-primary);
}

.hg-totalizer-icon--agendado {
    background: var(--hg-status-agendado-bg, color-mix(in oklch, var(--hg-status-agendado) 12%, transparent));
    color: var(--hg-status-agendado);
}

.hg-totalizer-icon--compareceu {
    background: var(--hg-status-compareceu-bg, color-mix(in oklch, var(--hg-status-compareceu) 12%, transparent));
    color: var(--hg-status-compareceu);
}

.hg-totalizer-icon--danger {
    background: color-mix(in oklch, var(--hg-destructive, #dc2626) 12%, transparent);
    color: var(--hg-destructive, #dc2626);
}

.hg-totalizer-dot--danger {
    background: var(--hg-destructive, #dc2626);
}

.hg-totalizers--3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .hg-totalizers--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hg-badge-tipo-revisao {
    background: var(--hg-status-agendado-bg, color-mix(in oklch, var(--hg-status-agendado) 12%, transparent));
    color: var(--hg-status-agendado);
    border-color: var(--hg-status-agendado-border, color-mix(in oklch, var(--hg-status-agendado) 30%, transparent));
}

.hg-badge-tipo-boasvindas,
.hg-badge-tipo-resgate {
    background: var(--hg-status-compareceu-bg, color-mix(in oklch, var(--hg-status-compareceu) 12%, transparent));
    color: var(--hg-status-compareceu);
    border-color: var(--hg-status-compareceu-border, color-mix(in oklch, var(--hg-status-compareceu) 30%, transparent));
}

.hg-badge-exec-agendada {
    background: var(--hg-status-agendado-bg, color-mix(in oklch, var(--hg-status-agendado) 12%, transparent));
    color: var(--hg-status-agendado);
    border-color: var(--hg-status-agendado-border, color-mix(in oklch, var(--hg-status-agendado) 30%, transparent));
}

.hg-badge-exec-processamento {
    background: color-mix(in oklch, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
    border-color: color-mix(in oklch, var(--hg-primary) 30%, transparent);
}

.hg-badge-exec-concluida {
    background: var(--hg-status-compareceu-bg, color-mix(in oklch, var(--hg-status-compareceu) 12%, transparent));
    color: var(--hg-status-compareceu);
    border-color: var(--hg-status-compareceu-border, color-mix(in oklch, var(--hg-status-compareceu) 30%, transparent));
}

.hg-badge-exec-pausada {
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    border-color: var(--hg-border);
}

.hg-badge-exec-erro {
    background: color-mix(in oklch, var(--hg-destructive, #dc2626) 10%, transparent);
    color: var(--hg-destructive, #dc2626);
    border-color: color-mix(in oklch, var(--hg-destructive, #dc2626) 30%, transparent);
}

.hg-badge-dot--success {
    background: var(--hg-status-compareceu);
}

.hg-badge-dot--muted {
    background: var(--hg-muted-foreground);
}

.hg-campanha-exec-meta {
    font-size: 0.6875rem;
    color: var(--hg-muted-foreground);
    font-variant-numeric: tabular-nums;
}

.hg-table-cell-actions {
    width: 2.75rem;
    text-align: right;
    position: relative;
}

.hg-dropdown {
    position: relative;
    display: inline-flex;
}

.hg-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    min-width: 13rem;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}

.hg-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--hg-foreground);
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.hg-dropdown-item:hover {
    background: color-mix(in oklch, var(--hg-muted) 60%, transparent);
}

.hg-dropdown-item--danger {
    color: var(--hg-destructive, #dc2626);
}

.hg-dropdown-item--danger:hover {
    background: color-mix(in oklch, var(--hg-destructive, #dc2626) 8%, transparent);
}

/* Sheet (Campanhas) — fiel ao Radix Sheet + ScrollArea do protótipo */
@keyframes hg-sheet-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hg-sheet-slide-in-from-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes hg-sheet-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes hg-sheet-slide-out-to-right {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

.hg-sheet-root {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.hg-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.8);
    pointer-events: auto;
    animation: hg-sheet-fade-in 150ms ease-out both;
}

.hg-sheet-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(75vw, 100%);
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--hg-background);
    border-left: 1px solid var(--hg-border);
    box-shadow: -12px 0 40px rgb(0 0 0 / 0.18);
    pointer-events: auto;
    overflow: hidden;
    will-change: transform;
    animation: hg-sheet-slide-in-from-right 500ms ease-in-out both;
}

.hg-sheet-root.is-closing .hg-sheet-backdrop {
    animation: hg-sheet-fade-out 200ms ease-in both;
}

.hg-sheet-root.is-closing .hg-sheet-panel {
    animation: hg-sheet-slide-out-to-right 300ms ease-in-out both;
}

@media (prefers-reduced-motion: reduce) {
    .hg-sheet-backdrop,
    .hg-sheet-panel,
    .hg-sheet-root.is-closing .hg-sheet-backdrop,
    .hg-sheet-root.is-closing .hg-sheet-panel {
        animation: none;
    }
}

.hg-sheet-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 0.125rem;
    background: transparent;
    color: var(--hg-foreground);
    opacity: 0.7;
    cursor: pointer;
}

.hg-sheet-close:hover {
    opacity: 1;
}

.hg-sheet-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 3.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--hg-border);
    flex-shrink: 0;
    background: var(--hg-background);
}

.hg-sheet-header-icon {
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    padding: 0.5rem;
    color: var(--hg-primary);
    flex-shrink: 0;
    line-height: 0;
}

.hg-sheet-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hg-sheet-title--plain {
    letter-spacing: normal;
    text-transform: none;
}

.hg-sheet-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-sheet-subtitle--meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 0.75rem;
    margin-top: 0.25rem;
}

.hg-sheet-meta-strong {
    color: var(--hg-foreground);
}

.hg-sheet-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.hg-sheet-scroll-inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hg-sheet-totalizers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-sheet-block {
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    background: var(--hg-card);
    padding: 1.25rem;
}

.hg-sheet-block-title {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--hg-foreground);
}

.hg-sheet-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-sheet-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .hg-sheet-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hg-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in oklch, var(--hg-muted) 30%, transparent);
    flex-shrink: 0;
}

.hg-sheet-panel .hg-field {
    gap: 0.375rem;
}

.hg-sheet-panel .hg-required {
    color: var(--hg-destructive);
}

/* Alias legado (outros drawers / refs) */
.hg-drawer-campanha {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--hg-background);
    box-shadow: -12px 0 40px rgb(0 0 0 / 0.15);
    overflow: hidden;
}

@media (min-width: 768px) {
    .hg-drawer-campanha {
        width: 75vw;
    }
}

.hg-drawer-campanha-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 3.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--hg-border);
    flex-shrink: 0;
}

.hg-drawer-campanha-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.hg-drawer-campanha-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-drawer-campanha-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hg-drawer-campanha-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--hg-border);
    flex-shrink: 0;
    background: color-mix(in oklch, var(--hg-muted) 30%, transparent);
}

.hg-drawer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    background: var(--hg-card);
    padding: 1.25rem;
}

.hg-drawer-section-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--hg-foreground);
}

.hg-drawer-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .hg-drawer-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hg-drawer-table-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hg-border);
}

.hg-drawer-table-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-drawer-table-header .hg-text-xs {
    margin: 0.125rem 0 0;
}

.hg-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hg-table-scroll .hg-table--campanhas {
    min-width: 68rem;
}

.hg-table-scroll .hg-table th.hg-table-cell-num,
.hg-table-scroll .hg-table td.hg-table-cell-num {
    text-align: right;
}

.hg-multi-checks {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 8rem;
    overflow: auto;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    background: var(--hg-card);
}

.hg-inline-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.hg-switch-row {
    height: 2.5rem;
}

.hg-checkbox-row--start {
    align-items: flex-start;
}

.hg-mt-2 {
    margin-top: 0.5rem;
}

.hg-block {
    display: block;
}

.hg-text-danger {
    color: var(--hg-destructive, #dc2626);
    font-weight: 500;
}

.hg-btn-danger,
.hg-btn.hg-btn-danger {
    background: var(--hg-destructive, #dc2626);
    color: #fff;
    border-color: transparent;
}

.hg-btn-danger:hover,
.hg-btn.hg-btn-danger:hover,
.hg-btn-danger:focus,
.hg-btn.hg-btn-danger:focus {
    filter: brightness(0.92);
}

.hg-btn-danger:disabled,
.hg-btn.hg-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hg-btn:disabled,
.hg-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.hg-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hg-modal-delete-campanha {
    max-width: 28rem;
}

/* Largura dos diálogos de confirmação. Mesma medida do de campanha, com nome
   que não amarra ao módulo — aquele pode migrar para cá quando for tocado. */
.hg-modal-confirm {
    max-width: 28rem;
}

.hg-modal-heading--danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-modal-icon-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    background: color-mix(in oklch, var(--hg-destructive, #dc2626) 10%, transparent);
    color: var(--hg-destructive, #dc2626);
}
.hg-modal-icon-danger.is-neutral {
    background: color-mix(in oklch, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
}
.hg-ps-confirm-modal { max-width: 26rem; }

.hg-delete-option-box {
    border: 1px solid var(--hg-border);
    border-radius: 0.5rem;
    background: color-mix(in oklch, var(--hg-muted) 30%, transparent);
    padding: 0.75rem;
}

.hg-delete-option-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

/* ——— Protótipo: filtros com ícone + dialog Eventos ——— */
.hg-input-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.hg-input-icon-wrap--grow {
    display: flex;
    width: 100%;
    min-width: 220px;
}

.hg-input-icon-wrap--grow .hg-input {
    flex: 1;
    min-width: 0;
}

.hg-input-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--hg-muted-foreground);
    pointer-events: none;
    z-index: 1;
}

.hg-input--icon,
.hg-select.hg-input--icon {
    padding-left: 2rem;
}

.hg-select--w64 {
    min-width: 16rem;
}

.hg-filters--monitor .hg-legend--end {
    margin-left: auto;
}

.hg-modal-title--icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-modal-footer--between {
    justify-content: space-between;
}

.hg-modal-footer--end {
    justify-content: flex-end;
}

.hg-text-danger { color: #b91c1c !important; }

.hg-bloqueio-detail-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.hg-bloqueio-detail-row strong {
    font-size: 0.875rem;
    color: #0f172a;
}

.hg-bloqueio-detail-obs {
    border-radius: 0.5rem;
    background: #f8fafc;
    padding: 0.75rem;
}

.hg-bloqueio-detail-obs p {
    margin: 0;
    font-size: 0.875rem;
    color: #334155;
}

.hg-bloqueio-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.hg-legend-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
}

.hg-modal-filtros {
    width: min(42rem, calc(100vw - 2rem));
    /* Sem repetir a largura em max-width, o `max-width: 28rem` de .hg-modal
       clampa este modal e o width de 42rem acima nunca vale — os campos de duas
       colunas ficam cortados, com barra de rolagem horizontal. */
    max-width: min(42rem, calc(100vw - 2rem));
    max-height: min(90vh, 52rem);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.hg-modal-body--scroll {
    overflow-y: auto;
    max-height: 70vh;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hg-filter-block {
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-card);
    padding: 1rem;
}

.hg-filter-block-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.hg-filter-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .hg-filter-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.hg-modal-footer--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in oklch, var(--hg-muted) 40%, transparent);
}

.hg-btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--hg-foreground);
    text-decoration: underline;
}

.hg-btn-link--danger {
    color: var(--hg-destructive, #dc2626);
}

.hg-multiselect {
    position: relative;
}

.hg-multiselect-trigger {
    display: flex;
    width: 100%;
    height: 2.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-input);
    background: var(--hg-background, var(--hg-card));
    padding: 0 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.hg-multiselect-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.hg-multiselect-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--hg-foreground);
}

.hg-multiselect-option:hover,
.hg-multiselect-option.is-selected {
    background: color-mix(in oklch, var(--hg-primary) 6%, transparent);
}

.hg-text-muted {
    color: var(--hg-muted-foreground);
}

/* Status da Campanha — igual ao protótipo (soft compareceu / muted) */
.hg-badge-campanha-ativa {
    background: var(--hg-status-compareceu-bg);
    color: var(--hg-status-compareceu);
    border-color: var(--hg-status-compareceu-border);
}

.hg-badge-campanha-inativa {
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    border-color: var(--hg-border);
}

.hg-badge-dot--compareceu {
    background: var(--hg-status-compareceu);
}

.hg-badge-dot--muted {
    background: var(--hg-muted-foreground);
}

/* Dashboard charts */
.hg-dash-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-dash-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.hg-dash-section-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--hg-foreground);
}

.hg-dash-section-lead {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--hg-muted-foreground);
}

.hg-dash-indicators-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-height: 14rem;
    padding: 2rem 1.25rem;
    text-align: center;
}

.hg-dash-indicators-loading-text {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
}

.hg-dash-charts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.hg-dash-chart-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    min-width: 0;
    padding: 1.35rem 1.35rem 1rem;
    border: 1px solid var(--hg-border) !important;
    border-radius: calc(var(--hg-radius) + 2px);
    background: var(--hg-card);
    box-shadow: 0 8px 24px rgb(15 23 42 / 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hg-dash-chart-card:hover {
    border-color: var(--hg-border) !important;
    box-shadow: 0 14px 36px rgb(15 23 42 / 0.1);
    transform: translateY(-2px);
}

.hg-dash-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.hg-dash-chart-head-text {
    min-width: 0;
}

.hg-dash-chart-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--hg-foreground);
}

.hg-dash-chart-subtitle {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--hg-muted-foreground);
}

.hg-dash-chart-total {
    text-align: right;
    flex-shrink: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.75rem;
    background: var(--hg-muted);
}

.hg-dash-chart-total-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--hg-foreground);
}

.hg-dash-chart-total-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-dash-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.hg-dash-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.65rem;
    background: #fff;
    min-width: 0;
}

.hg-dash-kpi-value {
    font-size: 0.95rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    color: var(--hg-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-dash-kpi-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
}

.hg-dash-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.hg-dash-insight {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.55rem;
    background: #fff;
}

.hg-dash-insight-label {
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hg-muted-foreground);
}

.hg-dash-insight-value {
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--hg-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-dash-chart-body {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1.1rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--hg-muted) 55%, white);
}

.hg-dash-ring-wrap {
    position: relative;
    width: 8.5rem;
    height: 8.5rem;
}

.hg-dash-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 10px rgb(15 23 42 / 0.08));
}

.hg-dash-ring-track,
.hg-dash-ring-slice {
    fill: none;
    stroke-width: 12;
    stroke-linecap: butt;
}

.hg-dash-ring-track {
    stroke: #e8eaef;
}

.hg-dash-ring-slice {
    transition: stroke-dasharray 0.45s ease;
}

.hg-dash-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
    padding: 0.85rem;
}

.hg-dash-ring-center-value {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--hg-foreground);
}

.hg-dash-ring-center-label {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    line-height: 1.2;
    font-weight: 550;
    color: var(--hg-muted-foreground);
    max-width: 4.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-dash-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.hg-dash-legend-item {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr) 3.5rem auto;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    color: var(--hg-muted-foreground);
}

.hg-dash-legend-item.is-muted {
    opacity: 0.4;
}

.hg-dash-legend-item.is-top .hg-dash-legend-label {
    font-weight: 700;
}

.hg-dash-legend-swatch {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 9999px;
}

.hg-dash-legend-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hg-foreground);
}

.hg-dash-legend-bar {
    height: 0.35rem;
    border-radius: 9999px;
    background: #e8eaef;
    overflow: hidden;
}

.hg-dash-legend-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 0;
}

.hg-dash-legend-value {
    font-weight: 750;
    color: var(--hg-foreground);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 1.25rem;
}

.hg-dash-legend-empty {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-dash-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--hg-border);
}

.hg-dash-bars-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hg-muted-foreground);
}

.hg-dash-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hg-dash-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--hg-muted-foreground);
}

.hg-dash-bar-meta strong {
    color: var(--hg-foreground);
    font-variant-numeric: tabular-nums;
}

.hg-dash-bar-track {
    height: 0.55rem;
    border-radius: 9999px;
    background: #e8eaef;
    border: 1px solid var(--hg-border);
    overflow: hidden;
}

.hg-dash-bar-fill {
    height: 100%;
    border-radius: inherit;
    min-width: 0;
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.hg-dash-chart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: auto;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--hg-border);
    border-radius: 0.65rem;
    font-size: 0.8rem;
    font-weight: 650;
    text-decoration: none;
    color: var(--hg-foreground);
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.hg-dash-chart-link:hover,
.hg-dash-chart-link:focus-visible {
    background: var(--hg-muted);
    border-color: var(--hg-border);
    color: var(--hg-foreground);
}

@media (max-width: 1100px) {
    .hg-dash-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hg-dash-chart-body {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .hg-dash-legend {
        width: 100%;
    }

    .hg-dash-legend-item {
        grid-template-columns: 0.55rem minmax(0, 1fr) auto;
    }

    .hg-dash-legend-bar {
        display: none;
    }

    .hg-dash-footer {
        flex-direction: column;
        text-align: center;
    }
}

.hg-dash-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--hg-border);
}

.hg-dash-footer-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-dash-footer-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    border: 1px solid var(--hg-border);
    border-radius: 0.65rem;
    background: var(--hg-card);
    color: var(--hg-foreground);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.hg-dash-footer-top:hover,
.hg-dash-footer-top:focus-visible {
    background: var(--hg-muted);
}


/* —— Pesquisa de Satisfação (mock) —— */
.hg-nav-nested { display: flex; flex-direction: column; gap: 2px; }
.hg-nav-nested-btn { width: 100%; justify-content: flex-start; font-family: inherit; border: none; background: transparent; box-sizing: border-box; cursor: pointer; }
/* O ícone de coração (Pesquisa de Satisfação) tem bem mais espaço vazio à
   direita dentro do próprio desenho do que os outros ícones da sidebar — com
   o mesmo `gap` do texto, fica com uma distância maior mesmo sem o CSS mudar.
   Corrige só aqui, sem tocar no gap padrão usado pelos outros itens. */
.hg-nav-nested-btn--heart > span { margin-left: -13px; }
.hg-nav-nested-chevron { margin-left: auto; transition: transform .15s ease; }
.hg-nav-nested-chevron.is-open { transform: rotate(90deg); }
.hg-nav-nested-sub { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; margin-top: 2px; }
.hg-nav-nested-link { font-size: 12.5px; }

.hg-ps-page { gap: 20px; }
.hg-ps-header { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hg-ps-header-with-icon { display: flex; gap: 12px; align-items: flex-start; }
.hg-ps-page-icon { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); display: grid; place-items: center; font-size: 18px; }
.hg-ps-title { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; color: #0f172a; }
.hg-ps-subtitle { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.hg-ps-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hg-ps-btn-outline,
.hg-ps-header-actions .hg-btn,
.hg-ps-card-head .hg-btn {
    font-weight: 500 !important;
}
.hg-ps-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hg-ps-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .hg-ps-kpis, .hg-ps-kpis--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hg-ps-kpi { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 16px; }
.hg-ps-kpi--accent { border-color: color-mix(in srgb, var(--hg-primary) 30%, #e2e8f0); background: color-mix(in srgb, var(--hg-primary) 5%, white); }
.hg-ps-kpi--danger { border-color: color-mix(in srgb, #ef4444 30%, #e2e8f0); }
.hg-ps-kpi--amber { border-color: #fde68a; }
.hg-ps-kpi--emerald { border-color: #a7f3d0; }
.hg-ps-kpi--row { display: flex; align-items: center; gap: 12px; }
.hg-ps-kpi-icon { width: 40px; height: 40px; border-radius: 10px; background: #f1f5f9; display: grid; place-items: center; color: #64748b; }
.hg-ps-kpi-icon.tone-red { background: #fef2f2; color: #dc2626; }
.hg-ps-kpi-icon.tone-amber { background: #fffbeb; color: #d97706; }
.hg-ps-kpi-icon.tone-emerald { background: #ecfdf5; color: #059669; }
.hg-ps-kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #64748b; }
.hg-ps-kpi--accent .hg-ps-kpi-label svg { color: var(--hg-primary); }
.hg-ps-kpi--danger .hg-ps-kpi-label svg { color: #dc2626; }
.hg-ps-kpi-value { font-size: 28px; font-weight: 650; margin-top: 4px; color: #0f172a; line-height: 1; }

.hg-ps-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .hg-ps-layout { grid-template-columns: 1fr; } }
.hg-ps-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hg-ps-side { display: flex; flex-direction: column; gap: 12px; }
.hg-ps-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden; }
.hg-ps-card-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.hg-ps-card-pad { padding: 16px 20px 8px; }
.hg-ps-filters-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; overflow: visible; }
.hg-ps-side-card { padding: 16px; }
.hg-ps-side-card h3, .hg-ps-section-title { margin: 0 0 4px; font-size: 14px; font-weight: 650; color: #0f172a; }
.hg-ps-muted { margin: 0 0 12px; font-size: 12px; color: #64748b; }

.hg-ps-search { position: relative; }
.hg-ps-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.hg-ps-search input { width: 100%; height: 36px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0 12px 0 32px; font-size: 13px; background: #fff; }
.hg-ps-search--grow { flex: 1; min-width: 220px; }
.hg-ps-chip-filters { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.hg-ps-chip-group { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hg-ps-chip-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.hg-ps-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hg-ps-chip { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; font-size: 12px; color: #334155; cursor: pointer; }
.hg-ps-chip.is-on { background: var(--hg-primary); border-color: var(--hg-primary); color: #fff; }
.hg-ps-chip--outline { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; }
.hg-ps-chip--outline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-ps-chip-chevron { opacity: .6; flex-shrink: 0; }

.hg-ps-branch-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 300px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.12); padding: 10px; }
.hg-ps-branch-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 10px; border-bottom: 1px solid #e2e8f0; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.hg-ps-branch-pop-head button { border: 0; background: transparent; color: var(--hg-primary); font-size: 11px; cursor: pointer; }
.hg-ps-branch-option { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 13px; cursor: pointer; text-align: left; }
.hg-ps-branch-option + .hg-ps-branch-option { margin-top: 2px; }
.hg-ps-branch-option:hover { background: #f1f5f9; }
.hg-ps-branch-option.is-on { background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); font-weight: 500; }

.hg-ps-date-range { display: flex; align-items: center; gap: 8px; }
.hg-ps-date-input { width: 150px; }
.hg-ps-date-sep { font-size: 12px; color: #94a3b8; }
.hg-ps-date-clear { border: 0; background: transparent; color: var(--hg-primary); font-size: 11px; cursor: pointer; padding: 0 4px; white-space: nowrap; }

.hg-ps-field-period { grid-column: span 2; min-width: 0; }
.hg-ps-date-range--report { width: 100%; }
.hg-ps-date-range--report .hg-ps-date-input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    font-size: 13px;
}
.hg-ps-date-range--report .hg-ps-date-input:focus {
    outline: none;
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hg-primary) 18%, transparent);
}

/* Relatórios usa selects nativos (padrão próprio do protótipo p/ essa página, diferente dos
   chips do Gerir Pesquisas). .hg-ps-report-filters já define display:grid/gap/padding; a
   combinação de duas classes garante especificidade maior que a regra base — uma classe só
   perderia para a ordem do arquivo, foi esse bug que espremeu as caixas antes. */
.hg-ps-report-filters.hg-ps-filter-grid { grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); padding: 0; border-bottom: 0; gap: 12px; }

.hg-ps-filter-grid .hg-label {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    font-size: 11px;
    margin-bottom: 4px;
    color: #64748b;
}
.hg-ps-filter-grid .hg-select {
    height: 36px;
    width: 100%;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    font-size: 13px;
    padding: 0 34px 0 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    -webkit-appearance: none;
}
.hg-ps-filter-grid select.hg-select::-ms-expand { display: none; }
.hg-ps-filter-grid .hg-select:focus {
    outline: none;
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hg-primary) 18%, transparent);
}

/* —— Dropdown estilizado (padrão Lovable) para os selects de filtro —— */
.hg-ps-select--inline { width: 180px; }
.hg-ps-rselect { position: relative; width: 100%; }
.hg-ps-rselect-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-width: 0 !important;
    background-image: none !important;
    cursor: pointer;
    text-align: left;
}
.hg-ps-rselect-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hg-ps-rselect-trigger svg { color: #94a3b8; flex-shrink: 0; transition: transform 150ms ease; }
.hg-ps-rselect-trigger.is-open svg { transform: rotate(180deg); }
.hg-ps-rselect-trigger.is-open {
    outline: none;
    border-color: var(--hg-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hg-primary) 18%, transparent);
}
.hg-ps-rselect-panel {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    box-shadow: 0 10px 30px rgb(15 23 42 / 0.12), 0 2px 6px rgb(15 23 42 / 0.06);
    padding: 0.25rem;
}
.hg-ps-rselect-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    font-size: 0.8125rem;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.hg-ps-rselect-option:hover { background: #f1f5f9; }
.hg-ps-rselect-option.is-selected { background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); font-weight: 500; }
.hg-ps-rselect-option svg { color: var(--hg-primary); flex-shrink: 0; }

.hg-modal-xl { max-width: 56rem; }
@media (min-width: 1200px) { .hg-modal-xl { max-width: 78rem; } }
.hg-ps-builder-body { display: flex; gap: 28px; align-items: flex-start; }
.hg-ps-builder-form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hg-ps-builder-preview { display: none; flex-shrink: 0; width: 300px; position: sticky; top: 0; }
@media (min-width: 1200px) { .hg-ps-builder-preview { display: block; } }
.hg-ps-builder-preview-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 10px; }
.hg-ps-builder-preview-hint { margin: 12px 0 0; font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 6px; }
.hg-ps-builder-section { display: flex; flex-direction: column; gap: 12px; }
.hg-ps-step-title { display: flex; align-items: center; gap: 8px; }
.hg-ps-step-title--between { justify-content: space-between; }
.hg-ps-step-title h3 { margin: 0; font-size: 14px; font-weight: 650; color: #0f172a; }
.hg-ps-step-badge { width: 22px; height: 22px; border-radius: 999px; background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }

.hg-ps-pill-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hg-ps-pill-sep { width: 1px; height: 20px; background: #e2e8f0; margin: 0 2px; }
.hg-ps-hint { margin: 0; font-size: 11px; color: #64748b; }
.hg-ps-hint--warning { color: #b45309; display: flex; align-items: center; gap: 4px; }

.hg-ps-option-cards { display: grid; gap: 10px; }
.hg-ps-option-cards--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.hg-ps-option-cards--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 720px) { .hg-ps-option-cards--2, .hg-ps-option-cards--3 { grid-template-columns: 1fr; } }
.hg-ps-option-card { text-align: left; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.hg-ps-option-card strong { font-size: 13px; color: #0f172a; }
.hg-ps-option-card span { font-size: 11px; color: #64748b; }
.hg-ps-option-card.is-active { border-color: var(--hg-primary); background: color-mix(in srgb, var(--hg-primary) 6%, white); }
.hg-ps-option-card--channel { flex-direction: row; align-items: center; gap: 8px; }
.hg-ps-option-swatch { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.hg-ps-option-swatch--nps i { display: block; flex: 1; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--hg-primary) 20%, white); font-style: normal; }
.hg-ps-option-swatch--csat { color: #fbbf24; gap: 2px; }
.hg-ps-option-swatch svg.is-emerald { color: #10b981; }
.hg-ps-option-swatch svg.is-danger { color: #ef4444; }

.hg-ps-template-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #fafafa; }
.hg-ps-template-box .hg-field { flex: 1; min-width: 220px; }
.hg-ps-template-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.hg-ps-template-badge--aprovado { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.hg-ps-template-badge--pendente { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.hg-ps-template-badge--rejeitado { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.hg-ps-template-badge-dot { position: relative; display: inline-flex; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.hg-ps-template-badge-ping { position: absolute; inset: 0; border-radius: 999px; background: currentColor; opacity: .6; animation: hg-ps-badge-ping 1.6s cubic-bezier(0,0,0.2,1) infinite; }
@keyframes hg-ps-badge-ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

.hg-ps-question-list { display: flex; flex-direction: column; gap: 10px; }
.hg-ps-question-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.hg-ps-question-row { display: flex; gap: 8px; align-items: center; }
.hg-ps-question-row .hg-input { flex: 1; }
.hg-ps-question-row .hg-ps-rselect { width: 170px; flex-shrink: 0; }
.hg-ps-question-options { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid #e2e8f0; }

.hg-ps-delay-row { display: flex; gap: 8px; align-items: center; }
.hg-ps-delay-row .hg-input { flex: 1; }
.hg-ps-delay-row .hg-select { width: 120px; flex-shrink: 0; }
.hg-ps-delay-row .hg-ps-rselect { width: 120px; flex-shrink: 0; }

.hg-ps-import-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.hg-ps-import-template-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--hg-primary); font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; }
.hg-ps-import-template-link:hover { text-decoration: underline; }
.hg-ps-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed #e2e8f0; border-radius: 10px; padding: 24px 16px; text-align: center; cursor: pointer; background: #fafafa; }
.hg-ps-dropzone:hover { border-color: var(--hg-primary); }
.hg-ps-dropzone-title { font-size: 12px; font-weight: 600; color: #0f172a; }
.hg-ps-dropzone-hint { font-size: 11px; color: #94a3b8; }
.hg-ps-dropzone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hg-ps-import-file { display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.hg-ps-import-file-icon { width: 32px; height: 32px; border-radius: 8px; background: #ecfdf5; color: #059669; display: grid; place-items: center; flex-shrink: 0; }
.hg-ps-import-file-info { flex: 1; min-width: 0; }
.hg-ps-import-file-name { font-size: 12px; font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hg-ps-table-card { overflow: auto; }
.hg-ps-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hg-ps-table th { text-align: left; padding: 10px 12px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; white-space: nowrap; background: #fafafa; }
.hg-ps-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.hg-ps-table .is-right { text-align: right; }
.hg-ps-table tr.is-clickable { cursor: pointer; }
.hg-ps-table tr.is-clickable:hover { background: #f8fafc; }
.hg-ps-camp-name { font-weight: 600; color: #0f172a; font-size: 13px; }
.hg-ps-camp-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.hg-ps-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.hg-ps-kind--like { gap: 2px; }
svg.is-emerald { color: #10b981; }
svg.is-danger { color: #ef4444; }
.hg-ps-kind-star { color: #fbbf24; }
.hg-ps-empty { text-align: center; color: #64748b; padding: 28px !important; }
.hg-ps-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hg-ps-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.hg-ps-badge--ativa { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.hg-ps-badge--pausada { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.hg-ps-badge--rascunho { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.hg-ps-badge--encerrada, .hg-ps-badge--aberto { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.hg-ps-badge--resolvido { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.hg-ps-resultado { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.hg-ps-resultado-score { font-size: 16px; font-weight: 700; color: #0f172a; }
.hg-ps-resultado-score.is-md { font-size: 28px; }
.hg-ps-resultado-body { flex: 1; min-width: 0; }
.hg-ps-resultado-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: #e2e8f0; }
.hg-ps-resultado-bar span { display: block; height: 100%; }
.hg-ps-resultado-hint { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.hg-ps-stars { display: flex; gap: 2px; color: #cbd5e1; }
.hg-ps-stars svg.is-on { color: #fbbf24; }
.hg-ps-score-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.hg-ps-score-sub { font-size: 10px; color: #94a3b8; }
.hg-ps-badge--icon { display: inline-flex; align-items: center; gap: 4px; }
.hg-ps-resultado--like { gap: 12px; }
.hg-ps-resultado--like .is-pos { display: inline-flex; align-items: center; gap: 4px; color: #059669; font-weight: 700; font-size: 13px; }
.hg-ps-resultado--like .is-neg { display: inline-flex; align-items: center; gap: 4px; color: #64748b; font-size: 12px; }

.hg-ps-icon-actions { display: flex; justify-content: flex-end; gap: 2px; }
.hg-ps-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #64748b; cursor: pointer; }
.hg-ps-icon-btn:hover { background: #f1f5f9; color: #334155; }
.hg-ps-icon-btn.is-danger { color: #dc2626; }

.hg-ps-attention-item { display: flex; gap: 8px; margin-top: 10px; font-size: 12px; }
.hg-ps-attention-icon { display: flex; margin-top: 1px; color: #f59e0b; flex-shrink: 0; }
.hg-ps-attention-name { font-weight: 600; color: #0f172a; }
.hg-ps-attention-meta { color: #64748b; }
.hg-ps-mix-row { display: flex; justify-content: space-between; font-size: 12px; margin-top: 8px; }
.hg-ps-mix-track { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.hg-ps-mix-fill { height: 100%; background: var(--hg-primary); border-radius: 99px; }
.hg-ps-mix-fill.is-emerald { background: #10b981; }

.hg-ps-detail-hero { padding: 20px; }
.hg-ps-detail-hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hg-ps-detail-identity { display: flex; gap: 12px; align-items: flex-start; }
.hg-ps-avatar { width: 48px; height: 48px; border-radius: 12px; background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); display: grid; place-items: center; font-weight: 700; }
.hg-ps-detail-name { margin: 0; font-size: 20px; font-weight: 650; }
.hg-ps-detail-meta { margin-top: 4px; font-size: 12px; color: #64748b; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hg-ps-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 20px; }
@media (max-width: 900px) { .hg-ps-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.hg-ps-metric { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.hg-ps-metric--danger { border-color: color-mix(in srgb, #ef4444 30%, #e2e8f0); }
.hg-ps-metric-value { font-size: 24px; font-weight: 650; }
.hg-ps-metric-label { font-size: 12px; font-weight: 600; margin-top: 2px; }
.hg-ps-metric-hint { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.hg-ps-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 900px) { .hg-ps-info-grid { grid-template-columns: 1fr; } }
.hg-ps-info-box { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fafafa; }
.hg-ps-info-box strong { display: block; font-size: 13px; color: #0f172a; }
.hg-ps-info-box span { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.hg-ps-branch-perf { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.hg-ps-report-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.hg-ps-report-toolbar-right { display: flex; gap: 10px; align-items: center; }
.hg-ps-tabs { display: inline-flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.hg-ps-tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; color: #64748b; }
.hg-ps-tab.is-active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.hg-ps-status-timeline, .hg-ps-insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hg-ps-status-timeline li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.hg-ps-status-timeline li > div { display: flex; flex-direction: column; gap: 2px; }
.hg-ps-insights li { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.hg-ps-status-timeline strong, .hg-ps-insights strong { color: #0f172a; }
.hg-ps-status-timeline span, .hg-ps-insights span { color: #64748b; }
.hg-ps-timeline-icon { flex-shrink: 0; margin-top: 1px; color: #10b981; }
.hg-ps-alert-count { margin: 8px 0 4px; color: #d97706; }
.hg-ps-owner { margin-top: 10px; font-size: 13px; }
.hg-ps-icon-line { display: flex; align-items: center; gap: 6px; }

.hg-ps-inline-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hg-ps-select { width: 180px; }
.hg-ps-score-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #f8fafc; border: 1px solid #e2e8f0; font-weight: 600; font-size: 11px; }
.hg-ps-score-pill--icon { gap: 4px; }
.hg-ps-score-pill.is-bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.hg-ps-score-pill.is-mid { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.hg-ps-score-pill.is-good { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.hg-ps-report-filters { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
@media (max-width: 1200px) { .hg-ps-report-filters { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.hg-ps-report-kpis { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
@media (max-width: 1100px) { .hg-ps-report-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.hg-ps-report-kpi { display: flex; gap: 10px; align-items: center; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; background: #fafafa; }
.hg-ps-report-kpi-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.hg-ps-report-kpi-icon.tone-blue { background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); }
.hg-ps-report-kpi-icon.tone-primary { background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); }
.hg-ps-report-kpi-icon.tone-emerald { background: #ecfdf5; color: #059669; }
.hg-ps-report-kpi-icon.tone-amber { background: #fffbeb; color: #d97706; }
.hg-ps-report-kpi-icon.tone-red { background: #fef2f2; color: #dc2626; }
.hg-ps-report-kpi-value { font-size: 18px; font-weight: 650; line-height: 1; }
.hg-ps-report-kpi-label { font-size: 11px; color: #64748b; margin-top: 4px; }
.hg-ps-dist-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; padding: 16px 20px 20px; }
@media (max-width: 1100px) { .hg-ps-dist-layout { grid-template-columns: 1fr; } }
.hg-ps-dist-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; background: #fafafa; }
.hg-ps-dist-grid { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 20px; align-items: center; margin-top: 12px; }
@media (max-width: 800px) { .hg-ps-dist-grid { grid-template-columns: 1fr; } }
.hg-ps-dist-bars { display: flex; flex-direction: column; gap: 10px; }
.hg-ps-donut-wrap { text-align: center; }
.hg-ps-donut { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; }
.hg-ps-donut-hole { width: 96px; height: 96px; border-radius: 50%; background: #fafafa; display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.hg-ps-donut-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.hg-ps-donut-chips span { border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px 6px; font-size: 10px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; background: #fff; }
.hg-ps-donut-chips i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.hg-ps-ranking { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hg-ps-ranking li { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.hg-ps-ranking strong { display: block; font-size: 13px; }
.hg-ps-ranking span { font-size: 11px; color: #64748b; }
.hg-ps-featured { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #fafafa; }
.hg-ps-featured p { margin: 0 0 8px; font-size: 13px; }
.hg-ps-featured-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* —— Sheets / drawers Pesquisa Satisfação (protótipo) —— */
.hg-ps-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    justify-content: flex-end;
    background: rgb(0 0 0 / 0.8);
    overscroll-behavior: contain;
}
.hg-ps-sheet-overlay--top { z-index: 100001; }

body:has(.hg-ps-sheet-overlay),
html:has(.hg-ps-sheet-overlay) {
    overflow: hidden !important;
}

.hg-ps-sheet {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -12px 0 40px rgb(0 0 0 / 0.15);
    overflow: hidden;
    animation: hg-sheet-slide-in-from-right 500ms ease-in-out both;
}
.hg-ps-sheet--lg { max-width: 42rem; } /* sm:max-w-2xl */
.hg-ps-sheet--md { max-width: 36rem; } /* sm:max-w-xl */
.hg-ps-sheet--xl { max-width: 85vw; }
@media (min-width: 1024px) { .hg-ps-sheet--xl { max-width: 82vw; } }
@media (min-width: 1280px) { .hg-ps-sheet--xl { max-width: 80vw; } }
@media (max-width: 900px) { .hg-ps-sheet--xl { max-width: 100vw; } }

.hg-ps-sheet-x {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0.75;
}
.hg-ps-sheet-x:hover { opacity: 1; background: #f1f5f9; color: #0f172a; }
.hg-ps-sheet-x.is-static {
    position: static;
    margin-left: auto;
    flex-shrink: 0;
}
.hg-ps-sheet-head {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-right: 3rem;
}
.hg-ps-sheet-head-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.hg-ps-sheet-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #64748b;
}
.hg-ps-sheet-avatar.is-danger { background: color-mix(in srgb, #ef4444 12%, white); color: #dc2626; }
.hg-ps-sheet-avatar.is-primary { background: color-mix(in srgb, var(--hg-primary) 12%, white); color: var(--hg-primary); }
.hg-ps-sheet-avatar.is-round { border-radius: 999px; }
.hg-ps-sheet-head-copy { min-width: 0; flex: 1; }
.hg-ps-sheet-head-copy h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}
.hg-ps-sheet-head-copy > p {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}
.hg-ps-sheet-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.hg-ps-sheet-head-meta { margin-top: 0.375rem; font-size: 0.75rem; color: #64748b; }
.hg-ps-sheet-head-meta strong { color: #0f172a; }

/* —— Alerta / "Tratar cliente" (reformulado, paridade Lovable) —— */
.hg-ps-alert-head {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem 1rem;
    padding-right: 3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}
.hg-ps-alert-head-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.hg-ps-alert-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: color-mix(in srgb, #ef4444 12%, white);
    color: #dc2626;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.hg-ps-alert-name { margin: 0; font-size: 1.0625rem; font-weight: 600; color: #0f172a; line-height: 1.3; }
.hg-ps-alert-tag {
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.hg-ps-alert-head-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem 0; }
@media (min-width: 768px) { .hg-ps-alert-head-grid { grid-template-columns: 1fr 1fr; } }
.hg-ps-alert-head-col { min-width: 0; }
@media (min-width: 768px) {
    .hg-ps-alert-head-col { padding-right: 1.5rem; }
    .hg-ps-alert-head-col--divide { padding-right: 0; padding-left: 1.5rem; border-left: 1px solid #e2e8f0; }
}
.hg-ps-alert-kicker { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 600; margin-bottom: 0.5rem; }

.hg-ps-alert-dl { display: grid; grid-template-columns: 1fr; gap: 0.375rem 1rem; }
@media (min-width: 480px) { .hg-ps-alert-dl { grid-template-columns: 1fr 1fr; } }
.hg-ps-alert-lv { display: flex; align-items: baseline; gap: 0.375rem; min-width: 0; }
.hg-ps-alert-lv span { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; font-weight: 600; flex-shrink: 0; }
.hg-ps-alert-lv strong { font-size: 0.8125rem; font-weight: 500; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hg-ps-alert-resposta-mini { display: flex; align-items: center; gap: 0.75rem; }
.hg-ps-alert-resposta-mini-copy { min-width: 0; }
.hg-ps-alert-resposta-mini-title { font-size: 0.8125rem; font-weight: 500; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-ps-alert-resposta-mini-sub { font-size: 0.75rem; color: #64748b; margin-top: 0.125rem; }

.hg-ps-alert-divider { height: 1px; background: #e2e8f0; margin: 1rem 0 0.75rem; }
.hg-ps-alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.hg-ps-btn-resolve { border-color: color-mix(in srgb, #10b981 60%, transparent) !important; color: #059669 !important; }
.hg-ps-btn-resolve:hover { background: color-mix(in srgb, #10b981 10%, white) !important; color: #059669 !important; }

.hg-ps-alert-body { flex: 1; min-height: 0; display: flex; background: #f8fafc; }
.hg-ps-alert-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 1rem; overflow: hidden; }
.hg-ps-alert-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 1024px) { .hg-ps-alert-cols { grid-template-columns: 1fr 1fr; } }
.hg-ps-alert-wa-col { min-height: 0; display: flex; flex-direction: column; }
.hg-ps-alert-panel-col { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.hg-ps-alert-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.25rem; }
.hg-ps-tratativa-textarea { min-height: 12rem; }

.hg-ps-wa-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 0.75rem; border: 1px solid #e2e8f0; background: #fff; overflow: hidden; }
.hg-ps-wa-panel-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-size: 0.875rem; font-weight: 600; color: #0f172a; }
.hg-ps-wa-panel-head svg:first-child { color: #25d366; flex-shrink: 0; }
.hg-ps-wa-panel-online { margin-left: auto; display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; font-weight: 400; color: #059669; }
.hg-ps-wa-panel-online span { width: 0.375rem; height: 0.375rem; border-radius: 999px; background: #10b981; }
.hg-ps-wa-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; background: #efe6dc; }
.hg-ps-wa-panel-foot { border-top: 1px solid #e2e8f0; background: #fff; padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.hg-ps-wa-panel-foot .hg-input { flex: 1; min-width: 0; }
.hg-ps-wa-send-btn { background: #10b981 !important; border-color: #10b981 !important; color: #fff !important; }
.hg-ps-wa-send-btn:hover { background: #059669 !important; border-color: #059669 !important; }
.hg-ps-wa-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.hg-ps-panel-card { border-radius: 0.75rem; border: 1px solid #e2e8f0; background: #fff; overflow: hidden; margin-bottom: 0.75rem; }
.hg-ps-panel-card:last-child { margin-bottom: 0; }
.hg-ps-panel-card-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-size: 0.875rem; font-weight: 600; color: #0f172a; }
.hg-ps-panel-card-meta { margin-left: auto; font-size: 0.75rem; color: #64748b; font-weight: 400; }
.hg-ps-panel-card-action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    color: var(--hg-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}
.hg-ps-panel-card-action:hover { text-decoration: underline; }
.hg-ps-panel-card-body { padding: 1rem; }
.hg-ps-icon-primary { color: var(--hg-primary); }
.hg-ps-icon-danger { color: #dc2626; }

.hg-ps-row-kv { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.hg-ps-row-kv:last-child { border-bottom: 0; }
.hg-ps-row-kv span { font-size: 0.75rem; color: #64748b; min-width: 6.5rem; flex-shrink: 0; }
.hg-ps-row-kv strong { font-size: 0.8125rem; font-weight: 500; color: #0f172a; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hg-ps-alert-rail { width: 3.5rem; flex-shrink: 0; border-left: 1px solid #e2e8f0; background: #fff; display: flex; flex-direction: column; align-items: center; padding: 0.75rem 0; gap: 0.25rem; }
.hg-ps-alert-rail-btn { position: relative; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 0.5rem; background: transparent; color: #64748b; display: grid; place-items: center; cursor: pointer; }
.hg-ps-alert-rail-btn:hover { background: #f1f5f9; color: #0f172a; }
.hg-ps-alert-rail-btn.is-active { background: color-mix(in srgb, var(--hg-primary) 10%, white); color: var(--hg-primary); }
.hg-ps-alert-rail-btn.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.5rem;
    border-radius: 2px 0 0 2px;
    background: var(--hg-primary);
}

.hg-ps-sheet-scroll {
    flex: 1;
    overflow: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hg-ps-block h3 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}
.hg-ps-block h3 span {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: #64748b;
}
.hg-ps-block-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.hg-ps-block-head h3 { margin: 0; }
.hg-ps-block-head span { font-size: 0.75rem; color: #64748b; }

.hg-ps-panel {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
}
.hg-ps-panel--form { display: flex; flex-direction: column; gap: 0.75rem; }
.hg-ps-why-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.8125rem; color: #334155; }
.hg-ps-why-list li { display: flex; gap: 8px; }
.hg-ps-why-list strong { color: #0f172a; }
.hg-ps-why-dot { color: #94a3b8; flex-shrink: 0; }
.hg-ps-why-list li.is-danger .hg-ps-why-dot { color: #dc2626; }

.hg-ps-score-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.hg-ps-score-line > span { font-size: 0.75rem; color: #64748b; }
.hg-ps-score-round {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.hg-ps-score-round.is-bad { background: #fef2f2; color: #b91c1c; }
.hg-ps-score-round.is-mid { background: #fffbeb; color: #b45309; }
.hg-ps-score-round.is-good { background: #ecfdf5; color: #047857; }

.hg-ps-stars-row { display: flex; gap: 0.125rem; color: #cbd5e1; }
.hg-ps-stars-row .is-on,
.hg-ps-stars-row svg.is-on { color: #fbbf24; }

.hg-ps-quote {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background: #f8fafc;
    font-size: 0.875rem;
    color: #334155;
}
.hg-ps-quote svg { color: #94a3b8; margin-top: 0.125rem; flex-shrink: 0; }
.hg-ps-quote p { margin: 0; white-space: pre-wrap; }

.hg-ps-inline-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 0.75rem;
}
.hg-ps-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    color: var(--hg-primary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}
.hg-ps-text-link:hover { text-decoration: underline; }

.hg-ps-form-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.hg-ps-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.hg-ps-form-footer > p {
    margin: 0;
    font-size: 0.6875rem;
    color: #64748b;
    flex: 1;
    min-width: 10rem;
}
.hg-ps-form-footer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.hg-ps-btn-wa {
    display: inline-flex !important;
    align-items: center;
    gap: 0.375rem;
    border-color: color-mix(in srgb, #25d366 40%, transparent) !important;
    color: #128c7e !important;
    background: #fff !important;
}
.hg-ps-btn-wa:hover {
    background: color-mix(in srgb, #25d366 10%, white) !important;
    color: #128c7e !important;
}
.hg-ps-btn-wa svg { color: #25d366; }

.hg-ps-empty-dashed {
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
}

.hg-ps-timeline {
    position: relative;
    list-style: none;
    margin: 0 0 0 0.5rem;
    padding: 0;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.hg-ps-timeline > li {
    position: relative;
    margin-left: 1rem;
}
.hg-ps-timeline-dot {
    position: absolute;
    left: -1.375rem;
    top: 0.875rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: var(--hg-primary);
}
.hg-ps-timeline-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.75rem;
}
.hg-ps-timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hg-ps-timeline-who {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #0f172a;
}
.hg-ps-timeline-who svg { color: #94a3b8; }
.hg-ps-timeline-who span { color: #64748b; font-weight: 400; }
.hg-ps-timeline-card > p {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #334155;
    white-space: pre-wrap;
}

.hg-ps-hint {
    margin: 0;
    width: 100%;
    font-size: 0.6875rem;
    color: #64748b;
}

.hg-ps-info-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.hg-ps-kicker {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.hg-ps-main-score {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}
.hg-ps-main-score small {
    font-size: 0.75rem;
    font-weight: 400;
    color: #64748b;
}
.hg-ps-main-score.is-sm { font-size: 0.875rem; font-weight: 500; }
.hg-ps-main-score.is-good { color: #059669; font-size: 0.875rem; }
.hg-ps-main-score.is-bad { color: #dc2626; font-size: 0.875rem; }
.hg-ps-main-score--icon { display: inline-flex; align-items: center; gap: 6px; }

.hg-ps-contact-item { display: flex; align-items: center; gap: 6px; }

.hg-ps-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #334155;
}
.hg-ps-answers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.hg-ps-answers li {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background: #fff;
}
.hg-ps-answers strong { display: block; font-size: 0.75rem; color: #0f172a; }
.hg-ps-answers p { margin: 0.25rem 0 0; font-size: 0.75rem; color: #64748b; white-space: pre-wrap; }
.hg-ps-answer-n {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 12%, white);
    color: var(--hg-primary);
    font-size: 0.6875rem;
    font-weight: 600;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.hg-ps-muted { color: #64748b; font-size: 0.75rem; border: 0 !important; padding: 0 !important; background: transparent !important; }

.hg-ps-wa-row { display: flex; }
.hg-ps-wa-row.is-out { justify-content: flex-end; }
.hg-ps-wa-row.is-in { justify-content: flex-start; }
.hg-ps-wa-msg {
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
.hg-ps-wa-msg p { margin: 0; white-space: pre-wrap; }
.hg-ps-wa-msg span { display: block; margin-top: 0.25rem; font-size: 0.625rem; }
.hg-ps-wa-msg.is-in { background: #fff; color: #111b21; border-top-left-radius: 0; }
.hg-ps-wa-msg.is-in span { color: #667781; }
.hg-ps-wa-msg.is-out { background: #d9fdd3; color: #111b21; border-top-right-radius: 0; }
.hg-ps-wa-msg.is-out span { color: #4a7a4a; }
@media (max-width: 640px) {
    .hg-ps-sheet--lg,
    .hg-ps-sheet--md { max-width: 100%; }
    .hg-ps-form-2,
    .hg-ps-info-duo { grid-template-columns: 1fr; }
}



/* —— Tela do cliente (Relatórios) —— */
.hg-ps-client-overlay {
    padding: 1.25rem;
    z-index: 100000 !important;
}
.hg-ps-client-modal {
    width: min(28rem, 100%);
    max-width: 28rem;
    max-height: min(92vh, 860px);
    padding: 0;
    overflow: hidden;
    z-index: 100001;
}
.hg-ps-client-header {
    position: relative;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--hg-border, #e2e8f0);
}
.hg-ps-client-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--hg-foreground, #0f172a);
    line-height: 1.25;
}
.hg-ps-client-title svg { color: var(--hg-primary); flex-shrink: 0; }
.hg-ps-client-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}
.hg-ps-client-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0.7;
}
.hg-ps-client-close:hover { opacity: 1; background: #f1f5f9; color: #0f172a; }
.hg-ps-client-open {
    position: absolute;
    top: 1rem;
    right: 2.75rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 1.75rem;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.hg-ps-client-open:hover { background: #f8fafc; }
.hg-ps-client-tabs-wrap { padding: 1rem 1.5rem 0; }
.hg-ps-client-tabs {
    display: flex;
    width: 100%;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
}
.hg-ps-client-tab {
    flex: 1;
    height: 100%;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}
.hg-ps-client-tab.is-active {
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
.hg-ps-client-body {
    padding: 1.5rem;
    background: color-mix(in srgb, #f1f5f9 40%, #fff);
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.hg-ps-phone {
    margin: 0 auto;
    width: 100%;
    max-width: 24rem;
    border-radius: 2rem;
    border: 6px solid #262626;
    background: #171717;
    box-shadow: 0 20px 40px rgb(15 23 42 / 0.25);
    overflow: hidden;
}
.hg-ps-phone-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem 0.25rem;
    color: #fff;
    font-size: 10px;
    background: #171717;
}
.hg-ps-phone-status-icons { display: flex; gap: 0.25rem; align-items: center; }
.hg-ps-phone-wa-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: #075E54;
    color: #fff;
}
.hg-ps-phone-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.2);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.hg-ps-phone-wa-meta { flex: 1; min-width: 0; }
.hg-ps-phone-wa-meta strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hg-ps-phone-wa-meta span { display: block; font-size: 10px; color: rgb(255 255 255 / 0.7); }
.hg-ps-phone-generic-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; background: #334155; color: #fff; }
.hg-ps-phone-avatar.is-neutral { background: rgb(255 255 255 / 0.18); }
.hg-ps-phone-bubble--email { max-width: 92%; }
.hg-ps-phone-bubble-subject { font-size: 10px; color: #737373; margin-bottom: 4px; }
.hg-ps-phone-bubble-cta { display: inline-block; margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--hg-primary); color: #fff !important; font-size: 11px; font-weight: 600; text-decoration: none !important; }
.hg-ps-phone-extra-questions { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; border-top: 1px dashed #e5e5e5; }
.hg-ps-phone-extra-question { display: flex; flex-direction: column; gap: 6px; }
.hg-ps-phone-question.is-sm { font-size: 11px; font-weight: 500; }
.hg-ps-phone-extra-options { display: flex; flex-wrap: wrap; gap: 6px; }
.hg-ps-phone-extra-option { border: 1px solid #e5e5e5; border-radius: 999px; padding: 3px 10px; font-size: 10px; color: #404040; }
.hg-ps-phone-extra-option.is-scale { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; border-radius: 6px; }
.hg-ps-phone-extra-input { height: 28px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fafafa; }
.hg-ps-phone-chat {
    padding: 1rem 0.75rem;
    min-height: 7.5rem;
    background-color: #ECE5DD;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(0,0,0,0.03) 1px, transparent 1px),
        radial-gradient(circle at 80% 60%, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}
.hg-ps-phone-bubble {
    max-width: 85%;
    background: #fff;
    border-radius: 0.5rem;
    border-top-left-radius: 0;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
.hg-ps-phone-bubble-title {
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    margin-bottom: 2px;
}
.hg-ps-phone-bubble p {
    margin: 0;
    font-size: 12px;
    color: #262626;
    white-space: pre-wrap;
}
.hg-ps-phone-bubble a {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 11px;
    color: #047857;
    text-decoration: underline;
    word-break: break-all;
}
.hg-ps-phone-bubble-time {
    margin-top: 0.25rem;
    font-size: 9px;
    color: #737373;
    text-align: right;
}
.hg-ps-phone-landing {
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 1rem;
}
.hg-ps-phone-landing-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.75rem;
}
.hg-ps-phone-survey { display: flex; flex-direction: column; gap: 1.25rem; }
.hg-ps-phone-question {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.hg-ps-phone-question.is-center { text-align: center; margin-bottom: 0.75rem; }
.hg-ps-phone-nps {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.25rem;
}
.hg-ps-phone-nps span {
    height: 2rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
}
.hg-ps-phone-nps span.is-bad { background: #fef2f2; color: #b91c1c; }
.hg-ps-phone-nps span.is-mid { background: #fffbeb; color: #b45309; }
.hg-ps-phone-nps span.is-good { background: #ecfdf5; color: #047857; }
.hg-ps-phone-hint {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 10px;
    color: #94a3b8;
}
.hg-ps-phone-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    color: #fbbf24;
}
.hg-ps-phone-thumbs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.hg-ps-phone-thumb {
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    border: 2px solid;
    display: grid;
    place-items: center;
}
.hg-ps-phone-thumb.is-good {
    border-color: #6ee7b7;
    background: #ecfdf5;
    color: #059669;
}
.hg-ps-phone-thumb.is-bad {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #dc2626;
}
.hg-ps-phone-submit {
    width: 100%;
    border-radius: 0.375rem;
    background: var(--hg-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 0.75rem;
    text-align: center;
}

.hg-dropdown { position: relative; display: inline-flex; }
.hg-dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.12); padding: 6px; z-index: 40; }
.hg-dropdown-label { padding: 8px 10px 6px; font-size: 11px; color: #64748b; border-bottom: 1px solid #e2e8f0; margin-bottom: 4px; }
.hg-dropdown-item { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #0f172a; font-size: 13px; }
.hg-dropdown-item small { color: #94a3b8; font-size: 10px; }
.hg-dropdown-item:hover { background: #f8fafc; }

/* Dropdown Tela do cliente (Gerir pesquisas) */
.hg-ps-client-dropdown { position: relative; display: inline-flex; }
.hg-ps-client-chevron { opacity: 0.7; transition: transform .15s ease; }
.hg-ps-client-chevron.is-open { transform: rotate(180deg); }
.hg-ps-client-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 16rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    padding: 4px;
    z-index: 50;
}
.hg-ps-client-menu-label {
    padding: 8px 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
}
.hg-ps-client-menu-sep {
    height: 1px;
    background: #e2e8f0;
    margin: 2px 4px 4px;
}
.hg-ps-client-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #0f172a;
}
.hg-ps-client-menu-item svg {
    flex-shrink: 0;
    margin-top: 2px;
}
.hg-ps-client-menu-item svg.is-amber { color: #f59e0b; }
.hg-ps-client-menu-item svg.is-primary { color: var(--hg-primary); }
.hg-ps-client-menu-item svg.is-emerald { color: #059669; }
.hg-ps-client-menu-item span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.hg-ps-client-menu-item strong {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}
.hg-ps-client-menu-item small {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
}
.hg-ps-client-menu-item:hover {
    background: color-mix(in srgb, var(--hg-primary) 12%, white);
}
.hg-ps-client-menu-item:hover strong {
    color: color-mix(in srgb, var(--hg-primary) 85%, #0f172a);
}

/* =============================================================================
   Monitor de Agendamento — cores DMS (protótipo Thiago / bandeira HOND)
   Escopo: somente .hg-page--monitor-thiago (não altera o design system global).
   Espelha STATUS_CONFIG + statusStyle() de pos-vendas-agendamento-thiago.
   ============================================================================= */

.hg-page--monitor-thiago {
    /* Tokens locais da página (paridade com STATUS_CONFIG do Thiago) */
    --hg-thiago-agendado: #FFFF00;
    --hg-thiago-agendado-borda: #000000;
    --hg-thiago-agendado-texto: #000000;

    --hg-thiago-confirmado: #1E4600;
    --hg-thiago-confirmado-borda: #FFFFFF;
    --hg-thiago-confirmado-texto: #FFFFFF;

    --hg-thiago-recebido: #49A400;
    --hg-thiago-recebido-borda: #FFFFFF;
    --hg-thiago-recebido-texto: #FFFFFF;

    --hg-thiago-os-aberta: #0000CD;
    --hg-thiago-os-aberta-borda: #FFFFFF;
    --hg-thiago-os-aberta-texto: #FFFFFF;

    --hg-thiago-entrega: #633DBC;
    --hg-thiago-entrega-borda: #FFFFFF;
    --hg-thiago-entrega-texto: #FFFFFF;

    --hg-thiago-nao-compareceu: #FF0000;
    --hg-thiago-nao-compareceu-borda: #FFFFFF;
    --hg-thiago-nao-compareceu-texto: #FFFFFF;

    --hg-thiago-bloqueado: #FFA500;
    --hg-thiago-bloqueado-borda: #FFFFFF;
    --hg-thiago-bloqueado-texto: #000000;

    --hg-thiago-fora-expediente: #808080;
    --hg-thiago-fora-expediente-borda: #FFFFFF;
    --hg-thiago-fora-expediente-texto: #FFFFFF;
}

/* --- Cards Dia / Semana --- */

.hg-page--monitor-thiago .hg-agenda-agendado {
    background: var(--hg-thiago-agendado);
    color: var(--hg-thiago-agendado-texto);
    border-color: var(--hg-thiago-agendado-borda);
}

.hg-page--monitor-thiago .hg-agenda-confirmado {
    background: var(--hg-thiago-confirmado);
    color: var(--hg-thiago-confirmado-texto);
    border-color: var(--hg-thiago-confirmado-borda);
}

.hg-page--monitor-thiago .hg-agenda-compareceu,
.hg-page--monitor-thiago .hg-agenda-recebido {
    background: var(--hg-thiago-recebido);
    color: var(--hg-thiago-recebido-texto);
    border-color: var(--hg-thiago-recebido-borda);
}

.hg-page--monitor-thiago .hg-agenda-os-aberta {
    background: var(--hg-thiago-os-aberta);
    color: var(--hg-thiago-os-aberta-texto);
    border-color: var(--hg-thiago-os-aberta-borda);
}

.hg-page--monitor-thiago .hg-agenda-entrega {
    background: var(--hg-thiago-entrega);
    color: var(--hg-thiago-entrega-texto);
    border-color: var(--hg-thiago-entrega-borda);
}

.hg-page--monitor-thiago .hg-agenda-nao_compareceu {
    background: var(--hg-thiago-nao-compareceu);
    color: var(--hg-thiago-nao-compareceu-texto);
    border-color: var(--hg-thiago-nao-compareceu-borda);
}

.hg-page--monitor-thiago .hg-agenda-bloqueado {
    background: var(--hg-thiago-bloqueado);
    color: var(--hg-thiago-bloqueado-texto);
    border-color: var(--hg-thiago-bloqueado-borda);
}

.hg-page--monitor-thiago .hg-agenda-fora-expediente {
    background: var(--hg-thiago-fora-expediente);
    color: var(--hg-thiago-fora-expediente-texto);
    border-color: var(--hg-thiago-fora-expediente-borda);
}

/* Bloqueios / fora do expediente (células de bloqueio) */
.hg-page--monitor-thiago .hg-agenda-block,
.hg-page--monitor-thiago .hg-agenda-week-block {
    background: var(--hg-thiago-bloqueado);
    color: var(--hg-thiago-bloqueado-texto);
    border-color: var(--hg-thiago-bloqueado-borda);
}

.hg-page--monitor-thiago .hg-agenda-block-indisponivel,
.hg-page--monitor-thiago .hg-agenda-week-block.hg-agenda-block-indisponivel {
    background: var(--hg-thiago-fora-expediente);
    color: var(--hg-thiago-fora-expediente-texto);
    border-color: var(--hg-thiago-fora-expediente-borda);
}

/* --- Legenda (dots iguais ao statusStyle do Thiago) --- */

.hg-page--monitor-thiago .hg-legend-dot {
    border: 1px solid transparent;
    box-sizing: border-box;
}

.hg-page--monitor-thiago .hg-legend-agendado {
    background: var(--hg-thiago-agendado);
    border-color: var(--hg-thiago-agendado-borda);
}

.hg-page--monitor-thiago .hg-legend-confirmado {
    background: var(--hg-thiago-confirmado);
    border-color: var(--hg-thiago-confirmado-borda);
}

.hg-page--monitor-thiago .hg-legend-compareceu,
.hg-page--monitor-thiago .hg-legend-recebido {
    background: var(--hg-thiago-recebido);
    border-color: var(--hg-thiago-recebido-borda);
}

.hg-page--monitor-thiago .hg-legend-os-aberta {
    background: var(--hg-thiago-os-aberta);
    border-color: var(--hg-thiago-os-aberta-borda);
}

.hg-page--monitor-thiago .hg-legend-entrega {
    background: var(--hg-thiago-entrega);
    border-color: var(--hg-thiago-entrega-borda);
}

.hg-page--monitor-thiago .hg-legend-nao_compareceu {
    background: var(--hg-thiago-nao-compareceu);
    border-color: var(--hg-thiago-nao-compareceu-borda);
}

.hg-page--monitor-thiago .hg-legend-bloqueado {
    background: var(--hg-thiago-bloqueado);
    border-color: var(--hg-thiago-bloqueado-borda);
}

.hg-page--monitor-thiago .hg-legend-fora-expediente,
.hg-page--monitor-thiago .hg-legend-indisponivel {
    background: var(--hg-thiago-fora-expediente);
    border-color: var(--hg-thiago-fora-expediente-borda);
}

/* =============================================================================
   Monitor — coluna Consultor (paridade visual com protótipo Thiago)
   Escopo: .hg-page--monitor-thiago
   ============================================================================= */

.hg-page--monitor-thiago .hg-agenda-grid-consultor-head,
.hg-page--monitor-thiago .hg-agenda-week-consultor-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hg-muted-foreground);
}

.hg-page--monitor-thiago .hg-agenda-consultor-head-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: var(--hg-muted-foreground);
}

.hg-page--monitor-thiago .hg-agenda-grid-consultor {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
}

.hg-page--monitor-thiago .hg-agenda-consultor-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
}

.hg-page--monitor-thiago .hg-agenda-avatar {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-primary) 10%, transparent);
    color: var(--hg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.hg-page--monitor-thiago .hg-agenda-consultor-name,
.hg-page--monitor-thiago .hg-agenda-week-consultor-name {
    min-width: 0;
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-transform: uppercase;
    color: var(--hg-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
}

.hg-page--monitor-thiago .hg-agenda-week-consultor-inner {
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
}

/* =============================================================================
   Monitor — grade/cards da agenda (paridade visual com protótipo Thiago)
   Escopo: .hg-page--monitor-thiago
   ============================================================================= */

.hg-page--monitor-thiago .hg-agenda-grid-slot-head {
    width: var(--hg-slot-width);
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hg-muted-foreground);
}

.hg-page--monitor-thiago .hg-agenda-grid-cell,
.hg-page--monitor-thiago .hg-agenda-grid-cell-empty,
.hg-page--monitor-thiago .hg-agenda-grid-cell-span {
    padding: 0.375rem;
}

.hg-page--monitor-thiago .hg-agenda-card,
.hg-page--monitor-thiago .hg-agenda-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    height: 100%;
    min-height: calc(var(--hg-row-height) - 0.75rem);
    border-radius: 0.375rem;
    border: 1px solid;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25;
    user-select: none;
    box-sizing: border-box;
    overflow: hidden;
}

.hg-page--monitor-thiago .hg-agenda-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.hg-page--monitor-thiago .hg-agenda-card:hover {
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.12);
    transform: translateY(-1px);
}

.hg-page--monitor-thiago .hg-agenda-card-placa,
.hg-page--monitor-thiago .hg-agenda-week-card-placa {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.hg-page--monitor-thiago .hg-agenda-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
    min-width: 0;
}

.hg-page--monitor-thiago .hg-agenda-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.4;
    color: inherit;
    line-height: 0;
}

.hg-page--monitor-thiago .hg-agenda-card-owner,
.hg-page--monitor-thiago .hg-agenda-week-card-owner {
    margin-top: 0;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.9;
    text-decoration: none;
}

.hg-page--monitor-thiago .hg-agenda-card-owner:hover,
.hg-page--monitor-thiago .hg-agenda-week-card-owner:hover {
    text-decoration: underline;
    text-decoration-color: currentColor;
}

.hg-page--monitor-thiago .hg-agenda-card-time,
.hg-page--monitor-thiago .hg-agenda-block-time,
.hg-page--monitor-thiago .hg-agenda-week-card-time {
    margin-top: 0.125rem;
    font-size: 0.625rem;
    opacity: 0.7;
    line-height: 1.2;
}

.hg-page--monitor-thiago .hg-agenda-block-title {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
}

.hg-page--monitor-thiago .hg-agenda-block-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-page--monitor-thiago .hg-agenda-block-lock {
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.75rem;
}

.hg-page--monitor-thiago .hg-agenda-block-indisponivel {
    opacity: 0.8;
    cursor: default;
}

.hg-page--monitor-thiago .hg-agenda-block:not(.hg-agenda-block-indisponivel):hover {
    filter: brightness(0.95);
}

.hg-page--monitor-thiago .hg-agenda-week-card,
.hg-page--monitor-thiago .hg-agenda-week-block {
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
}

/* =============================================================================
   Drawer de atendimento — visual Thiago (somente .hg-atendimento--thiago)
   O sheet é teleportado ao body; por isso o escopo é no próprio drawer.
   ============================================================================= */

/* Tokens no :root, não no drawer: a tela de Eventos precisa das mesmas cores nos
   badges de status e não carrega nenhuma das classes `--thiago`. Ficavam
   duplicados aqui e em .hg-page--monitor-thiago; esta é a definição única para
   quem não é card de grade. */
:root {
    --hg-thiago-agendado: #FFFF00;
    --hg-thiago-confirmado: #1E4600;
    --hg-thiago-recebido: #49A400;
    --hg-thiago-os-aberta: #0000CD;
    --hg-thiago-entrega: #633DBC;
    --hg-thiago-nao-compareceu: #FF0000;
    --hg-thiago-bloqueado: #FFA500;
    --hg-thiago-fora-expediente: #808080;
}

.hg-atendimento--thiago .hg-drawer-close-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--hg-muted);
    color: var(--hg-muted-foreground);
    line-height: 0;
}

.hg-atendimento--thiago .hg-drawer-close-fab:hover {
    background: color-mix(in srgb, var(--hg-muted) 70%, var(--hg-foreground));
    color: var(--hg-foreground);
}

.hg-atendimento--thiago .hg-atendimento-header {
    background: var(--hg-card);
}

.hg-atendimento--thiago .hg-atendimento-block-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hg-muted-foreground);
    margin-bottom: 0.5rem;
}

.hg-atendimento--thiago .hg-atendimento-kv-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hg-muted-foreground);
}

.hg-atendimento--thiago .hg-atendimento-kv-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hg-foreground);
}

/* Badges de status — cores DMS, em qualquer tela. Antes só valiam dentro do
   drawer do Monitor, então a listagem de Eventos e o drawer dela mostravam o
   badge pastel do design system: mesma informação, duas aparências. */
.hg-badge.hg-agenda-agendado {
    background: var(--hg-thiago-agendado);
    color: #000;
    border: 1px solid #000;
}
.hg-badge.hg-agenda-confirmado {
    background: var(--hg-thiago-confirmado);
    color: #fff;
    border: 1px solid var(--hg-thiago-confirmado);
}
.hg-badge.hg-agenda-recebido,
.hg-badge.hg-agenda-compareceu {
    background: var(--hg-thiago-recebido);
    color: #fff;
    border: 1px solid var(--hg-thiago-recebido);
}
.hg-badge.hg-agenda-os-aberta {
    background: var(--hg-thiago-os-aberta);
    color: #fff;
    border: 1px solid var(--hg-thiago-os-aberta);
}
.hg-badge.hg-agenda-entrega {
    background: var(--hg-thiago-entrega);
    color: #fff;
    border: 1px solid var(--hg-thiago-entrega);
}
.hg-badge.hg-agenda-nao_compareceu {
    background: var(--hg-thiago-nao-compareceu);
    color: #fff;
    border: 1px solid var(--hg-thiago-nao-compareceu);
}
.hg-badge.hg-agenda-bloqueado {
    background: var(--hg-thiago-bloqueado);
    color: #000;
    border: 1px solid var(--hg-thiago-bloqueado);
}
.hg-badge.hg-agenda-fora-expediente {
    background: var(--hg-thiago-fora-expediente);
    color: #fff;
    border: 1px solid var(--hg-thiago-fora-expediente);
}

/* O ponto some quando o fundo já é a cor cheia do status — ele fica da mesma cor
   do badge e virava um borrão. A listagem de Eventos desenha o ponto; o drawer
   não. Continua visível nos badges pastel (.hg-status-*). */
.hg-badge[class*='hg-agenda-'] .hg-badge-dot {
    display: none;
}

.hg-atendimento--thiago .hg-atendimento-body {
    background: color-mix(in srgb, var(--hg-muted) 35%, transparent);
}

.hg-atendimento--thiago .hg-resumo-grid--linx {
    height: 100%;
    align-content: stretch;
}

.hg-atendimento--thiago .hg-quadrant,
.hg-atendimento--thiago .hg-solicitacoes-card {
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.hg-atendimento--thiago .hg-quadrant-icon,
.hg-atendimento--thiago .hg-solicitacoes-card-icon {
    color: var(--hg-primary);
}

.hg-atendimento--thiago .hg-resumo-kv-ico {
    color: var(--hg-primary);
}

/* Histórico de OS — linha estilo Thiago */
.hg-atendimento--thiago .hg-os-list {
    border-radius: 0.75rem;
    border: 1px solid var(--hg-border);
    background: var(--hg-card);
    overflow: hidden;
}

.hg-atendimento--thiago .hg-os-list-item + .hg-os-list-item {
    border-top: 1px solid var(--hg-border);
}

.hg-atendimento--thiago .hg-os-item-btn {
    border-bottom: none;
    padding: 0.625rem 1rem;
}

.hg-os-item-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hg-os-item-chevron {
    flex-shrink: 0;
    color: var(--hg-muted-foreground);
    transition: transform 0.15s ease;
}

.hg-os-item-chevron.is-open {
    transform: rotate(90deg);
}

.hg-os-item-hash {
    flex-shrink: 0;
    color: var(--hg-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
}

.hg-os-item-numero {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-os-item-status {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--hg-muted) 80%, transparent);
    color: var(--hg-muted-foreground);
}

.hg-os-item-valor {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--hg-primary);
}

.hg-os-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.hg-os-empty-icon {
    color: color-mix(in srgb, var(--hg-muted-foreground) 70%, transparent);
}

.hg-os-empty-title {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.hg-os-empty-text {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

/* Observações do cliente no drawer — card do resumo + form no padrão da modal. */
.hg-solicitacoes-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    min-width: 0;
    overflow: hidden;
    border-radius: 0 0 calc(var(--hg-radius) + 4px) calc(var(--hg-radius) + 4px);
}

.hg-solicitacoes-card-body .hg-agendar-sol-form {
    margin-top: 0;
}

.hg-solicitacoes-card-body .hg-solicitacoes-empty,
.hg-solicitacoes-card-body .hg-solicitacoes-loading {
    margin: 0;
    padding: 0.75rem 0.25rem;
}

.hg-solicitacoes-card-body .hg-solicitacoes-rows {
    margin: -0.75rem;
    margin-top: 0;
    border-top: 1px solid var(--hg-border);
}

.hg-solicitacoes-card-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.hg-solicitacoes-card-head .hg-label-hint {
    color: var(--hg-primary);
    flex-shrink: 0;
}

/* Popover abaixo do ícone — o card fica no topo do resumo e o hint pra cima era cortado. */
.hg-label-hint--below .hg-label-hint-popover {
    top: calc(100% + 0.4rem);
    bottom: auto;
}

.hg-label-hint--below .hg-label-hint-popover::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--hg-foreground, #111);
}

/* Descrição + Tipo + Adicionar na mesma linha (drawer mais estreito que a modal). */
.hg-solicitacoes-add-form-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: flex-end;
    min-width: 0;
    width: 100%;
}

.hg-solicitacoes-add-form-row .hg-agendar-sol-desc {
    flex: 1 1 0;
    min-width: 0;
}

.hg-solicitacoes-add-form-row .hg-agendar-sol-tipo {
    flex: 1 1 10rem;
    width: auto;
    max-width: 14rem;
    min-width: 0;
}

/* .hg-select tem min-width: 15rem global — no drawer isso estoura a coluna e cobria o botão. */
.hg-solicitacoes-add-form-row .hg-select,
.hg-solicitacoes-add-form-row .hg-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hg-solicitacoes-add-form-row .hg-agendar-sol-actions {
    flex: 0 0 auto;
    align-self: flex-end;
}

.hg-solicitacoes-add-form-row .hg-agendar-sol-add {
    height: 2.25rem;
    min-height: 2.25rem;
    max-height: 2.25rem;
}

@media (max-width: 720px) {
    .hg-solicitacoes-add-form-row {
        flex-wrap: wrap;
    }

    .hg-solicitacoes-add-form-row .hg-agendar-sol-tipo {
        flex: 1 1 9rem;
        width: auto;
        max-width: 100%;
    }

    .hg-solicitacoes-add-form-row .hg-agendar-sol-actions {
        width: 100%;
    }

    .hg-solicitacoes-add-form-row .hg-agendar-sol-add {
        width: 100%;
        justify-content: center;
    }
}

.hg-atendimento--thiago .hg-solicitacoes-card-head {
    justify-content: flex-start;
}

/* =============================================================================
   Tooltip hover dos cards da agenda (paridade Thiago — bg primary laranja)
   ============================================================================= */

.hg-agenda-hover-tooltip {
    position: fixed;
    z-index: 90;
    transform: translate(-50%, -100%);
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--hg-primary);
    color: var(--hg-primary-foreground);
    font-size: 0.75rem;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.18);
}

.hg-agenda-hover-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--hg-primary);
}

.hg-agenda-hover-tooltip-title {
    font-weight: 600;
}

.hg-agenda-hover-tooltip-name {
    margin-top: 0.125rem;
}

.hg-agenda-hover-tooltip-meta {
    margin-top: 0.125rem;
    opacity: 0.85;
}

.hg-agenda-hover-tooltip-hint {
    margin-top: 0.375rem;
    font-size: 0.625rem;
    opacity: 0.8;
}

/* =============================================================================
   Modal Agendar Serviço — layout Thiago
   ============================================================================= */

.hg-modal--agendar-thiago {
    max-width: 42.5rem;
    width: calc(100vw - 2rem);
    max-height: min(90vh, 52rem);
    display: flex;
    flex-direction: column;
}

.hg-modal-title--agendar {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hg-modal-body--agendar {
    flex: 1;
    min-height: 0;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.5rem;
    background: color-mix(in srgb, var(--hg-muted) 30%, transparent);
}

.hg-agendar-section-title {
    margin: 0.5rem 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hg-primary);
}

.hg-agendar-section-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0.5rem 0 0.5rem;
}

.hg-agendar-section-heading .hg-agendar-section-title {
    margin: 0;
}

.hg-agendar-section-heading .hg-label-hint {
    color: var(--hg-primary);
}

.hg-agendar-divider {
    border: 0;
    border-top: 1px solid var(--hg-border);
    margin: 1rem 0;
}

.hg-modal--agendar-thiago .hg-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hg-foreground);
}

.hg-modal--agendar-thiago .hg-required {
    color: var(--hg-destructive);
}

.hg-label--with-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.hg-label-hint {
    position: relative;
    display: inline-flex;
    color: var(--hg-muted-foreground);
    cursor: help;
}

.hg-label-hint:hover,
.hg-label-hint:focus-within {
    color: var(--hg-foreground);
}

.hg-label-hint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: help;
    line-height: 0;
}

.hg-label-hint-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.4rem);
    z-index: 40;
    width: max-content;
    max-width: 17.5rem;
    transform: translateX(-50%);
    padding: 0.5rem 0.625rem;
    border-radius: calc(var(--hg-radius) - 2px);
    border: 1px solid var(--hg-border);
    background: var(--hg-foreground, #111);
    color: var(--hg-background, #fff);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
    pointer-events: none;
}

.hg-label-hint-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: var(--hg-foreground, #111);
}

.hg-modal--agendar-thiago .hg-input,
.hg-modal--agendar-thiago .hg-select {
    background: var(--hg-card);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.hg-modal--agendar-thiago .hg-agendar-section,
.hg-modal--agendar-thiago .hg-agendar-sol-form,
.hg-modal--agendar-thiago .hg-agendar-cliente {
    min-width: 0;
    max-width: 100%;
}

.hg-field-error {
    margin: 0.25rem 0 0;
    font-size: 0.6875rem;
    color: var(--hg-destructive);
}

.hg-input.is-invalid,
.hg-input.is-invalid:focus {
    border-color: var(--hg-destructive);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--hg-destructive) 35%, transparent);
}

.hg-field--span-2 {
    grid-column: 1 / -1;
}

.hg-agendar-busca-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.hg-agendar-busca-input {
    flex: 1;
    min-width: 0;
}

.hg-agendar-busca-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 2.5rem;
    padding-inline: 0.875rem;
}

.hg-agendar-busca-results {
    margin-top: 0.5rem;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-card);
    overflow: hidden;
    max-height: 12rem;
    overflow-y: auto;
}

.hg-agendar-busca-result {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.hg-agendar-busca-result:last-child {
    border-bottom: none;
}

.hg-agendar-busca-result:hover {
    background: color-mix(in srgb, var(--hg-primary) 8%, transparent);
}

.hg-agendar-busca-result span {
    font-size: 0.75rem;
    color: var(--hg-muted-foreground);
}

.hg-modal-footer--agendar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--hg-border);
    background: var(--hg-card);
    padding: 0.75rem 1.5rem;
}

.hg-agendar-footer-hint {
    flex: 1;
    min-width: 12rem;
    font-size: 0.6875rem;
    color: var(--hg-muted-foreground);
}

.hg-agendar-footer-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.hg-modal--agendar-thiago .hg-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Observações do cliente — formulário sem overflow horizontal */
.hg-agendar-sol-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
    min-width: 0;
    width: 100%;
}

.hg-agendar-sol-form--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.hg-agendar-sol-form .hg-field {
    margin: 0;
    min-width: 0;
}

.hg-agendar-sol-desc {
    flex: 1 1 12rem;
    min-width: 0;
}

.hg-agendar-sol-tipo {
    flex: 0 1 12.5rem;
    width: 12.5rem;
    max-width: 100%;
    min-width: 0;
}

.hg-agendar-sol-tipo .hg-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hg-agendar-sol-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    min-width: 0;
}

@media (max-width: 640px) {
    .hg-agendar-sol-form--row {
        flex-direction: column;
        align-items: stretch;
    }

    .hg-agendar-sol-tipo {
        width: 100%;
        flex: 1 1 auto;
    }

    .hg-agendar-sol-selects {
        grid-template-columns: 1fr;
    }

    .hg-agendar-sol-actions {
        justify-content: stretch;
    }

    .hg-agendar-sol-add {
        width: 100%;
        justify-content: center;
    }
}

.hg-agendar-sol-selects .hg-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hg-agendar-sol-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-bottom: 0;
}

.hg-agendar-sol-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-shrink: 0;
    height: 2.25rem;
    min-height: 2.25rem;
    max-height: 2.25rem;
    padding: 0 0.75rem;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
    overflow: visible;
}

.hg-agendar-sol-add svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    display: block;
}

.hg-agendar-anotacao {
    display: block;
    width: 100%;
    height: auto;
    min-height: 5.5rem;
    padding: 0.75rem 0.875rem;
    resize: vertical;
    line-height: 1.45;
    box-sizing: border-box;
}

.hg-agendar-sol-list {
    margin-top: 0.75rem;
    border: 1px solid var(--hg-border);
    border-radius: calc(var(--hg-radius) - 2px);
    background: var(--hg-card);
    overflow: hidden;
}

.hg-agendar-sol-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hg-border);
    font-size: 0.875rem;
}

.hg-agendar-sol-item:last-child {
    border-bottom: none;
}

.hg-agendar-sol-item-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-agendar-sol-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: calc(var(--hg-radius) - 4px);
    background: transparent;
    color: var(--hg-muted-foreground);
    cursor: pointer;
    flex-shrink: 0;
}

.hg-agendar-sol-remove:hover {
    background: color-mix(in srgb, var(--hg-destructive) 10%, transparent);
    color: var(--hg-destructive);
}

/* Cliente — stack limpo igual ao Thiago */
.hg-agendar-cliente {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-agendar-cliente .hg-field {
    margin: 0;
    width: 100%;
}

.hg-agendar-cliente-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .hg-agendar-cliente-row {
        grid-template-columns: 1fr;
    }
}

.hg-field-hint--ok {
    color: color-mix(in srgb, var(--hg-primary) 70%, #166534);
}

.hg-field-hint--warn {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: calc(var(--hg-radius) - 2px);
    padding: 0.625rem 0.75rem;
    line-height: 1.4;
    font-weight: 500;
}

/* ── Loading overlay (espera de API / Livewire) ── */
.hg-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000 !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: color-mix(in srgb, var(--hg-background, #fff) 45%, rgb(0 0 0 / 0.35));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
}

.hg-loading-overlay.is-visible,
html.hg-lw-busy .hg-loading-overlay--monitor {
    display: flex;
}

.hg-page.is-lw-busy {
    cursor: progress;
}

.hg-drawer-enrich-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    margin: 0.75rem 1rem 0;
    border-radius: 0.375rem;
    border: 1px solid color-mix(in srgb, var(--hg-primary, #f97316) 28%, var(--hg-border, #e5e7eb));
    background: color-mix(in srgb, var(--hg-primary, #f97316) 8%, #fff);
    color: var(--hg-foreground, #111);
    font-size: 0.8125rem;
    font-weight: 500;
}

.hg-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    min-width: min(16rem, 100%);
    padding: 1.25rem 1.75rem;
    border-radius: var(--hg-radius, 0.5rem);
    border: 1px solid var(--hg-border, #e5e7eb);
    background: var(--hg-card, #fff);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.16);
    text-align: center;
}

.hg-loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid color-mix(in srgb, var(--hg-primary, #f97316) 22%, transparent);
    border-top-color: var(--hg-primary, #f97316);
    border-radius: 50%;
    animation: hg-loading-spin 0.7s linear infinite;
}

.hg-loading-spinner--sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
    flex-shrink: 0;
}

.hg-solicitacoes-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-loading-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--hg-foreground, #111);
}

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

@media (prefers-reduced-motion: reduce) {
    .hg-loading-spinner {
        animation: none;
        border-top-color: transparent;
        border-right-color: var(--hg-primary, #f97316);
    }
}

/* ── Pré-visualização de template do WhatsApp (drawer de Campanhas) ───────── */

.hg-tpl-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    background: #0b141a;
    border-radius: 0.625rem;
    padding: 0.875rem;
}

.hg-tpl-preview-avatar {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(255 255 255 / 0.08);
    color: #25d366;
}

.hg-tpl-preview-bubble {
    max-width: 26rem;
    background: #005c4b;
    color: #e9edef;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
}

.hg-tpl-preview-header {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.hg-tpl-preview-body code {
    background: rgb(0 0 0 / 0.25);
    border-radius: 0.25rem;
    padding: 0 0.25rem;
    font-size: 0.75rem;
}

.hg-tpl-preview-footer {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: rgb(233 237 239 / 0.6);
}

/* Variável do template: precisa ficar óbvio que não é texto fixo. */
.hg-tpl-var {
    background: rgb(37 211 102 / 0.18);
    border-bottom: 1px dashed rgb(37 211 102 / 0.7);
    border-radius: 0.1875rem;
    padding: 0 0.125rem;
}

.hg-tpl-vars {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hg-tpl-vars-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--hg-muted-foreground);
}

.hg-tpl-vars-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    background: var(--hg-muted, #f4f4f5);
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
}

.hg-tpl-vars-item code {
    font-size: 0.6875rem;
    color: var(--hg-muted-foreground);
}

/* Menu de ações que precisa escapar de um container com overflow (ex.: a tabela
   de Campanhas, onde .hg-table-scroll usa overflow-x:auto e acaba cortando).
   A posição é calculada por JS a partir do botão — ver campaigns-list.blade.php. */
.hg-dropdown-menu--floating {
    position: fixed;
    right: auto;
    z-index: 50;
}

/* Embed (hypergestor.app iframe): sem sidebar/topbar */
.hg-app--embed {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--hg-background);
}

.hg-app--embed .hg-main--embed {
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* —— Oracle SQL Client (rota-teste) —— */
.hg-db {
    --hg-db-bg: #e8eaed;
    --hg-db-panel: #f7f8fa;
    --hg-db-editor: #1e2430;
    --hg-db-editor-fg: #d7dde8;
    --hg-db-border: #c4c9d2;
    --hg-db-accent: #1b6ef3;
    --hg-db-run: #1f8a4c;
    --hg-db-run-hover: #187240;
    --hg-db-null: #8b5cf6;
    --hg-db-row-alt: #f0f3f7;
    --hg-db-row-hover: #e4eefc;
    --hg-db-selected: #d4e4fc;
    --hg-db-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    height: calc(100vh - 6.5rem);
    min-height: 28rem;
    max-width: none;
    padding-bottom: 0.75rem;
}

.hg-db-statusbar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.45rem 0.75rem;
    background: linear-gradient(180deg, #fbfbfc 0%, #eef1f5 100%);
    border: 1px solid var(--hg-db-border);
    border-radius: 0.4rem;
    font-size: 0.75rem;
}

.hg-db-statusbar-conn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.hg-db-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.hg-db-dot.is-ok {
    background: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.hg-db-dot.is-err {
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.hg-db-statusbar-meta {
    color: #475569;
    font-family: var(--hg-db-mono);
    font-size: 0.72rem;
}

.hg-db-statusbar-meta strong {
    color: #0f172a;
    font-weight: 600;
}

.hg-db-statusbar-actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.hg-db-btn {
    appearance: none;
    border: 1px solid var(--hg-db-border);
    background: #fff;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 0.3rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
}

.hg-db-btn:hover {
    background: #f1f5f9;
}

.hg-db-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.hg-db-btn-run {
    background: var(--hg-db-run);
    border-color: var(--hg-db-run);
    color: #fff;
}

.hg-db-btn-run:hover {
    background: var(--hg-db-run-hover);
}

.hg-db-btn-ghost {
    background: transparent;
}

.hg-db-btn-clear {
    background: #fff;
    border-color: #f1b4b4;
    color: #b91c1c;
}

.hg-db-btn-clear:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.hg-db-btn-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
}

.hg-db-workspace {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    border: 1px solid var(--hg-db-border);
    border-radius: 0.4rem;
    overflow: hidden;
    background: var(--hg-db-panel);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.hg-db-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #f3f5f8;
    border-right: 1px solid var(--hg-db-border);
}

.hg-db-sidebar-head {
    flex-shrink: 0;
    padding: 0.55rem 0.65rem 0.45rem;
    border-bottom: 1px solid var(--hg-db-border);
    background: #ebedf1;
}

.hg-db-sidebar-title {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.hg-db-schema {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
    font-family: var(--hg-db-mono);
}

.hg-db-schema .hg-db-object-icon {
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    max-width: 0.95rem;
    max-height: 0.95rem;
    color: #64748b;
    display: block;
}

.hg-db-schema-count {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    background: #fff;
    border: 1px solid var(--hg-db-border);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
}

.hg-db-search {
    flex-shrink: 0;
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--hg-db-border);
}

.hg-db-search-hint {
    margin: 0.35rem 0 0;
    font-size: 0.65rem;
    color: #64748b;
    line-height: 1.3;
}

.hg-db-object-list.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.hg-db-object {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.22rem 0.65rem 0.22rem 0.75rem;
    font-size: 0.72rem;
    font-family: var(--hg-db-mono);
    color: #1e293b;
    cursor: pointer;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-db-object:hover {
    background: var(--hg-db-row-hover);
}

.hg-db-object.is-active {
    background: var(--hg-db-selected);
    border-left-color: var(--hg-db-accent);
    font-weight: 600;
}

.hg-db-search input {
    width: 100%;
    border: 1px solid var(--hg-db-border);
    border-radius: 0.3rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    background: #fff;
    font-family: var(--hg-db-mono);
}

.hg-db-search input:focus {
    outline: 2px solid rgba(27, 110, 243, 0.25);
    border-color: var(--hg-db-accent);
}

.hg-db-object-list {
    flex: 1 1 0;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    padding: 0.25rem 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.hg-db-object-empty {
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.hg-db-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.hg-db-toolbar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid var(--hg-db-border);
    background: linear-gradient(180deg, #fafbfc 0%, #eef1f4 100%);
}

.hg-db-toolbar-hint {
    font-size: 0.68rem;
    color: #64748b;
}

.hg-db-toolbar-hint kbd {
    font-family: var(--hg-db-mono);
    font-size: 0.65rem;
    border: 1px solid var(--hg-db-border);
    border-bottom-width: 2px;
    border-radius: 0.2rem;
    padding: 0.05rem 0.3rem;
    background: #fff;
}

.hg-db-editor-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--hg-db-border);
    background: #21222c;
}

.hg-db-editor-chrome {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.65rem;
    background: linear-gradient(180deg, #2b2d3a 0%, #232530 100%);
    border-bottom: 1px solid #44475a;
    color: #bd93f9;
}

.hg-db-editor-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8be9fd;
    font-family: var(--hg-db-mono);
}

.hg-db-editor-hint {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.65rem;
    color: #6272a4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-db-editor-chrome .hg-db-btn-ghost {
    color: #f8f8f2;
    border-color: #44475a;
    background: transparent;
}

.hg-db-editor-chrome .hg-db-btn-ghost:hover {
    background: #44475a;
    color: #fff;
}

.hg-db-editor-wrap {
    position: relative;
    height: 22rem;
    min-height: 14rem;
    max-height: 70vh;
    resize: vertical;
    overflow: auto;
    background: #282a36; /* Dracula bg */
}

.hg-db-editor-wrap .hg-db-editor {
    display: none;
}

.hg-db-editor-wrap .CodeMirror {
    height: 100% !important;
    font-family: var(--hg-db-mono);
    font-size: 0.875rem;
    line-height: 1.55;
    background: #282a36;
    color: #f8f8f2;
    border: 0;
}

.hg-db-editor-wrap .CodeMirror-scroll {
    min-height: 100%;
}

.hg-db-editor-wrap .CodeMirror-gutters {
    background: #21222c;
    border-right: 1px solid #44475a;
}

.hg-db-editor-wrap .CodeMirror-linenumber {
    color: #6272a4;
}

.hg-db-editor-wrap .CodeMirror-cursor {
    border-left-color: #f8f8f2;
}

.hg-db-editor-wrap .CodeMirror-selected {
    background: #44475a !important;
}

.hg-db-editor-wrap .CodeMirror-focused .CodeMirror-selected {
    background: #44475a !important;
}

.hg-db-editor-wrap .CodeMirror-activeline-background {
    background: rgba(68, 71, 90, 0.35);
}

.hg-db-editor-wrap .CodeMirror-placeholder {
    color: #6272a4 !important;
    font-style: italic;
}

.hg-db-results {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.hg-db-results-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid var(--hg-db-border);
    background: #f5f7fa;
    font-size: 0.72rem;
    color: #475569;
}

.hg-db-results-bar strong {
    color: #0f172a;
}

.hg-db-tab {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--hg-db-accent);
    border-bottom: 2px solid var(--hg-db-accent);
    padding-bottom: 0.15rem;
}

.hg-db-grid-wrap {
    flex: 1 1 0;
    overflow: auto;
    min-height: 0;
    position: relative;
    overscroll-behavior: contain;
}

.hg-db-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--hg-db-mono);
    font-size: 0.72rem;
}

.hg-db-grid th,
.hg-db-grid td {
    padding: 0.22rem 0.55rem;
    border-right: 1px solid #dce1e8;
    border-bottom: 1px solid #dce1e8;
    white-space: nowrap;
    vertical-align: top;
}

.hg-db-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e9edf3;
    color: #334155;
    font-weight: 700;
    text-align: left;
    box-shadow: inset 0 -1px 0 var(--hg-db-border);
}

.hg-db-grid .hg-db-rownum {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #eef1f5;
    color: #64748b;
    text-align: right;
    min-width: 2.5rem;
    border-right: 1px solid var(--hg-db-border);
}

.hg-db-grid thead .hg-db-rownum {
    z-index: 3;
    background: #e0e5ec;
}

.hg-db-grid tbody tr:nth-child(even) td {
    background: var(--hg-db-row-alt);
}

.hg-db-grid tbody tr:nth-child(even) .hg-db-rownum {
    background: #e6eaef;
}

.hg-db-grid tbody tr:hover td {
    background: var(--hg-db-row-hover);
}

.hg-db-grid tbody tr:hover .hg-db-rownum {
    background: #d9e6f8;
}

.hg-db-null {
    color: var(--hg-db-null);
    font-style: italic;
    opacity: 0.85;
}

.hg-db-msg {
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    font-family: var(--hg-db-mono);
}

.hg-db-msg-error {
    color: #b91c1c;
    background: #fef2f2;
    border-top: 1px solid #fecaca;
    white-space: pre-wrap;
}

.hg-db-msg-empty {
    color: #64748b;
}

.hg-db-diag {
    border: 1px solid var(--hg-db-border);
    border-radius: 0.4rem;
    background: #fff;
    overflow: hidden;
}

.hg-db-diag-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 0;
    background: #f5f7fa;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    text-align: left;
}

.hg-db-diag-toggle:hover {
    background: #eef1f5;
}

.hg-db-diag-body {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--hg-db-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.hg-db-diag-section h3 {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.hg-db-diag-section dl {
    margin: 0;
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.hg-db-diag-section dt {
    color: #64748b;
}

.hg-db-diag-section dd {
    margin: 0;
    font-family: var(--hg-db-mono);
    word-break: break-word;
}

.hg-db-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hg-db-checks li {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    font-size: 0.72rem;
}

.hg-db-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    z-index: 5;
}

@media (max-width: 900px) {
    .hg-db {
        height: auto;
        min-height: 0;
    }

    .hg-db-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: 16rem minmax(24rem, 60vh);
        height: auto;
        min-height: 0;
        flex: none;
    }

    .hg-db-sidebar {
        max-height: 16rem;
        height: 16rem;
        border-right: 0;
        border-bottom: 1px solid var(--hg-db-border);
    }
}

/* ---- Dashboard → Arena launch ---- */
.hg-page-header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.hg-arena-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.95rem 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 35%, #e2e8f0);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--hg-primary) 12%, #fff) 0%, #fff 55%, color-mix(in srgb, #0f172a 4%, #fff) 100%);
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-decoration: none;
    box-shadow:
        0 1px 2px rgb(15 23 42 / 6%),
        0 8px 20px -14px color-mix(in srgb, var(--hg-primary) 55%, transparent);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.hg-arena-btn:hover,
.hg-arena-btn:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--hg-primary) 70%, #cbd5e1);
    box-shadow:
        0 2px 4px rgb(15 23 42 / 8%),
        0 14px 28px -16px color-mix(in srgb, var(--hg-primary) 70%, transparent);
    outline: none;
}

.hg-arena-btn__glow {
    position: absolute;
    inset: -40% -20%;
    background: conic-gradient(
        from 180deg,
        transparent 0deg,
        color-mix(in srgb, var(--hg-primary) 35%, transparent) 90deg,
        transparent 180deg,
        color-mix(in srgb, #0f172a 12%, transparent) 270deg,
        transparent 360deg
    );
    opacity: 0.35;
    filter: blur(10px);
    animation: hg-arena-glow-spin 6s linear infinite;
    z-index: -1;
    pointer-events: none;
}

.hg-arena-btn__icon {
    display: grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.55rem;
    background: color-mix(in srgb, var(--hg-primary) 16%, #fff);
    color: var(--hg-primary);
}

.hg-arena-btn__arrow {
    display: grid;
    place-items: center;
    color: var(--hg-primary);
    transition: transform 0.25s ease;
}

.hg-arena-btn:hover .hg-arena-btn__arrow {
    transform: translateX(3px);
}

.hg-arena-btn.is-launching {
    transform: scale(0.96);
    pointer-events: none;
}

@keyframes hg-arena-glow-spin {
    to { transform: rotate(360deg); }
}


@media (prefers-reduced-motion: reduce) {
    .hg-arena-btn__glow {
        animation: none !important;
    }
}
