/* ==========================================
   Hub Drawers — Gavetas e Modais
   Tokens: var(--hub-*) como fonte da verdade
   ========================================== */

/* --- .hub-drawer (Canônico) --- */
.hub-drawer {
    position: fixed;
    inset: 0;
    z-index: var(--hub-z-overlay);
    display: grid;
    justify-items: end;
}
.hub-drawer[hidden] {
    display: none;
}

/* --- Empilhamento: unit drawer sobre reservation drawer --- */
.hub-drawer--unit.is-stacked {
    z-index: calc(var(--hub-z-overlay) + 10);
}
.hub-drawer--unit.is-stacked .hub-drawer__overlay {
    background: transparent;
    backdrop-filter: none;
}
.hub-drawer--reservation .hub-drawer__overlay {
    background: var(--hub-overlay-bg);
    transition: background 0.25s ease;
}
.hub-drawer--reservation.has-stacked-over .hub-drawer__overlay {
    background: transparent;
    backdrop-filter: none;
}
.hub-drawer--reservation.has-stacked-over .hub-drawer__panel {
    transform: translateX(-44px);
    transition: transform 0.25s ease;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.25);
}
.hub-drawer--reservation .hub-drawer__panel {
    transition: transform 0.25s ease;
}

/* --- Auditoria de Metadados --- */
.hub-audit-modal {
    z-index: var(--hub-z-audit);
}

.hub-audit-modal .hub-table-wrap {
    padding: var(--hub-space-s);
}

.hub-audit-modal__results {
    margin-top: var(--hub-space-s);
}

/* --- Desktop Drawer Footer Buttons Height Standardization --- */
@media (min-width: 861px) {
    .hub-drawer__footer .hub-button {
        height: var(--hub-button-height);
        min-height: var(--hub-button-height);
        padding: 0 var(--hub-space-s);
        flex-shrink: 0;
    }
}

/* =========================================================
   Unit/Reservation Drawers
   ========================================================= */
.hub-drawer--unit .hub-drawer__body,
.hub-drawer--reservation .hub-drawer__body {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hub-unit-drawer__shell,
.hub-reservation-drawer__shell {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hub-reservation-drawer__scrollable {
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-block-start: var(--hub-space-s);
    padding-block-end: var(--hub-space-m);
}

.hub-unit-tab-panel {
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-block-start: var(--hub-space-s);
    padding-block-end: var(--hub-space-m);
}

.hub-unit-tab-panel[hidden] {
    display: none !important;
}

.hub-unit-card__actions,
.hub-unit-drawer__actions {
    display: flex;
    align-items: center;
    gap: var(--hub-space-xs);
}

.hub-unit-card__actions {
    justify-content: space-between;
    margin-top: 2px;
}

.hub-unit-drawer__actions {
    margin-top: var(--hub-space-s);
}

.hub-unit-drawer__hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: var(--hub-space-m);
    padding: var(--hub-space-m);
    border-bottom: 1px solid var(--hub-border);
    flex-shrink: 0;
}

.hub-unit-drawer__hero img,
.hub-unit-drawer__hero > div,
.hub-unit-photo-zone__placeholder {
    width: 180px;
    height: 120px;
    display: grid;
    place-items: center;
    object-fit: cover;
    border-radius: var(--hub-radius);
    background: linear-gradient(135deg, rgba(var(--hub-primary-rgb), 0.28), rgba(var(--hub-info-rgb), 0.2)), var(--hub-surface-raised);
    color: var(--hub-text);
    font-size: var(--hub-text-hero);
    font-weight: var(--hub-weight-bold);
    border: 1px solid var(--hub-border);
    box-shadow: var(--hub-shadow-sm);
}

.hub-unit-photo-zone {
    position: relative;
    width: 180px;
    height: 120px;
    cursor: pointer;
    border-radius: var(--hub-radius);
    overflow: hidden;
}

.hub-unit-photo-zone img {
    width: 100%;
    height: 100%;
    border: 0;
    box-shadow: none;
}

.hub-unit-photo-zone__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-1);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-medium);
    opacity: 0;
    transition: opacity var(--hub-transition-base);
    border-radius: var(--hub-radius);
}

