/* ==========================================
   Hub Settings — Central de Configurações
   Tokens: var(--hub-*) como fonte da verdade
   ========================================== */

/* --- .hub-settings-sidebar / .hub-settings-sidebar --- */
.hub-settings-sidebar {
    width: 200px;
    border-right: 1px solid var(--hub-border);
    display: flex;
    flex-direction: column;
    padding: var(--hub-space-s) var(--hub-space-s) var(--hub-space-s) 0;
    flex-shrink: 0;
    overflow-y: auto;
}

/* --- .hub-settings-content / .hub-settings-content --- */
.hub-settings-content {
    flex: 1;
    padding-left: var(--hub-space-m);
    overflow-y: auto;
    min-height: 0;
}

/* Layout sidebar: abas à esquerda, conteúdo à direita */
.hub-settings-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}
[data-settings-modal] .hub-modal__panel {
    width: min(1040px, calc(100vw - 48px));
    height: min(780px, calc(100vh - 60px));
    background: var(--hub-modal-bg);
    border: 1px solid var(--hub-border);
    transition: var(--hub-transition-premium);
    animation: hubModalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-settings-modal] .hub-modal__body--sidebar {
    height: 100%;
    overflow: hidden;
}

/* --- .hub-settings-tab / .hub-settings-tab (Abas de Configuração) --- */
/* Consolidado com .hub-tab / .hub-tab do Design System */
.hub-settings-tab {
    background: transparent;
    border: none;
    color: var(--hub-text-muted);
    text-align: left;
    min-height: 38px;
    padding: var(--hub-space-3) var(--hub-space-5);
    cursor: pointer;
    border-radius: var(--hub-radius-sm);
    transition: var(--hub-transition-premium);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-snug);
    font-weight: var(--hub-weight-medium);
    margin-bottom: var(--hub-space-1);
}

.hub-settings-tab:hover {
    background: var(--hub-surface-hover);
    color: var(--hub-text);
}

.hub-settings-tab.active,
.hub-settings-tab.is-active {
    background: rgba(var(--hub-primary-rgb), 0.12);
    color: var(--hub-primary);
    font-weight: var(--hub-weight-semibold);
}

/* --- .hub-settings-section / .hub-settings-section --- */
[data-settings-modal] .hub-settings-section {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.hub-settings-section h3 {
    margin: 0 0 var(--hub-space-s);
    color: var(--hub-text);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    text-transform: var(--hub-case-eyebrow);
    letter-spacing: var(--hub-tracking-widest);
}

.hub-settings-section h4 {
    margin: 0 0 var(--hub-space-xs);
    color: var(--hub-text);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
}

.hub-settings-section p {
    margin: 0 0 var(--hub-space-s);
    color: var(--hub-text-muted);
    font-size: var(--hub-text-body-compact);
    line-height: var(--hub-leading-normal);
}

.hub-settings-section .hub-button {
    width: auto;
    justify-content: flex-start;
    margin-top: 0;
}

.hub-settings-section dl {
    display: grid;
    gap: var(--hub-space-s);
    margin: 0;
}

.hub-settings-section dl > div {
    padding-bottom: var(--hub-space-s);
    border-bottom: 1px solid var(--hub-border);
}

.hub-settings-section dl > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hub-settings-section dt {
    margin-bottom: 2px;
}

.hub-settings-section dd {
    margin: 0;
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    display: flex;
    align-items: center;
    gap: var(--hub-space-xs);
    flex-wrap: wrap;
}

/* --- Mesclagem de Registros --- */
.hub-settings-merge__divider {
    padding: var(--hub-space-s) 0;
    border-top: 1px solid var(--hub-border);
}

.hub-settings-merge__title {
    margin: 0 0 var(--hub-space-xs);
    color: var(--hub-text);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
}

.hub-settings-merge__desc {
    margin: 0 0 var(--hub-space-s);
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-normal);
}

.hub-settings-merge__results {
    margin-top: var(--hub-space-xs);
    font-size: var(--hub-text-body-compact);
    color: var(--hub-text-muted);
}