.hub-unit-photo-zone__overlay svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hub-unit-photo-zone:hover .hub-unit-photo-zone__overlay {
    opacity: 1;
}

.hub-unit-photo-zone--uploading .hub-unit-photo-zone__overlay {
    opacity: 1;
}

.hub-unit-photo-zone--uploading .hub-unit-photo-zone__overlay span {
    display: none;
}

.hub-unit-photo-zone--uploading .hub-unit-photo-zone__overlay svg {
    animation: hub-spin 1s linear infinite;
}

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

.hub-unit-drawer__chips {
    display: flex;
    align-items: center;
    gap: var(--hub-space-2);
    margin-top: var(--hub-space-2);
    margin-bottom: var(--hub-space-s);
}

.hub-unit-drawer__header-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--hub-space-3);
    margin-top: var(--hub-space-4);
}

.hub-unit-drawer__header-actions-row .hub-unit-drawer__chips {
    display: flex;
    align-items: center;
    gap: var(--hub-space-2);
    margin: 0;
}

.hub-unit-drawer__header-actions-row .hub-unit-drawer__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--hub-space-2);
    margin: 0;
}

.hub-unit-drawer__header-actions-row .hub-unit-chip,
.hub-unit-drawer__header-actions-row .hub-review-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 var(--hub-space-2);
    font-size: var(--hub-text-micro);
    font-weight: var(--hub-weight-bold);
    line-height: 1;
    letter-spacing: var(--hub-tracking-normal);
    text-transform: var(--hub-case-eyebrow);
    border-radius: var(--hub-radius-sm, 3px);
    white-space: nowrap;
    min-height: unset;
}

.hub-unit-drawer__hero span,
.hub-unit-drawer__section h3 {
    color: var(--hub-primary);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-bold);
    letter-spacing: var(--hub-tracking-ultra);
    text-transform: var(--hub-case-eyebrow);
}

.hub-unit-drawer__hero h2 {
    margin: var(--hub-space-2) 0;
    color: var(--hub-text);
    font-size: var(--hub-text-title);
    font-weight: var(--hub-weight-semibold);
    line-height: 1.15;
}

.hub-unit-drawer__hero p {
    margin: 0;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-extralight);
    line-height: var(--hub-leading-snug);
}

.hub-unit-drawer__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--hub-space-s);
    padding: var(--hub-space-m);
}

.hub-drawer--reservation .hub-unit-drawer__metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hub-unit-drawer__section-metrics {
    margin: 0 var(--hub-space-m) var(--hub-space-s);
}

.hub-unit-drawer__section-metrics + .hub-unit-drawer__section-metrics {
    margin-top: var(--hub-space-s);
}

.hub-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--hub-space-s) 0 var(--hub-space-1);
}

.hub-unit-drawer__section-metrics h4.hub-section-title {
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text-muted);
    text-transform: var(--hub-case-eyebrow);
    letter-spacing: var(--hub-tracking-base);
    margin: 0;
}

/* Switch/Toggle custom styling */
.hub-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: var(--hub-space-xs);
}

.hub-toggle-desc {
    font-size: var(--hub-text-body);
    color: var(--hub-text-muted);
}

.hub-toggle-label {
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-medium);
    color: var(--hub-text);
    min-width: 65px;
}

.hub-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.hub-switch input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.hub-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--hub-border);
    transition: background-color var(--hub-transition-move);
    border-radius: 20px;
    z-index: 1;
}

.hub-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--hub-toggle-thumb);
    transition: transform var(--hub-transition-move);
    border-radius: 50%;
}

.hub-switch input:checked + .hub-slider {
    background-color: var(--hub-primary, #007bff);
}

.hub-switch input:checked + .hub-slider:before {
    transform: translateX(16px);
}

.hub-unit-drawer__section-metrics .hub-unit-drawer__metrics {
    padding: var(--hub-space-xs) 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hub-space-s);
}

.hub-metrics--primary article {
    border: 1px solid var(--hub-primary-soft, var(--hub-border));
    background: var(--hub-surface-raised);
}

.hub-metrics--primary article strong {
    font-size: var(--hub-text-heading);
    color: var(--hub-primary, var(--hub-text));
}

.hub-metrics--secondary article {
    border: 1px solid var(--hub-border);
    background: var(--hub-surface-ground, rgba(255, 255, 255, 0.02));
    opacity: 0.85;
}

.hub-metrics--secondary article strong {
    font-size: var(--hub-text-heading-sm);
    font-weight: var(--hub-weight-semibold);
}

.hub-metrics--secondary article span {
    font-size: var(--hub-text-overline);
}

.hub-estimate-tag {
    font-size: var(--hub-text-micro);
    font-weight: var(--hub-weight-medium);
    color: var(--hub-warning-text, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
    padding: 1px var(--hub-space-1);
    border-radius: var(--hub-radius);
    margin-left: var(--hub-space-xs);
    text-transform: none;
    vertical-align: middle;
    display: inline-block;
}

.hub-drawer-section-header {
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text-muted);
    padding: var(--hub-space-2) 0 var(--hub-space-1);
    border-bottom: 1px solid var(--hub-border);
    margin-bottom: var(--hub-space-1);
    text-transform: var(--hub-case-eyebrow);
    letter-spacing: var(--hub-tracking-ultra);
}

.hub-drawer-section-header:first-child {
    padding-top: 0;
}

.hub-unit-drawer__metrics article,
.hub-unit-drawer__section {
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    background: var(--hub-surface-raised);
}

.hub-unit-drawer__metrics article {
    display: grid;
    gap: var(--hub-space-2);
    padding: var(--hub-space-s);
}

.hub-unit-drawer__metrics span {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-bold);
    text-transform: var(--hub-case-eyebrow);
}

.hub-unit-drawer__metrics strong {
    color: var(--hub-text);
    font-size: var(--hub-text-heading);
}

.hub-unit-drawer__section {
    margin: 0 var(--hub-space-m) var(--hub-space-s);
    padding: var(--hub-space-s);
}

.hub-unit-tab-panel[data-unit-tab-panel="reservas"] [data-tpl="reservations_tab"] > .hub-unit-drawer__section:nth-of-type(n + 2) {
    padding: 0;
    overflow: hidden;
}

.hub-unit-tab-panel[data-unit-tab-panel="reservas"] [data-tpl="reservations_tab"] > .hub-unit-drawer__section:nth-of-type(n + 2) > h3 {
    margin: 0;
    padding: var(--hub-space-s);
    border-bottom: 1px solid var(--hub-border);
}

/* Tabela de reservas dentro do drawer de unidade */
.hub-table--drawer-reservas {
    width: 100%;
    table-layout: fixed;
}
.hub-table--drawer-reservas th,
.hub-table--drawer-reservas td { padding-inline: var(--hub-space-s); }
.hub-table--drawer-reservas th:nth-child(1), .hub-table--drawer-reservas td:nth-child(1) { width: 18%; }
.hub-table--drawer-reservas th:nth-child(2), .hub-table--drawer-reservas td:nth-child(2) { width: 25%; }
.hub-table--drawer-reservas th:nth-child(3), .hub-table--drawer-reservas td:nth-child(3) { width: 10%; }
.hub-table--drawer-reservas th:nth-child(4), .hub-table--drawer-reservas td:nth-child(4) { width: 20%; }
.hub-table--drawer-reservas th:nth-child(5), .hub-table--drawer-reservas td:nth-child(5) { width: 17%; }

.hub-unit-drawer__section dl {
    display: grid;
    gap: 1px;
    margin: var(--hub-space-s) 0 0;
}