/* --- Inactive / Disabled items in settings --- */
.hub-settings-section dl > div:has(button:disabled) {
    opacity: 0.55;
    transition: opacity var(--hub-transition-slow);
}

.hub-settings-section dl > div:has(button:disabled):hover {
    opacity: 0.8;
}

.hub-settings-theme {
    display: grid;
    gap: var(--hub-space-s);
}

.hub-settings-theme__head {
    display: grid;
    gap: var(--hub-space-xs);
}

.hub-settings-theme__title {
    margin: 0;
}

.hub-settings-theme__desc,
.hub-settings-theme__status {
    margin: 0;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-normal);
}

.hub-settings-theme__toggle {
    display: inline-flex;
    width: fit-content;
    gap: var(--hub-space-xs);
}

.hub-settings-theme__toggle .hub-button {
    min-width: 108px;
    justify-content: center;
}

.hub-calendar-audit-modal__panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.hub-calendar-audit-modal__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hub-space-s);
    align-content: start;
}

.hub-calendar-audit-modal__section {
    display: grid;
    gap: var(--hub-space-s);
    align-content: start;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 72%),
        var(--hub-surface-soft);
}

.hub-calendar-audit-modal__section > p {
    margin: 0;
    max-width: 54ch;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-normal);
}

.hub-calendar-audit-modal__section h3 {
    margin: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
}

.hub-calendar-audit-modal__section--wide {
    grid-column: 1 / -1;
}

.hub-calendar-audit-modal__actions {
    margin-bottom: 0;
}

.hub-calendar-filter-bar {
    min-height: var(--hub-analytics-filter-block-height);
    box-sizing: border-box;
}

.hub-calendar-audit-modal__filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
    gap: var(--hub-space-s);
    align-items: end;
    margin-bottom: 0;
}

.hub-calendar-audit-modal__actions .hub-button {
    width: fit-content;
}

.hub-calendar-audit-results {
    display: grid;
    gap: var(--hub-space-s);
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.hub-calendar-audit-results--stack {
    align-content: start;
}

#calendar-module-summary .hub-table-wrap {
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

#calendar-module-summary .hub-table {
    width: 100%;
}

#calendar-module-summary .hub-table tbody {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--hub-space-s);
}

#calendar-module-summary .hub-table tr {
    display: grid;
    gap: var(--hub-space-1);
    padding: var(--hub-space-3) var(--hub-space-3);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface);
}

#calendar-module-summary .hub-table th,
#calendar-module-summary .hub-table td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

#calendar-module-summary .hub-table th {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
}

#calendar-module-summary .hub-table td {
    color: var(--hub-text);
    font-size: var(--hub-text-heading);
    font-weight: var(--hub-weight-medium);
    line-height: var(--hub-leading-tight);
}

#calendar-module-summary .hub-table tr:nth-child(3) td {
    color: var(--hub-primary);
}

#calendar-module-summary .hub-table tr:nth-child(5) td {
    color: var(--hub-danger);
}

.hub-calendar-audit-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--hub-space-s);
}

.hub-calendar-audit-kpi {
    display: grid;
    gap: var(--hub-space-1);
    min-width: 0;
    padding: var(--hub-space-3);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.016), transparent 72%),
        var(--hub-surface);
}

.hub-calendar-audit-kpi__label {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
}

.hub-calendar-audit-kpi__value {
    color: var(--hub-text);
    font-size: var(--hub-text-heading);
    font-weight: var(--hub-weight-medium);
    line-height: var(--hub-leading-tight);
}

.hub-calendar-audit-kpi__value--primary {
    color: var(--hub-primary);
}

.hub-calendar-audit-kpi__value--danger {
    color: var(--hub-danger);
}

.hub-calendar-audit-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--hub-space-s);
    flex-wrap: wrap;
}

.hub-calendar-audit-toolbar__meta {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-normal);
}

.hub-calendar-audit-table {
    display: grid;
    gap: var(--hub-space-3);
}