.hub-unit-drawer__section dl > div:not(.hub-drawer-section-header) {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: var(--hub-space-s);
    padding: var(--hub-space-2) 0;
    border-bottom: 1px solid var(--hub-border-subtle);
}

.hub-unit-drawer__section dt {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-medium);
}

.hub-unit-drawer__section dd {
    margin: 0;
    min-width: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-body-compact);
    overflow-wrap: anywhere;
    font-weight: var(--hub-weight-light);
}

#unit-drawer-cadastro-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--hub-space-l);
    padding: 0;
    border-bottom: none;
}

.hub-cadastro-col {
    display: flex;
    flex-direction: column;
}

#unit-drawer-cadastro-rows .hub-cadastro-col > div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: var(--hub-space-s);
    padding: var(--hub-space-3) 0;
    border-bottom: 1px solid var(--hub-border-subtle);
    align-items: start;
}

#unit-drawer-cadastro-rows .hub-cadastro-col > div:last-child {
    border-bottom: none;
}

#unit-drawer-cadastro-rows dt {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-medium);
}

#unit-drawer-cadastro-rows dd {
    margin: 0;
    min-width: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-body-compact);
    overflow-wrap: anywhere;
    font-weight: var(--hub-weight-light);
}

.hub-unit-link {
    display: inline-flex;
    align-items: center;
    gap: var(--hub-space-1);
    max-width: 100%;
    min-width: 0;
    color: var(--hub-primary);
    text-decoration: none;
    font-size: inherit;          /* herda exatamente o tamanho do dd pai */
    font-weight: var(--hub-weight-medium);
    border-bottom: 1px solid transparent;
    transition: all var(--hub-transition-slow);
}

.hub-unit-link__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-unit-link__icon {
    flex: 0 0 auto;
    font-size: 0.9em;
    line-height: 1;
}

.hub-unit-link:hover {
    color: var(--hub-primary-hover, var(--hub-text));
    border-bottom-color: var(--hub-primary);
}

.hub-unit-drawer__description-row {
    align-items: start;
}

.hub-unit-description {
    margin: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-medium);
    line-height: 1.55;
}

.hub-unit-description > :first-child {
    margin-top: 0;
}

.hub-unit-description > :last-child {
    margin-bottom: 0;
}

.hub-unit-description p,
.hub-unit-description ul,
.hub-unit-description ol,
.hub-unit-description blockquote,
.hub-unit-description h1,
.hub-unit-description h2,
.hub-unit-description h3,
.hub-unit-description h4,
.hub-unit-description h5,
.hub-unit-description h6 {
    margin: 0 0 var(--hub-space-xs);
}

.hub-unit-description ul,
.hub-unit-description ol {
    padding-left: 1.2rem;
}

.hub-unit-description a {
    color: var(--hub-primary);
    text-decoration: underline;
}

.hub-unit-description.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.hub-link-button {
    min-height: 0;
    margin-top: var(--hub-space-2);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hub-primary);
    font: inherit;
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-bold);
    letter-spacing: var(--hub-tracking-snug);
    text-transform: var(--hub-case-eyebrow);
    cursor: pointer;
}

.hub-link-button:hover {
    color: var(--hub-text);
}

.hub-unit-drawer__accordion {
    padding: 0;
    overflow: hidden;
}

.hub-unit-drawer__accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hub-space-s);
    padding: var(--hub-space-s);
    color: var(--hub-text);
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-bold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
    cursor: pointer;
}

.hub-unit-drawer__accordion summary span {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    letter-spacing: var(--hub-tracking-snug);
}

.hub-unit-drawer__accordion > div,
.hub-unit-drawer__accordion > dl {
    padding: 0 var(--hub-space-s) var(--hub-space-s);
}

.hub-unit-drawer__reservas,
.hub-unit-drawer__strategies {
    margin-top: var(--hub-space-s);
    overflow: auto;
}

.hub-review-status {
    display: inline-grid;
    min-height: 28px;
    place-items: center;
    padding: 0 var(--hub-space-3);
    border-radius: 999px;
    border: 1px solid var(--hub-border-strong);
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-bold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
}

.hub-review-status.is-new {
    border-color: rgba(var(--hub-danger-rgb), 0.42);
    background: rgba(var(--hub-danger-rgb), 0.13);
    color: var(--hub-text-on-danger);
}

.hub-review-status.is-reviewed {
    border-color: rgba(var(--hub-success-rgb), 0.42);
    background: rgba(var(--hub-success-rgb), 0.14);
    color: var(--hub-text-on-success);
}

.hub-reservation-avatar {
    background:
        linear-gradient(135deg, rgba(var(--hub-primary-rgb), 0.24), rgba(var(--hub-info-rgb), 0.16)),
        var(--hub-surface);
    color: var(--hub-text);
    font-size: var(--hub-text-hero);
    font-weight: var(--hub-weight-bold);
}

.hub-reservation-drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--hub-space-xs);
    padding: var(--hub-modal-footer-padding);
    border-top: 1px solid var(--hub-border);
    background: transparent;
    flex-shrink: 0;
}

[data-reservation-row] {
    cursor: pointer;
}

[data-reservation-row]:hover {
    background: rgba(var(--hub-primary-rgb), 0.055);
}

/* ==========================================
   HUB CANONICAL MODALS & DRAWERS (Frente A)
   ========================================== */

/* 1. Modal Canônico Base */
.hub-modal {
    position: fixed;
    inset: 0;
    z-index: var(--hub-z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hub-modal[hidden] {
    display: none !important;
}

.hub-modal__overlay,
.hub-drawer__overlay {
    position: absolute;
    inset: 0;
    background: var(--hub-overlay-bg);
}

.hub-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(var(--hub-modal-width-md), calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    background: var(--hub-modal-bg);
    box-shadow: var(--hub-modal-shadow);
    animation: hubModalIn var(--hub-transition-move);
}

@keyframes hubModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hub-modal__panel--sm {
    width: min(var(--hub-modal-width-sm), calc(100vw - 48px));
}

/* Cabeçalho base (simples) */
.hub-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--hub-space-s);
    padding: var(--hub-modal-head-padding);
    border-bottom: 1px solid var(--hub-border);
}
.hub-modal__head h3 {
    margin: 0;
    font-size: var(--hub-text-heading);   /* 18px */
    font-weight: var(--hub-weight-bold);  /* 700 */
    color: var(--hub-text);
}
.hub-modal__head p {
    margin: var(--hub-space-1) 0 0;
    font-size: var(--hub-text-body-compact);     /* 12px */
    font-weight: var(--hub-weight-light); /* 300 */
    color: var(--hub-text-muted);
}

/* Fechar (Clean X) */
.hub-modal__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-title);
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.hub-modal__close:hover {
    color: var(--hub-text);
}

/* Corpo */
.hub-modal__body {
    flex: 1;
    padding: var(--hub-modal-body-padding);
    overflow: auto;
}

/* Rodapé */
.hub-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--hub-space-xs);
    padding: var(--hub-modal-footer-padding);
    border-top: 1px solid var(--hub-border);
}

/* Variante Leitura Complexa (--reading) */
.hub-modal--reading .hub-modal__panel {
    width: min(var(--hub-modal-width-lg), calc(100vw - 48px));
}
.hub-modal--reading .hub-modal__eyebrow {
    display: block;
    font-size: var(--hub-text-overline);       /* 10px */
    font-weight: var(--hub-weight-semibold);  /* 600 */
    color: var(--hub-primary);
    letter-spacing: var(--hub-tracking-ultra);
    text-transform: var(--hub-case-eyebrow);
    margin-bottom: var(--hub-space-2);
}
.hub-modal--reading .hub-modal__head h2 {
    margin: 0;
    font-size: var(--hub-text-title);          /* 24px */
    font-weight: var(--hub-weight-medium);    /* 500 */
    color: var(--hub-text);
}