.hub-calendar-audit-table__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--hub-space-s);
    flex-wrap: wrap;
}

.hub-calendar-audit-table__head h4 {
    margin: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
}

.hub-calendar-audit-table__caption {
    margin: 0;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    line-height: var(--hub-leading-normal);
}

.hub-calendar-audit-table__meta {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
}

.hub-calendar-audit-table .hub-table-wrap {
    min-height: 0;
    overflow: auto;
}

#calendar-module-accounts .hub-table-wrap,
#calendar-module-feeds .hub-table-wrap,
#calendar-module-events .hub-table-wrap {
    padding: var(--hub-space-s);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 68%),
        var(--hub-surface-soft);
}

#calendar-module-accounts .hub-table thead th,
#calendar-module-feeds .hub-table thead th,
#calendar-module-events .hub-table thead th {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    letter-spacing: var(--hub-tracking-widest);
    text-transform: var(--hub-case-eyebrow);
}

#calendar-module-accounts .hub-table tbody td,
#calendar-module-feeds .hub-table tbody td,
#calendar-module-events .hub-table tbody td {
    vertical-align: middle;
}

#calendar-module-accounts .hub-audit-modal__results > p,
#calendar-module-feeds .hub-audit-modal__results > p,
#calendar-module-events .hub-audit-modal__results > p {
    margin: 0;
    padding: var(--hub-space-s);
    border: 1px dashed var(--hub-border);
    border-radius: var(--hub-radius-sm);
    background: rgba(255, 255, 255, 0.015);
    font-size: var(--hub-text-body-compact);
    line-height: var(--hub-leading-normal);
}

.hub-calendar-audit-empty {
    padding: var(--hub-space-3);
    border: 1px dashed var(--hub-border);
    border-radius: var(--hub-radius-sm);
    background: rgba(255, 255, 255, 0.015);
}

.hub-calendar-audit-empty h4 {
    margin: 0 0 var(--hub-space-1);
    color: var(--hub-text);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-medium);
}

.hub-calendar-audit-empty p {
    margin: 0;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-body-compact);
    line-height: var(--hub-leading-normal);
}

@media (max-width: 1180px) {
    #calendar-module-summary .hub-table tbody,
    .hub-calendar-audit-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    #calendar-module-summary .hub-table tbody,
    .hub-calendar-audit-modal__filters,
    .hub-calendar-audit-kpis {
        grid-template-columns: 1fr;
    }
}

/* --- Settings Mappings Section --- */
.hub-settings-mappings__divider {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}
.hub-settings-mappings__title {
    margin-bottom: var(--hub-space-xs);
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
}
.hub-settings-mappings__desc {
    margin-bottom: var(--hub-space-s);
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
}
.hub-settings-mappings__results {
    margin-top: var(--hub-space-s);
    font-size: var(--hub-text-label);
}
.hub-settings-mappings__textarea {
    width: 100%;
    font-family: var(--hub-font-mono);
    background: var(--hub-input-bg);
    border: 1px solid var(--hub-border-strong);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    padding: var(--hub-space-s);
    box-sizing: border-box;
    resize: vertical;
}

/* --- Tipografia — painel de tokens */
.hub-settings-typo__desc {
    font-size: var(--hub-text-body);
    color: var(--hub-text-muted);
    margin: 0 0 var(--hub-space-5);
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
}

.hub-settings-typo__groups {
    display: flex;
    flex-direction: column;
    gap: var(--hub-space-6);
}

.hub-settings-typo__group-title {
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text-muted);
    text-transform: var(--hub-case-eyebrow);
    letter-spacing: var(--hub-tracking-widest);
    margin: 0 0 var(--hub-space-3);
}

.hub-settings-typo__section-title {
    font-size: var(--hub-text-overline);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text-muted);
    text-transform: var(--hub-case-eyebrow);
    letter-spacing: var(--hub-tracking-widest);
    margin: 0 0 var(--hub-space-3);
}

.hub-settings-typo__grid {
    display: flex;
    flex-direction: column;
    gap: var(--hub-space-2);
}