/* Corpo em Grid para variante reading (Glossário) */
.hub-modal--reading .hub-modal__body--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hub-space-s);
}

.hub-modal--reading .hub-modal__body--sidebar {
    display: flex;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

/* Variante Tela Cheia (--full) */
.hub-modal--full .hub-modal__panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    margin: var(--hub-space-s);
}

/* 2. Drawer Canônico Base */
.hub-drawer {
    position: fixed;
    inset: 0;
    z-index: var(--hub-z-overlay);
    display: grid;
    justify-items: end;
}
.hub-drawer[hidden] {
    display: none !important;
}

.hub-drawer__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--hub-drawer-width-record);
    height: calc(100vh - 32px);
    margin: var(--hub-space-s);
    overflow: hidden;
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    background: var(--hub-modal-bg);
    box-shadow: var(--hub-modal-shadow);
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    animation: hubDrawerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: width var(--hub-transition-move), transform var(--hub-transition-move);
}

@keyframes hubDrawerIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Cabeçalho */
.hub-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--hub-space-s);
    padding: var(--hub-modal-head-padding);
    border-bottom: 1px solid var(--hub-border);
    flex-shrink: 0;
}
.hub-drawer__head h3 {
    margin: 0;
    font-size: var(--hub-text-heading);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
}
.hub-drawer__head p {
    margin: var(--hub-space-1) 0 0;
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-light);
    color: var(--hub-text-muted);
}

/* Fechar (Pill circular de 32px para gavetas) */
.hub-drawer__close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--hub-border);
    border-radius: 999px;
    background: var(--hub-white-alpha-8);
    color: var(--hub-text);
    font-size: var(--hub-text-heading);
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.hub-drawer__close:hover {
    border-color: rgba(var(--hub-primary-rgb), 0.48);
    background: rgba(var(--hub-primary-rgb), 0.12);
}

/* Form wrapper — ocupa toda a área flexível do drawer */
.hub-drawer__form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Corpo */
.hub-drawer__body {
    flex: 1;
    padding: var(--hub-modal-body-padding);
    overflow: auto;
}

/* Rodapé */
.hub-drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--hub-space-xs);
    padding: var(--hub-modal-footer-padding);
    border-top: 1px solid var(--hub-border);
    background: transparent;
    flex-shrink: 0;
}

/* Tamanhos das Gavetas */
.hub-drawer--narrow .hub-drawer__panel { width: var(--hub-drawer-width-narrow); }
.hub-drawer--record .hub-drawer__panel { width: var(--hub-drawer-width-record); }
.hub-drawer--wide .hub-drawer__panel   { width: var(--hub-drawer-width-wide); }

/* ==========================================
   STACKING LAYERS (z-index)
   ========================================== */

/* Confirm modal sits on top of everything */
[data-confirm-modal] {
    z-index: var(--hub-z-overlay-top) !important;
}

/* Sub-modals & Form Drawers sit above standard drawers/modals */
[data-record-drawer],
[data-strategy-app-modal],
[data-bulk-apply-modal],
[data-glossary-modal],
[data-metadata-audit-modal],
.hub-tasks-drawer,
#integracoes-block-drawer {
    z-index: var(--hub-z-overlay-raised) !important;
}

/* ==========================================
   Hub Status Dots (Reservas)
   ========================================== */
.hub-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 auto;
    vertical-align: middle;
    box-sizing: border-box;
}

.hub-status-dot--confirmada {
    background-color: var(--hub-success, #4f9768);
}

.hub-status-dot--cancelada {
    background-color: var(--hub-danger, #be524b);
}

.hub-status-dot--warning {
    background-color: var(--hub-warning, #deb776);
}

.hub-status-dot.is-alterada {
    border: 2px solid var(--hub-warning, #deb776);
    box-shadow: 0 0 0 1px var(--hub-warning, #deb776);
}

/* --- Utilitarios de espacamento para templates dinamicos (JS) --- */
.hub-integration-dl {
    margin-bottom: var(--hub-space-3);
}

.hub-integration-section {
    margin-top: var(--hub-space-4);
}

.hub-integration-section h4 {
    margin-bottom: var(--hub-space-2);
}

.hub-integration-section .hub-muted-note {
    margin-bottom: var(--hub-space-2);
}

.hub-rate-mapping-row {
    display: flex;
    gap: var(--hub-space-2);
    align-items: center;
    margin-bottom: var(--hub-space-2);
}

.hub-rate-mapping-row__label {
    flex: 1;
    font-size: var(--hub-text-body);
}

.hub-rate-mapping-row__input {
    width: 140px;
}

.hub-rate-mapping-row .hub-button {
    padding: var(--hub-space-1) var(--hub-space-3);
    font-size: var(--hub-text-label);
}

.hub-integration-form-gap {
    margin-top: var(--hub-space-3);
}

.hub-integration-actions-gap {
    margin-top: var(--hub-space-3);
}

.hub-integration-actions-gap--sm {
    margin-top: var(--hub-space-2);
}

.hub-integration-actions-gap--lg {
    margin-top: var(--hub-space-4);
}

.hub-integration-actions-gap--sm-b {
    margin-bottom: var(--hub-space-2);
}

/* --- Notas de feedback com tom semântico --- */
.hub-feedback-note { }
.hub-feedback-note--danger { color: var(--hub-danger); }
.hub-feedback-note--success { color: var(--hub-success); }
.hub-feedback-note--muted { color: var(--hub-text-muted); }
.hub-feedback-note--success-semibold { color: var(--hub-success); font-weight: var(--hub-weight-medium); }

/* --- Layout utilitário de ações agrupadas --- */
.hub-actions-flex {
    display: flex;
    gap: var(--hub-space-2);
    flex-wrap: wrap;
}

/* --- Limpeza card (ficha de reserva) --- */
.hub-record-dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.hub-record-dl > div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--hub-space-2);
    padding: var(--hub-space-2) 0;
    border-bottom: 1px solid var(--hub-border);
    align-items: baseline;
}

.hub-record-dl > div:last-child {
    border-bottom: none;
}

.hub-record-dl dt {
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    font-weight: var(--hub-weight-normal);
}

.hub-record-dl dd {
    font-size: var(--hub-text-body-compact);
    color: var(--hub-text);
    margin: 0;
}

.hub-limpeza-actions {
    display: flex;
    gap: var(--hub-space-2);
    flex-wrap: wrap;
    align-items: center;
    margin-top: var(--hub-space-s);
}

.hub-limpeza-actions__select {
    height: var(--hub-control-height);
    padding: 0 var(--hub-space-3);
    background: var(--hub-surface-raised);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    font-size: var(--hub-text-body-compact);
    font-family: var(--hub-font);
    cursor: pointer;
    min-width: 0;
}

.hub-limpeza-actions__select:focus {
    outline: none;
    border-color: var(--hub-primary);
}

/* ==========================================================================
   Padronização de Botões de Fechar (Close Buttons)
   Todos os botões "X" compartilham a mesma identidade circular e minimalista
   ========================================================================== */
.hub-drawer__close,
.hub-modal__close,
.hub-help-overlay__close,
.hub-tasks-close {
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--hub-text-muted) !important;
    font-size: var(--hub-text-title, 20px) !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    transition: background var(--hub-transition-base), color var(--hub-transition-base) !important;
    padding: 0 !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.hub-drawer__close:hover,
.hub-modal__close:hover,
.hub-help-overlay__close:hover,
.hub-tasks-close:hover {
    background: var(--hub-surface-hover, rgba(255, 255, 255, 0.08)) !important;
    color: var(--hub-text) !important;
}