.hub-settings-typo__row {
    display: grid;
    grid-template-columns: 1fr minmax(90px, auto);
    align-items: center;
    gap: var(--hub-space-4);
    padding: var(--hub-space-2) var(--hub-space-3);
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface-elevated-soft);
    border: 1px solid transparent;
    transition: border-color var(--hub-transition-fast);
}

.hub-settings-typo__row:has(input:focus) {
    border-color: var(--hub-border);
}

.hub-settings-typo__dual-fields {
    display: flex;
    gap: var(--hub-space-3);
    align-items: flex-end;
    flex-shrink: 0;
}

.hub-settings-typo__dual-fields .hub-settings-typo__color-field {
    flex-shrink: 0;
}

.hub-settings-typo__dual-fields .hub-settings-typo__input {
    width: 88px;
}

.hub-settings-typo__theme-label {
    font-size: var(--hub-text-micro);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--hub-tracking-wide);
    margin-bottom: 3px;
    display: block;
}

.hub-settings-typo__row label {
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-medium);
    color: var(--hub-text);
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: default;
}

.hub-settings-typo__use {
    font-size: var(--hub-text-micro);
    font-weight: var(--hub-weight-regular);
    color: var(--hub-text-muted);
    letter-spacing: var(--hub-tracking-normal);
    text-transform: none;
}

.hub-settings-typo__input {
    width: 100%;
    background: var(--hub-input-bg);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    font-size: var(--hub-text-label);
    font-family: var(--hub-font-mono);
    padding: var(--hub-space-1) var(--hub-space-2);
    text-align: right;
    transition: border-color var(--hub-transition-fast);
}

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

.hub-settings-typo__input.is-modified {
    color: var(--hub-primary);
}

/* --- Color swatch --- */
.hub-settings-typo__color-field {
    display: flex;
    align-items: center;
    gap: var(--hub-space-2);
}

.hub-settings-typo__swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
    padding: 2px;
    background: var(--hub-input-bg);
    cursor: pointer;
    flex-shrink: 0;
}

.hub-settings-typo__swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.hub-settings-typo__swatch::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--hub-radius-sm) - 2px);
}

/* --- Credentials / integrations fields --- */
.hub-input--mono {
    font-family: var(--hub-font-mono, monospace);
    font-size: var(--hub-text-body-compact);
}

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

.hub-field-feedback {
    font-size: var(--hub-text-body-compact);
    color: var(--hub-text-muted);
}

.hub-field-feedback--success { color: var(--hub-success); }
.hub-field-feedback--danger  { color: var(--hub-danger); }

.hub-credentials-status {
    margin-top: var(--hub-space-3);
    padding-top: var(--hub-space-3);
    border-top: 1px solid var(--hub-border);
    display: flex;
    flex-direction: column;
    gap: var(--hub-space-2);
}

.hub-credentials-status__connected {
    font-size: var(--hub-text-body-compact);
    color: var(--hub-success);
    margin: 0;
}

.hub-email-queue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--hub-space-4);
}

.hub-email-queue-head__title {
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
    margin: 0;
}

.hub-email-queue-list {
    margin-top: var(--hub-space-2);
}

.hub-queue-item {
    padding: var(--hub-space-2) 0;
    border-bottom: 1px solid var(--hub-border);
}

.hub-queue-item__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--hub-space-2);
}

.hub-queue-item__id {
    font-family: var(--hub-font-mono, monospace);
    font-size: var(--hub-text-micro);
    color: var(--hub-text-muted);
    flex: 1;
    word-break: break-all;
}

.hub-queue-item__status {
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-semibold);
    white-space: nowrap;
}

.hub-queue-item__status--pending    { color: var(--hub-warning); }
.hub-queue-item__status--processing { color: var(--hub-info, #5b8dee); }
.hub-queue-item__status--done       { color: var(--hub-success); }
.hub-queue-item__status--failed     { color: var(--hub-danger); }

.hub-queue-item__meta {
    font-size: var(--hub-text-micro);
    color: var(--hub-text-muted);
    margin-top: var(--hub-space-1);
}

.hub-queue-item__error {
    font-size: var(--hub-text-micro);
    color: var(--hub-danger);
    margin-top: var(--hub-space-1);
}

/* --- Diaristas --- */
.hub-diaristas__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--hub-space-s);
    margin-bottom: var(--hub-space-m);
}

.hub-diaristas__title {
    margin: 0 0 var(--hub-space-1);
    font-size: var(--hub-text-heading-sm);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
}

.hub-diaristas__desc {
    margin: 0;
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
}

.hub-diaristas__add-row {
    margin-top: var(--hub-space-s);
}

.hub-diaristas__form {
    margin-top: var(--hub-space-s);
    padding: var(--hub-space-s);
    background: var(--hub-surface-raised);
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
}

.hub-diaristas__form-actions {
    display: flex;
    gap: var(--hub-space-2);
    margin-top: var(--hub-space-s);
}

.hub-diaristas__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hub-space-s);
    padding: var(--hub-space-2) 0;
    border-bottom: 1px solid var(--hub-border);
}

.hub-diaristas__row:last-child {
    border-bottom: none;
}

.hub-diaristas__row-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--hub-space-2);
    min-width: 0;
}

.hub-diaristas__row-name {
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
    white-space: nowrap;
}

.hub-diaristas__row-meta {
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    width: 100%;
}

.hub-diaristas__row-actions {
    display: flex;
    gap: var(--hub-space-2);
    flex-shrink: 0;
}

.hub-diaristas__vinculos-panel {
    margin-top: var(--hub-space-m);
    padding-top: var(--hub-space-m);
    border-top: 1px solid var(--hub-border);
}

.hub-diaristas__vinculos-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--hub-space-s);
}

.hub-diaristas__vinculos-title {
    margin: 0;
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
}

.hub-diaristas__vinculo-form {
    margin-top: var(--hub-space-s);
    padding: var(--hub-space-s);
    background: var(--hub-surface-raised);
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
}

.hub-diaristas__switch-field {
    display: flex;
    align-items: flex-start;
}

/* Toggle field (substitui hub-switch-*) */
.hub-toggle-field {
    display: flex;
    align-items: flex-start;
    gap: var(--hub-space-3);
    cursor: pointer;
    user-select: none;
}

.hub-toggle-field__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: 1px;
    width: 32px;
    height: 18px;
    border-radius: 100px;
    background: var(--hub-border);
    transition: background var(--hub-transition-fast);
}

.hub-toggle-field__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hub-toggle-field__knob {
    position: absolute;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hub-text-muted);
    transition: left var(--hub-transition-fast), background var(--hub-transition-fast);
}

.hub-toggle-field__input:checked ~ .hub-toggle-field__knob {
    left: 16px;
    background: var(--hub-primary);
}

.hub-toggle-field__input:checked + .hub-toggle-field__knob {
    left: 16px;
    background: var(--hub-primary);
}

.hub-toggle-field__track:has(.hub-toggle-field__input:checked) {
    background: rgba(var(--hub-primary-rgb), 0.25);
}

.hub-toggle-field__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-medium);
    color: var(--hub-text);
    line-height: var(--hub-leading-normal);
}

.hub-toggle-field__hint {
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-normal);
    color: var(--hub-text-muted);
}

/* ── Rail — botão avatar ───────────────────────────────────── */
.hub-rail-settings-button--avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--hub-radius-sm);
    background: rgba(203, 123, 55, 0.14);
    color: var(--hub-primary);
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-bold);
    line-height: 1;
    border: none;
}

.hub-rail-settings-button--avatar:hover {
    opacity: 1;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.90);
}

/* ── Identidade do usuário ─────────────────────────────────── */
.hub-settings-identity {
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
    padding: var(--hub-space-s) 0;
    margin-bottom: var(--hub-space-s);
    border-bottom: 1px solid var(--hub-border);
}

.hub-settings-identity__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hub-primary);
    color: #0f1012;
    font-size: var(--hub-text-body);
    font-weight: var(--hub-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-settings-identity__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hub-settings-identity__name {
    font-size: var(--hub-text-body-compact);
    font-weight: var(--hub-weight-semibold);
    color: var(--hub-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-settings-identity__email {
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Alterar senha ─────────────────────────────────────────── */
.hub-settings-change-pw-wrap {
    padding-bottom: var(--hub-space-s);
    margin-bottom: var(--hub-space-s);
    border-bottom: 1px solid var(--hub-border);
}

.hub-settings-change-pw {
    display: flex;
    flex-direction: column;
    gap: var(--hub-space-xs);
    margin-top: var(--hub-space-s);
}

.hub-settings-change-pw__footer {
    display: flex;
    align-items: center;
    gap: var(--hub-space-xs);
    margin-top: var(--hub-space-1);
}

/* --- Integrações Layout --- */
.hub-integracoes-tabs {
    margin-top: var(--hub-space-m);
}
.hub-integracoes-body {
    margin-top: var(--hub-space-m);
}
.hub-integracoes-subnav {
    margin-bottom: var(--hub-space-m);
}
.hub-integracoes-credentials-status {
    margin-top: var(--hub-space-m);
}

/* --- Mapeador Visual de Regiões --- */
.hub-settings-mappings__visual-container {
    display: flex;
    flex-direction: column;
    gap: var(--hub-space-xs);
    margin-bottom: var(--hub-space-s);
    max-height: 320px;
    overflow-y: auto;
    padding-right: var(--hub-space-2);
}
.hub-settings-mappings__row {
    display: grid;
    grid-template-columns: 1fr 24px 1fr 40px;
    gap: var(--hub-space-xs);
    align-items: center;
}
.hub-settings-mappings__input {
    width: 100%;
    height: var(--hub-control-height, 36px);
    background: var(--hub-input-bg);
    border: 1px solid var(--hub-border-strong);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    padding: 0 var(--hub-space-s);
    box-sizing: border-box;
    font-size: var(--hub-text-body-compact);
    font-family: var(--hub-font);
    transition: border-color var(--hub-transition-fast);
}
.hub-settings-mappings__input:focus {
    outline: none;
    border-color: var(--hub-primary);
}
.hub-settings-mappings__arrow-icon {
    text-align: center;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
}
.hub-settings-mappings__btn-delete {
    height: var(--hub-control-height, 36px);
    width: 40px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--hub-text-muted);
    cursor: pointer;
    border-radius: var(--hub-radius-sm);
    font-size: var(--hub-text-body);
    transition: color var(--hub-transition-fast), background var(--hub-transition-fast);
}
.hub-settings-mappings__btn-delete:hover {
    color: var(--hub-danger);
    background: var(--hub-white-alpha-5);
    border-color: rgba(var(--hub-danger-rgb), 0.15);
}
.hub-settings-mappings__empty {
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    font-style: italic;
    padding: var(--hub-space-s) 0;
}
.hub-settings-mappings__instruction {
    background: var(--hub-surface-soft, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    padding: var(--hub-space-s);
    margin-bottom: var(--hub-space-s);
    font-size: var(--hub-text-label);
    color: var(--hub-text-muted);
    line-height: var(--hub-line-height-base, 1.4);
}
.hub-settings-mappings__instruction strong {
    color: var(--hub-text);
    display: block;
    margin-bottom: var(--hub-space-2);
}
.hub-settings-mappings__instruction ul {
    margin: 0;
    padding-left: var(--hub-space-m);
}
.hub-settings-mappings__instruction li {
    margin-bottom: var(--hub-space-2);
}
.hub-settings-mappings__instruction li:last-child {
    margin-bottom: 0;
}
.hub-settings-mappings__instruction code {
    background: var(--hub-white-alpha-5, rgba(255, 255, 255, 0.05));
    padding: 2px 6px;
    border-radius: var(--hub-radius-sm);
    font-family: var(--hub-font-mono);
    color: var(--hub-primary);
}

