:root {
  --bg-color: #F8FAFC;
  --card-bg: #FFFFFF;
  --primary-red: #E31C23;
  --primary-red-hover: #C11319;
  --soft-red-bg: #FFF5F5;
  --accent-dark: #1E293B;
  --border-color: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --overlay-scrim: rgba(15, 23, 42, 0.6);
  --overlay-blur: 2px;
  --header-height: 67px; /* .top-header-inner 14+38+14 + border 1 */
  --page-pills-height: 32px;
  --page-pills-margin: 20px; /* .page-section-bar 12px 0 8px */
  --main-padding-top: 24px;
  --main-padding-bottom: 24px;
  --card-padding: 20px;
  --card-border-y: 2px;
  --card-header-height: 34px; /* .btn-expand / título com meta */
  --card-header-margin: 16px;
  --section-pills-height: 32px;
  --section-pills-margin: 16px;
  --docs-footer-height: 44px;
  --section-card-height: calc(
    100vh
    - var(--header-height)
    - var(--page-pills-margin)
    - var(--page-pills-height)
    - var(--main-padding-top)
    - var(--main-padding-bottom)
  );
  --section-body-height: calc(
    var(--section-card-height)
    - var(--card-padding)
    - var(--card-header-height)
    - var(--card-header-margin)
    - var(--section-pills-height)
    - var(--section-pills-margin)
    - var(--card-padding)
    - var(--card-border-y)
  );
  --section-body-height-mobile: var(--section-body-height);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

html {
  scroll-padding-top: calc(var(--header-height) + 8px);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: visible;
}

.main-content-full {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: var(--main-padding-top) 24px var(--main-padding-bottom) 24px;
  flex: 1 0 auto;
}

/* Header: sticky no viewport — ancestrais html/body precisam overflow visível */
.top-header {
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
  background-color: #ffffff;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.top-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: brightness(0.88);
}

.brand-title { font-weight: 700; font-size: 16px; color: var(--accent-dark); }
.brand-subtitle { font-size: 12px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.user-menu {
  position: relative;
}

.user-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  transition: background 0.15s;
}

.user-chip-btn:hover,
.user-menu.is-open .user-chip-btn {
  background: #F8FAFC;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-id {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  line-height: 1.2;
}

.user-chip-cargo {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-adm-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: #9F1239;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.2;
}

.user-adm-pill.is-common {
  color: #334155;
  background: #F1F5F9;
  border-color: #E2E8F0;
  text-transform: none;
}

.user-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #FECACA;
  background: var(--soft-red-bg);
  color: var(--primary-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.user-chip-btn:hover .user-avatar-btn,
.user-menu.is-open .user-avatar-btn {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: var(--primary-red-hover);
}

.user-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 380px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 14px 14px 12px;
  z-index: 220;
}

.user-popover-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 2px 14px;
  margin-bottom: 0;
  border-bottom: none;
}

.user-popover-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--soft-red-bg);
  color: var(--primary-red);
  border: 1px solid #FECACA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.user-popover-id {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}

.user-popover-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.user-popover-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.25;
}

.user-popover-role {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}

.user-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 0;
  padding: 0;
  border: 1px solid #FECDD3;
  border-radius: 50%;
  background: #FFF1F2;
  color: #9F1239;
  cursor: pointer;
  flex-shrink: 0;
}

.user-edit-btn svg {
  width: 14px;
  height: 14px;
}

.user-edit-btn:hover {
  text-decoration: none;
  background: #FFE4E6;
  border-color: #FDA4AF;
  color: #9F1239;
}

.user-popover-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 12px;
  padding: 4px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.user-popover-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid #E8EEF4;
  border-radius: 0;
  padding: 10px 0;
}

.user-popover-row:last-child {
  border-bottom: none;
}

.user-popover-row span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.user-popover-row strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.admin-functions {
  margin: 0 0 12px;
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.admin-functions-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
}

.admin-functions-head svg {
  width: 15px;
  height: 15px;
  color: var(--primary-red);
  flex-shrink: 0;
}

.admin-functions-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-fn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.admin-fn-pill svg {
  width: 14px;
  height: 14px;
  color: var(--primary-red);
}

.admin-fn-pill:hover {
  background: var(--soft-red-bg);
}

body:not(.is-admin) .admin-functions,
body:not(.is-admin) .agent-sql-run {
  display: none;
}

body.is-painel .fab-dock,
body.is-painel #agentOverlay,
body.is-painel #secao-terminal,
body.is-painel #secao-lakehouse,
body.is-painel #secao-docs,
body.is-painel [data-page-section-pill="terminal"],
body.is-painel [data-page-section-pill="lakehouse"],
body.is-painel [data-page-section-pill="documentacoes"],
body.is-painel .admin-functions,
body.is-painel .site-footer-docs {
  display: none;
}

.user-db-btn,
.user-logout-btn {
  width: 100%;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.user-db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 0;
  border: none;
  background: transparent;
  color: var(--accent-dark);
}

.user-db-btn svg {
  width: 16px;
  height: 16px;
  color: var(--primary-red);
}

.user-db-btn:hover {
  background: #F8FAFC;
}

.user-logout-btn {
  border: none;
  background: #FEF2F2;
  color: #DC2626;
}

.user-logout-btn:hover {
  background: #FEE2E2;
}

.fab-dock {
  position: fixed;
  right: 24px;
  bottom: 16px;
  z-index: 210;
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  max-width: 34px;
  padding: 0 9px;
  border-radius: 999px;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: max-width 0.22s ease, background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-expand svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.btn-expand-label {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  transition: max-width 0.22s ease, opacity 0.16s ease, margin 0.22s ease;
}

.btn-expand-outline:hover,
.btn-expand-outline:focus-visible,
.btn-expand-outline[aria-expanded="true"],
.btn-expand.is-expanded {
  max-width: 220px;
}

.btn-expand-outline:hover .btn-expand-label,
.btn-expand-outline:focus-visible .btn-expand-label,
.btn-expand-outline[aria-expanded="true"] .btn-expand-label,
.btn-expand.is-expanded .btn-expand-label {
  max-width: 170px;
  opacity: 1;
  margin-left: 8px;
}

.btn-expand-solid,
.btn-expand-danger {
  max-width: 220px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  box-shadow: none;
}

.btn-expand-solid svg,
.btn-expand-danger svg {
  color: #9F1239;
}

.btn-expand-solid .btn-expand-label,
.btn-expand-danger .btn-expand-label {
  max-width: 170px;
  opacity: 1;
  margin-left: 8px;
}

.btn-expand-solid:hover,
.btn-expand-solid:focus-visible,
.btn-expand-danger:hover,
.btn-expand-danger:focus-visible {
  background: #FFF1F2;
  color: #9F1239;
  border-color: #FECDD3;
  box-shadow: none;
}

.btn-expand-solid:disabled,
.btn-expand-solid:disabled:hover,
.btn-expand-solid:disabled:focus-visible,
.btn-expand-danger:disabled,
.btn-expand-danger:disabled:hover,
.btn-expand-danger:disabled:focus-visible {
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  box-shadow: none;
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-expand-outline {
  background: #FFFFFF;
  color: #9F1239;
  border: 1px solid #FECACA;
}

.btn-expand-outline svg {
  color: #9F1239;
}

.btn-expand-outline:hover,
.btn-expand-outline:focus-visible {
  background: #FFFFFF;
  border-color: #FECACA;
  color: #9F1239;
}

.btn-expand-outline:disabled,
.btn-expand-outline:disabled:hover,
.btn-expand-outline:disabled:focus-visible {
  background: #FFFFFF;
  color: #9F1239;
  border-color: #FECACA;
  opacity: 0.45;
  cursor: not-allowed;
}

.fab-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.fab-ai svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #9F1239;
}

.fab-ai:hover,
.fab-ai:focus-visible {
  background: #FFE4E6;
  border-color: #FDA4AF;
  box-shadow: 0 10px 22px rgba(159, 18, 57, 0.16);
  transform: translateY(-2px);
}

@media (hover: none), (pointer: coarse) {
  .btn-expand {
    max-width: none;
  }

  .btn-expand .btn-expand-label {
    max-width: 200px;
    opacity: 1;
    margin-left: 8px;
  }
}

/* Cards Genericos */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--card-padding);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: var(--card-header-margin);
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.card-title-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--soft-red-bg);
  color: var(--primary-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title-icon svg {
  width: 16px;
  height: 16px;
}

.btn-access {
  gap: 8px;
}

.btn-access-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.btn-access-icon svg {
  width: 16px;
  height: 16px;
}

.btn-new-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s;
}

.btn-new-project-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFE4E6;
  color: #9F1239;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-new-project-icon svg {
  width: 13px;
  height: 13px;
}

.btn-new-project:hover {
  background: #FFE4E6;
  border-color: #FDA4AF;
}

.add-form {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.add-form .form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}

.add-form select {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text-main);
}

.add-form-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .add-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Grids / Layout */
.layout-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.layout-top.is-full {
  grid-template-columns: minmax(0, 1fr);
}

.layout-top.is-agenda-only {
  grid-template-columns: minmax(0, 1fr);
}

.layout-top.is-full .layout-top-right[hidden],
.layout-top.is-full .layout-top-right,
.layout-top.is-agenda-only .layout-top-left {
  display: none;
}

.layout-top-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.layout-top-left .card {
  margin-bottom: 0;
}

.layout-top-right {
  min-width: 0;
  height: 0;
  min-height: 100%;
  display: flex;
}

.card-rotina {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.card-rotina .card-header {
  flex-shrink: 0;
}

.card-full {
  width: 100%;
}

.main-content-full > .card.card-full {
  display: flex;
  flex-direction: column;
  height: var(--section-card-height);
  min-height: var(--section-card-height);
  max-height: var(--section-card-height);
  margin-bottom: 0;
  overflow: hidden;
}

.main-content-full > .card.card-full > .card-header,
.main-content-full > .card.card-full > .terminal-pills {
  flex-shrink: 0;
}

.etl-panel {
  margin-bottom: 0;
}

.etl-panel .layout-top {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

.etl-panel .layout-top .card {
  background: #F8FAFC;
  box-shadow: none;
}

.exec-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  overflow: hidden;
}

.exec-pane.is-visible {
  display: flex;
}

.exec-pane[hidden] {
  display: none !important;
}

.exec-pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.exec-pane .filter-bar,
.exec-pane .chart-legend {
  flex-shrink: 0;
}

.exec-pane .chart-wrap {
  flex: 1;
  height: auto;
  min-height: 0;
}

.exec-pane .logs-table-wrapper {
  flex: 1;
  max-height: none;
  min-height: 0;
}



.terminal-panel {
  margin-bottom: 0;
}

.docs-panel {
  margin-bottom: 0;
}

.docs-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  overflow: auto;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.docs-empty {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-muted);
}

.docs-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  min-height: 148px;
}

.docs-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.docs-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.docs-verified {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.docs-card-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #9F1239;
  cursor: pointer;
  flex-shrink: 0;
}

.docs-card-edit svg {
  width: 16px;
  height: 16px;
}

.docs-card-edit:hover {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.docs-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.docs-card-icon svg {
  width: 28px;
  height: 28px;
}

.docs-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.docs-card-kicker {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-card-updated {
  display: block;
  margin-left: 66px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-muted);
  min-height: 14px;
}

.docs-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.docs-card-status {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #9F1239;
}

.docs-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #EEF2F7;
}

.docs-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.docs-card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFFFFF;
  color: #9F1239;
  cursor: pointer;
  flex-shrink: 0;
}

.docs-card-delete svg {
  width: 14px;
  height: 14px;
}

.docs-card-delete:hover {
  background: #FFF1F2;
}

.docs-status-select {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #FECDD3;
  background: #FFFFFF;
  color: #9F1239;
  font-size: 12px;
  font-weight: 600;
}

.docs-card-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFF1F2;
  color: #9F1239;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}

.docs-card-open:hover {
  background: #FFE4E6;
}

button.docs-card-open {
  font-family: inherit;
  cursor: pointer;
}

.docs-placeholder {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.page-section-bar {
  position: relative;
  width: 100%;
  margin: 12px 0 8px; /* soma = --page-pills-margin */
  background: transparent;
  pointer-events: none;
}

.page-section-bar-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  pointer-events: none;
}

.page-section-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: var(--page-pills-height);
  border-radius: 999px;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate(0, 0);
}

.page-section-thumb.is-ready {
  opacity: 1;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-section-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--page-pills-height);
  padding: 0 12px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFFFFF;
  color: #9F1239;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.28s ease, border-color 0.28s ease, color 0.2s ease;
}

.page-section-pill[hidden] {
  display: none;
}

.page-section-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9F1239;
}

.page-section-pill:hover {
  background: var(--soft-red-bg);
}

.page-section-pill.is-active {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.page-section-thumb.is-ready ~ .page-section-pill.is-active,
.page-section-thumb.is-ready ~ .page-section-pill.is-active:hover {
  background: transparent;
  border-color: transparent;
}

.page-section-pill.is-active svg {
  color: #9F1239;
}

.page-section-pill.is-active:hover {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.page-section-pill[hidden] {
  display: none !important;
}

.terminal-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 var(--section-pills-margin);
  overflow-x: auto;
  scrollbar-width: none;
}

.terminal-pills::-webkit-scrollbar {
  display: none;
}

.terminal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--section-pills-height);
  padding: 0 12px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.2s ease;
}

.terminal-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9F1239;
}

.terminal-pill:hover {
  background: var(--soft-red-bg);
}

.terminal-pill.is-active {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.terminal-pill.is-active svg {
  color: #9F1239;
}

.terminal-pill.is-active:hover {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.terminal-pill[hidden] {
  display: none !important;
}


.main-content-full > .card.card-full[hidden] {
  display: none !important;
}

#secao-rotinas[hidden],
#secao-lakehouse[hidden],
#secao-relatorios[hidden],
#secao-ingestao[hidden],
#secao-terminal[hidden],
#secao-docs[hidden],
#secao-gerenciador[hidden] {
  display: none !important;
}

.main-content-full > .card-full.is-section-in {
  animation: page-section-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes page-section-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-section-thumb.is-ready,
  .page-section-pill,
  .terminal-pill {
    transition: none !important;
  }

  .main-content-full > .card-full.is-section-in {
    animation: none !important;
  }
}

.lakehouse-panel {
  margin-bottom: 0;
}

.lakehouse-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.lakehouse-tree {
  flex: 0 0 280px;
  width: 280px;
  min-width: 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.lakehouse-tree-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  background: #FFFFFF;
  border-radius: 11px 11px 0 0;
  position: relative;
  z-index: 6;
}

.lakehouse-tree-toolbar .lakehouse-file-wrap {
  flex: 0 0 auto;
  min-width: 34px;
}

.lakehouse-tree-toolbar .lakehouse-db-select {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  height: 32px;
  font-size: 11px;
  padding: 0 8px;
}

.lakehouse-tree-head {
  flex-shrink: 0;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.lakehouse-tree .kanban-error {
  margin: 8px 10px 0;
}

.lakehouse-tree-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: #FFFFFF;
  border-radius: 0 0 11px 11px;
}

.lh-node {
  min-width: 0;
}

.lh-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.lh-row:hover,
.lh-row.is-active {
  background: #FFF1F2;
}

.lh-twist {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9F1239;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.lh-node.is-open > .lh-row .lh-twist {
  transform: rotate(90deg);
}

.lh-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9F1239;
}

.lh-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lh-children {
  display: none;
  padding-left: 14px;
}

.lh-node.is-open > .lh-children {
  display: block;
}

.lh-table-row {
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
}

.lh-table-row:hover,
.lh-table-row.is-menu-open {
  background: #FFF1F2;
}

.lh-table-row .lh-row {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.lh-table-row .lh-row:hover,
.lh-table-row .lh-row.is-active {
  background: transparent;
}

.lh-more-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 4px 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9F1239;
  cursor: pointer;
  opacity: 0.45;
}

.lh-more-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.lh-table-row:hover .lh-more-btn,
.lh-more-btn[aria-expanded="true"] {
  opacity: 1;
  background: #FECDD3;
}

.lh-table {
  font-weight: 500;
  color: var(--text-main);
}

.lakehouse-ide {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  overflow: hidden;
}

.lakehouse-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-bottom: 8px;
  min-width: 0;
}

.lakehouse-toolbar #lakehouseRunBtn {
  margin-left: auto;
}

.lakehouse-file-wrap {
  position: relative;
  flex-shrink: 0;
}

.lakehouse-file-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 180px;
  padding: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lakehouse-file-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.lakehouse-file-menu button svg {
  width: 14px;
  height: 14px;
  color: #9F1239;
}

.lakehouse-file-menu button:hover {
  background: #FFF1F2;
}

.lakehouse-db-select {
  flex: 0 1 200px;
  width: 200px;
  max-width: 240px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #FECDD3;
  background: #FFFFFF;
  color: #9F1239;
  font-size: 12px;
  font-weight: 600;
}

.lakehouse-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.lakehouse-tabs-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.lakehouse-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.lakehouse-tab.is-active {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.lakehouse-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #9F1239;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

.lakehouse-tab-close svg {
  width: 12px;
  height: 12px;
}

.lakehouse-tab-close:hover {
  background: #FECDD3;
}

.lakehouse-tab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: #9F1239;
  cursor: pointer;
}

.lakehouse-tab-add svg {
  width: 14px;
  height: 14px;
}

.lakehouse-tab-add:hover {
  background: #FFF1F2;
}

.lakehouse-sql-stack {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.lakehouse-sql-ghost,
.lakehouse-sql-stack .lakehouse-sql {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
}

.lakehouse-sql-ghost {
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  color: transparent;
}

.lakehouse-ghost-prefix {
  color: transparent;
}

.lakehouse-ghost-hint {
  color: #94A3B8;
  opacity: 0.7;
}

.lakehouse-sql-stack .lakehouse-sql {
  z-index: 1;
  resize: none;
  overflow: auto;
  background: #FFFFFF;
  color: #1E293B;
  caret-color: #1E293B;
}

.lakehouse-sql-stack .lakehouse-sql::selection {
  background: rgba(254, 202, 202, 0.9);
  color: #1E293B;
}

.lakehouse-editor-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #FFFFFF;
}

.lakehouse-ide.has-result .lakehouse-editor-shell {
  flex: 1.15 1 0;
}

.lakehouse-output {
  display: flex;
  flex-direction: column;
  flex: 0.95 1 0;
  min-height: 0;
  margin-top: 8px;
  gap: 4px;
}

.lakehouse-output[hidden] {
  display: none !important;
}

.lakehouse-grid-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.lakehouse-copy-float {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  z-index: 4;
}

.lakehouse-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFF1F2;
  color: #9F1239;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.lakehouse-copy-btn:hover,
.lakehouse-copy-btn[aria-expanded="true"] {
  background: #FFF1F2;
}

.lakehouse-copy-float[hidden] {
  display: none !important;
}

.lakehouse-copy-float .btn-expand {
  height: 22px;
  max-width: 22px;
  padding: 0 5px;
}

.lakehouse-copy-float .btn-expand svg {
  width: 13px;
  height: 13px;
}

.lakehouse-copy-float .btn-expand .btn-expand-label {
  font-size: 11px;
}

.lakehouse-copy-float .btn-expand:hover,
.lakehouse-copy-float .btn-expand:focus-visible,
.lakehouse-copy-float .btn-expand[aria-expanded="true"],
.lakehouse-copy-float .btn-expand.is-expanded {
  max-width: 130px;
}

.lakehouse-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFF1F2;
  color: #9F1239;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.lakehouse-action-pill svg {
  width: 13px;
  height: 13px;
}

.lakehouse-action-pill:hover,
.lakehouse-action-pill[aria-expanded="true"] {
  background: #FECDD3;
  border-color: #FDA4AF;
  color: #881337;
}

.lh-conn-pill {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perm-db-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.perm-sf-search {
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  appearance: none;
  -webkit-appearance: none;
}

.perm-sf-list {
  max-height: 240px;
  overflow: auto;
  padding: 2px 0;
}

.perm-sf-list .theme-pill[hidden] {
  display: none;
}

.ingest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.ingest-filters input,
.ingest-filters select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 34px 8px 12px;
  font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M1.2 1.3L6 6.1l4.8-4.8'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ingest-filters input[type="date"] {
  padding-right: 12px;
  background-image: none;
}

.ingest-filters input[type="date"]::-webkit-clear-button,
.ingest-filters input[type="date"]::-webkit-inner-spin-button {
  display: none;
}

.ingest-filters input:hover,
.ingest-filters select:hover,
.ingest-filters input:focus,
.ingest-filters select:focus {
  outline: none;
  border-color: #FECDD3;
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.06), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ingestao-panel #ingestListView:not([hidden]),
.ingestao-panel #ingestFormView:not([hidden]),
.ingestao-panel #ingestDetailView:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.ingestao-panel #ingestListView[hidden],
.ingestao-panel #ingestFormView[hidden],
.ingestao-panel #ingestDetailView[hidden] {
  display: none !important;
}

.ingestao-panel .users-toolbar {
  flex-shrink: 0;
}

.relatorios-panel {
  margin-bottom: 0;
}

.relatorios-panel #reportListView:not([hidden]),
.relatorios-panel #reportView:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.relatorios-panel #reportListView[hidden],
.relatorios-panel #reportView[hidden] {
  display: none !important;
}

.relatorios-panel #reportView .users-toolbar {
  flex-wrap: wrap;
  gap: 8px 12px;
}

.report-list-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  overflow: auto;
}

.report-pick-card {
  cursor: pointer;
}

.report-pick-card:hover {
  border-color: #FECDD3;
}

#reportRefreshBtn,
#reportRefreshBtn:hover,
#reportRefreshBtn:focus-visible {
  max-width: 220px;
}

#reportRefreshBtn .btn-expand-label,
#reportRefreshBtn:hover .btn-expand-label,
#reportRefreshBtn:focus-visible .btn-expand-label {
  max-width: 170px;
  opacity: 1;
  margin-left: 8px;
}

.report-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.report-view-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.report-view-filters[hidden] {
  display: none;
}

.report-view-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px 0 10px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFF8F8;
  min-width: 0;
}

.report-view-filter-name {
  font-size: 11px;
  font-weight: 700;
  color: #9F1239;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.report-view-filter input[type="date"] {
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 12px;
  background: #FFFFFF;
  color: #1E293B;
}

.report-view-filter .report-seg-multi {
  min-width: 132px;
}

.report-view-filter .report-seg-multi-btn {
  height: 26px;
  min-width: 132px;
}

.report-view-filter .report-seg-multi-menu {
  left: auto;
  right: 0;
  min-width: 220px;
}

.report-download-wrap {
  position: relative;
  flex-shrink: 0;
}

.report-download-wrap .lakehouse-file-menu {
  left: auto;
  right: 0;
  z-index: 50;
}

.report-board-head,
.report-job {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) 120px;
}

.report-view-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.report-band {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #FFFFFF;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: auto;
  min-width: 0;
  max-width: 100%;
}

.report-band.is-table {
  flex: 1 1 720px;
  min-height: 540px;
  max-height: min(90vh, 1260px);
  overflow: hidden;
}

.report-band-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.report-kpi {
  flex: 1 1 160px;
  min-width: 140px;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid #FECDD3;
  border-radius: 12px;
  background: #FFF1F2;
}

.report-kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #9F1239;
  margin-bottom: 6px;
}

.report-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.15;
  word-break: break-word;
}

.report-kpi-error,
.report-chart-error,
.report-table-error {
  font-size: 12px;
  color: #9F1239;
}

.report-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-charts[data-count="1"] {
  grid-template-columns: 1fr;
}

.report-charts[data-count="3"] .report-chart:nth-child(3) {
  grid-column: 1 / -1;
}

.report-chart {
  height: 560px;
  max-height: 560px;
  min-height: 560px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-chart-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.report-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.report-chart-plot {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.report-chart-plot-inner {
  height: 100%;
  min-width: 100%;
  position: relative;
}

.report-chart-plot-inner canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.report-table-host {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.report-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-table th,
.report-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.report-table th {
  background: #F8FAFC;
  font-weight: 700;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.report-table th[data-report-sort] {
  cursor: pointer;
  user-select: none;
}

.report-table th[data-report-sort]:hover {
  color: var(--text-color);
  background: #F1F5F9;
}

.report-table th[data-report-sort].is-sorted {
  color: var(--primary-red);
}

.report-table th .report-sort-mark {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.28;
  font-weight: 700;
}

.report-table th.is-sorted .report-sort-mark {
  opacity: 1;
}

.report-build-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.report-item-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  background: #FFFFFF;
  margin-bottom: 10px;
}

.report-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.report-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #FECACA;
  background: #FFFFFF;
  color: #9F1239;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.report-text-btn:hover {
  background: #FFF1F2;
}

.report-item-card .form-group .report-text-btn {
  margin-top: 8px;
}

.report-preview {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F8FAFC;
  font-size: 12px;
  color: #334155;
  overflow: auto;
  max-height: 160px;
}

.report-preview table {
  width: 100%;
  border-collapse: collapse;
}

.report-preview th,
.report-preview td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.report-bi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.report-bi-legacy {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #FFF7ED;
  color: #9A3412;
  font-size: 12px;
}

.report-bi-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  margin-bottom: 10px;
}

.report-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
}

.report-field-chip.is-used {
  border-color: #FECDD3;
  background: #FFF1F2;
  color: #9F1239;
}

.report-field-chip.is-measure {
  border-color: #E31C23;
  background: #FFF1F2;
  color: #9F1239;
}

.report-field-chip.is-picking,
.report-field-chip.is-dragging {
  border-color: #E31C23;
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.12);
}

.report-field-chip.is-in-well {
  cursor: default;
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.report-axis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.report-axis-well {
  min-height: 64px;
  padding: 8px;
  border: 1px dashed #FECDD3;
  border-radius: 10px;
  background: #FFF7F8;
}

.report-axis-well.is-dragover,
.report-axis-well.is-ready {
  border-style: solid;
  background: #FFE4E6;
}

.report-axis-well-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9F1239;
  margin-bottom: 6px;
}

.report-axis-empty {
  font-size: 11px;
  color: #94A3B8;
}

.report-axis-clear {
  border: 0;
  background: transparent;
  color: #9F1239;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
}

.report-bi-map {
  margin-bottom: 8px;
  font-weight: 600;
  color: #9F1239;
}

.report-sql {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.report-build-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.report-seg-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-seg-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9F1239;
}

.report-seg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-seg-filter {
  min-width: 220px;
  flex: 1 1 240px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  background: #FFF8F8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-seg-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #9F1239;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.report-seg-filter-field {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
}

.report-seg-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-seg-dates label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.report-seg-dates input[type="date"] {
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
}

.report-seg-multi {
  position: relative;
}

.report-seg-multi-btn {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #FFFFFF;
  text-align: left;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
  cursor: pointer;
}

.report-seg-multi-btn:hover {
  border-color: #FECACA;
}

.report-seg-multi-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
}

.report-seg-multi-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #1E293B;
  cursor: pointer;
}

.report-seg-multi-menu label:hover {
  background: #FFF1F2;
}

.report-seg-empty {
  font-size: 12px;
  color: var(--text-muted);
}

#ingestQueueMeta {
  flex: 1;
  min-width: 0;
  text-align: right;
}

#ingestQueueMeta[hidden] {
  display: none !important;
}

.ingest-board {
  --ingest-cols: 5.75rem minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1fr) 6.75rem 2.25rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.ingest-board-head,
.ingest-job {
  display: grid;
  grid-template-columns: var(--ingest-cols);
  gap: 10px 12px;
  align-items: center;
  padding: 11px 16px;
}

.ingest-board-head {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #F1F5F9;
  border-bottom: 1px solid var(--border-color);
}

.ingest-board-head span:last-child {
  justify-self: end;
}

.ingest-jobs {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.ingest-empty {
  padding: 36px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.ingest-job {
  justify-items: stretch;
  border-bottom: 1px solid #EEF2F7;
  background: transparent;
  transition: background 0.16s ease;
}

.ingest-job:last-child {
  border-bottom: none;
}

.ingest-job.is-clickable {
  cursor: pointer;
}

.ingest-log-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94A3B8;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  cursor: pointer;
  justify-self: end;
  transition: background 0.15s ease, color 0.15s ease;
}

.ingest-log-btn:hover {
  background: #FFF1F2;
  color: #9F1239;
}

.ingest-job-actions {
  position: relative;
  justify-self: end;
}

.ingest-job-menu {
  z-index: 80;
  min-width: 188px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.ingest-job-menu button {
  border-radius: 10px;
  padding: 9px 12px;
}

.ingest-job:hover,
.ingest-job.is-clickable:hover {
  background: #FFF1F2;
}

.ingest-job:hover .ingest-job-name {
  color: #9F1239;
}

.ingest-job-date {
  font-size: 13px;
  color: var(--text-muted);
}

.ingest-job-name {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.ingest-job-user,
.ingest-job-file,
.ingest-job-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  width: 100%;
}

.ingest-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.ingest-progress {
  position: relative;
  height: 4px;
  border-radius: 99px;
  background: #E2E8F0;
  overflow: hidden;
}

.ingest-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #E31C23;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ingest-progress.is-running::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: ingest-flow 1.35s ease-in-out infinite;
}

@keyframes ingest-flow {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.ingest-stage {
  font-size: 11px;
  color: var(--text-muted);
}

.ingest-job-progress {
  min-width: 0;
  width: 100%;
}

.ingest-job .status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: max-content;
  min-width: 0;
  white-space: nowrap;
  padding: 3px 9px;
  line-height: 1.25;
}

.status-andamento { background: #FEF3C7; color: #92400E; }
.status-pendente { background: #E5E7EB; color: #374151; }
.status-concluido { background: #DEF7EC; color: #03543F; }
.status-falha { background: #FDE8E8; color: #9B1C1C; }
.status-cancelado { background: #F3F4F6; color: #4B5563; }

.ingest-form-shell {
  overflow: auto;
  padding: 18px 20px 22px;
}

.ingest-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  max-width: 720px;
}

.ingest-form-span,
.ingest-field-type,
.ingest-file-field {
  min-width: 0;
}

.ingest-form-span {
  grid-column: 1 / -1;
}

.ingest-form-fileline {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px 16px;
  align-items: start;
}

.ingest-form-grid .form-group input,
.ingest-form-grid .form-group select {
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ingest-form-grid .form-group input:hover,
.ingest-form-grid .form-group select:hover,
.ingest-form-grid .form-group input:focus,
.ingest-form-grid .form-group select:focus {
  outline: none;
  border-color: #FECDD3;
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.06);
}

.ingest-form-grid .form-group input:disabled,
.ingest-form-grid .form-group select:disabled {
  background: #F1F5F9;
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

#ingestFormView.ingest-layout-hidden .ingest-layout-field {
  display: none !important;
}

#ingestFormView.ingest-layout-hidden .ingest-form-fileline {
  grid-template-columns: 1fr;
}

.ingest-form-shell .docs-file-btn {
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ingest-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingest-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ingest-toggle input {
  accent-color: #E31C23;
  margin: 0;
}

.ingest-toggle:hover {
  border-color: #FECDD3;
  background: #FFF1F2;
}

.ingest-toggle:has(input:checked) {
  border-color: #FECDD3;
  background: #FFF1F2;
  color: #9F1239;
}

.ingest-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingest-columns label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ingest-columns label:hover {
  border-color: #FECDD3;
  background: #FFF1F2;
}

.ingest-ignore-extras:not([hidden]),
#mgrIngestIgnoreExtras:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ingest-chip-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ingest-chip-row input {
  flex: 1;
}

.ingest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ingest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.ingest-chip button {
  border: 0;
  background: transparent;
  color: #9F1239;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

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

.btn-expand.is-busy,
.docs-file-btn.is-busy {
  background: #E5E7EB !important;
  color: #6B7280 !important;
  border-color: #D1D5DB !important;
  opacity: 1;
  pointer-events: none;
  cursor: wait;
}

.btn-expand.is-busy svg {
  display: none;
}

.btn-expand.is-busy::before,
.docs-file-btn.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #9CA3AF;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ingest-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.docs-file-btn.is-busy svg {
  display: none;
}

.ingest-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 18px 16px 22px;
}

.ingest-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.ingest-detail-fail {
  padding: 10px 12px;
  border: 1px solid #FECACA;
  border-radius: 10px;
  background: #FEF2F2;
  color: #991B1B;
  font-size: 13px;
}

.ingest-timeline {
  display: flex;
  align-items: flex-start;
  width: 100%;
  overflow-x: auto;
  padding: 8px 4px 4px;
}

.ingest-tl-step {
  position: relative;
  flex: 1 1 0;
  min-width: 128px;
  text-align: center;
  padding: 0 8px;
}

.ingest-tl-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  left: calc(50% + 12px);
  width: calc(100% - 24px);
  height: 2px;
  background: #E2E8F0;
  z-index: 0;
}

.ingest-tl-step.is-done:not(:last-child)::after,
.ingest-tl-step.is-fail:not(:last-child)::after {
  background: #FECDD3;
}

.ingest-tl-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  background: #fff;
}

.ingest-tl-step.is-done .ingest-tl-dot {
  background: #E31C23;
  border-color: #E31C23;
}

.ingest-tl-step.is-running .ingest-tl-dot {
  background: #FFF1F2;
  border-color: #E31C23;
  box-shadow: 0 0 0 4px rgba(227, 28, 35, 0.12);
}

.ingest-tl-step.is-fail .ingest-tl-dot {
  background: #9B1C1C;
  border-color: #9B1C1C;
}

.ingest-tl-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

.ingest-tl-time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.ingest-tl-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.ingest-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  padding: 4px 2px 18px;
  overflow: auto;
}

.ingest-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent-dark);
}

.ingest-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
}

#mgrTabIngestao .modal-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

@media (max-width: 980px) {
  .ingest-board {
    overflow: auto;
  }

  .ingest-board-head,
  .ingest-job {
    min-width: 860px;
    grid-template-columns: var(--ingest-cols);
  }

  .ingest-form-grid,
  .ingest-form-fileline {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.gerenciador-panel .vm-tab-panel {
  overflow: auto;
}

.health-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.health-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 12px;
}

.health-chip span {
  color: var(--text-muted);
  font-weight: 600;
}

.health-chip strong {
  color: var(--accent-dark);
  font-weight: 700;
}

.health-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.health-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.health-sec-link {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--primary-red);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.health-sec-link:hover,
.health-sec-link:focus-visible {
  color: var(--primary-red-hover);
}

.health-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94A3B8;
}

.health-dot.is-online {
  background: #22C55E;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.health-dot.is-offline {
  background: #EF4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.14);
}

.health-hero-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-dark);
  text-transform: lowercase;
}

.health-hero-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.health-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}

.health-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.health-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.health-row span {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.health-row strong {
  color: var(--accent-dark);
  font-weight: 700;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .health-dl {
    grid-template-columns: 1fr;
  }

  .health-row:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--border-color);
  }

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

.vm-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vm-edit-search {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  font-size: 13px;
}

.vm-file-name.is-pdf svg,
.vm-file-name.is-text svg,
.vm-file-name.is-image svg {
  color: #9F1239;
}

.vm-pdf-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: #1E1E1E;
}

.vm-preview-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.lakehouse-copy-btn:hover,
.lakehouse-copy-btn[aria-expanded="true"] {
  background: #FECDD3;
}

.lakehouse-status .lakehouse-copy-float .lakehouse-file-menu {
  bottom: calc(100% + 4px);
  top: auto;
  right: 0;
  left: auto;
  min-width: 196px;
}

.lakehouse-grid-wrap .db-table {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.lakehouse-grid-wrap .db-table th,
.lakehouse-grid-wrap .db-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  height: 32px;
  max-height: 32px;
  padding: 6px 8px;
  box-sizing: border-box;
  width: var(--lh-col-w, 21ch);
  min-width: var(--lh-col-w, 21ch);
  max-width: var(--lh-col-w, 21ch);
}

.lakehouse-grid-wrap .db-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FFF1F2;
}

.lakehouse-grid-wrap .db-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FFF1F2;
  color: #9F1239;
  box-shadow: inset 0 1px 0 #FFF1F2, 0 1px 0 #FECDD3;
}

.lh-th-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
}

.lh-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
  user-select: none;
}

.lh-col-resizer::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 3px;
  width: 1px;
  background: transparent;
}

.lh-col-resizer:hover::after,
.lh-col-resizer.is-dragging::after {
  background: #9F1239;
}

body.lh-col-dragging,
body.lh-col-dragging * {
  cursor: col-resize !important;
  user-select: none !important;
}

.lakehouse-grid-wrap .db-table tbody tr {
  cursor: default;
}

.lakehouse-empty,
.lakehouse-grid-error {
  padding: 18px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.lakehouse-grid-error {
  color: #9B1C1C;
}

.lakehouse-grid-wrap .db-table tr.lh-vspacer td {
  height: auto;
  max-height: none;
  padding: 0;
  border: none;
  line-height: 0;
}

.lakehouse-status {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-height: 26px;
  margin: 0;
  padding: 2px 4px 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: #94A3B8;
  letter-spacing: 0.01em;
  user-select: none;
}

.lakehouse-limit {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lakehouse-limit-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  padding: 0 4px 0 2px;
  border: none;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
}

.lakehouse-limit-btn svg {
  width: 11px;
  height: 11px;
  transform: rotate(90deg);
  flex-shrink: 0;
}

.lakehouse-limit-btn:hover,
.lakehouse-limit-btn[aria-expanded="true"] {
  background: #FEE2E2;
  color: #9F1239;
}

.lakehouse-limit .lakehouse-file-menu {
  bottom: calc(100% + 4px);
  top: auto;
  left: 0;
  min-width: 88px;
}

.lakehouse-limit .lakehouse-file-menu button.is-active {
  background: #FFF1F2;
  color: #9F1239;
}

.modal-card-lakehouse-ddl {
  max-width: 720px;
}

.lh-ddl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.lh-ddl-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #FECDD3;
  background: #FFF1F2;
  color: #9F1239;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.lh-ddl-table-wrap {
  overflow: auto;
  max-height: 52vh;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.lh-ddl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lh-ddl-table th,
.lh-ddl-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.lh-ddl-table th {
  position: sticky;
  top: 0;
  background: #FFF1F2;
  color: #9F1239;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lh-ddl-table tbody tr:last-child td {
  border-bottom: none;
}

.lh-ddl-table td:first-child {
  font-weight: 600;
  color: var(--accent-dark);
}

#lakehouseTableMenu {
  position: fixed;
  z-index: 10040;
}

@media (max-width: 768px) {
  .docs-panel-body,
  .lakehouse-body {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .lakehouse-tree {
    flex-basis: 180px;
    width: 180px;
    min-width: 160px;
  }

  .lakehouse-tree-toolbar .lakehouse-db-select {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

.vm-tab-panel {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.vm-tab-panel.is-visible {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

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

.vm-files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.vm-tab-panel > .kanban-error {
  flex-shrink: 0;
}

.vm-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.vm-crumb {
  border: none;
  background: transparent;
  color: var(--primary-red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.vm-crumb:hover {
  background: var(--soft-red-bg);
}

.vm-crumb.is-current {
  color: var(--accent-dark);
  cursor: default;
}

.vm-crumb.is-current:hover {
  background: transparent;
}

.vm-crumb-sep {
  color: #CBD5E1;
}

.vm-files-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vm-files-actions .btn-primary svg,
.vm-files-actions .btn-outline svg {
  width: 14px;
  height: 14px;
}

.vm-files-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.vm-files-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.vm-files-table-wrap::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.vm-files-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.vm-files-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  text-align: left;
}

.vm-files-table th,
.vm-files-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.vm-files-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--border-color);
}

.vm-files-table th:last-child,
.vm-files-table td:last-child {
  width: 52px;
  text-align: right;
}

.vm-files-table tbody tr:last-child td {
  border-bottom: none;
}

.vm-files-table tbody tr:hover {
  background: #F8FAFC;
}

.vm-files-table tbody tr.is-folder {
  background: #FFF8F8;
}

.vm-files-table tbody tr.is-folder:hover {
  background: #FFF1F2;
}

.vm-file-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: default;
  padding: 0;
  text-align: left;
}

.vm-file-name svg {
  width: 16px;
  height: 16px;
  color: var(--primary-red);
  flex-shrink: 0;
}

.vm-file-name.is-dir svg {
  width: 18px;
  height: 18px;
  color: var(--primary-red-hover);
}

.vm-file-name.is-dir,
.vm-file-name.is-image,
.vm-file-name.is-text {
  cursor: pointer;
}

.vm-file-name.is-dir:hover,
.vm-file-name.is-image:hover,
.vm-file-name.is-text:hover {
  color: var(--primary-red);
}

.vm-file-name-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vm-file-meta {
  color: var(--text-muted);
  white-space: nowrap;
}

.vm-file-type {
  color: var(--text-muted);
  font-weight: 500;
}

.vm-file-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.vm-kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.vm-kebab-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.vm-kebab-btn:hover,
.vm-kebab-btn[aria-expanded="true"] {
  background: var(--soft-red-bg);
  border-color: #FECACA;
  color: var(--primary-red);
}

.vm-file-menu {
  position: fixed;
  z-index: 260;
  min-width: 168px;
  padding: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.vm-file-menu.is-open {
  display: flex;
}

.vm-file-menu[hidden] {
  display: none !important;
}

.vm-file-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.vm-file-menu button:hover {
  background: var(--soft-red-bg);
  color: var(--primary-red);
}

.vm-file-menu button.is-danger {
  color: var(--primary-red);
}

.vm-file-menu button.is-danger:hover {
  background: #FEE2E2;
  color: var(--primary-red-hover);
}

.vm-python-selected {
  flex-shrink: 0;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vm-python-selected strong {
  color: var(--accent-dark);
  font-weight: 600;
}

#vmPythonPipBtn:hover,
#vmPythonPipBtn:focus-visible {
  max-width: 260px;
}

#vmPythonPipBtn:hover .btn-expand-label,
#vmPythonPipBtn:focus-visible .btn-expand-label {
  max-width: 200px;
}

.vm-python-pip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0 0 10px;
}

.vm-python-pip[hidden] {
  display: none !important;
}

.vm-python-pip input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 12px;
  box-sizing: border-box;
}

.vm-python-pip input[type="text"]:focus {
  border-color: #FDA4AF;
  outline: none;
  box-shadow: 0 0 0 3px rgba(254, 205, 211, 0.45);
}

.vm-python-pip input[type="text"]::placeholder {
  color: var(--text-muted);
}

.vm-python-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.vm-python-picker {
  flex: 1 1 38%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.vm-python-picker::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.vm-python-picker::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.vm-python-picker::-webkit-scrollbar-track {
  background: transparent;
}

.vm-python-picker .vm-files-table th:last-child,
.vm-python-picker .vm-files-table td:last-child {
  width: auto;
  text-align: left;
}

.vm-python-picker .vm-files-table tbody tr.is-selected {
  background: #FFF1F2;
}

.vm-python-picker .vm-files-table tbody tr.is-selected:hover {
  background: #FFE4E6;
}

.vm-python-output {
  flex: 1 1 62%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  background: #0b0d10;
  border: 1px solid #1a1f27;
  border-radius: 8px;
  color: #d8dee9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.vm-python-output.is-pending {
  color: #64748b;
}

.vm-python-output.is-fail {
  color: #fca5a5;
}

.vm-linux-panel {
  padding: 0;
  background: #0b0d10;
  border-color: #1a1f27;
}

.vm-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: #0b0d10;
}

.vm-shell-messages {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  color: #d8dee9;
  scrollbar-gutter: stable;
}

.vm-shell-msg {
  display: flex;
  max-width: 92%;
}

.vm-shell-msg.is-user {
  align-self: flex-end;
}

.vm-shell-msg.is-linux {
  align-self: stretch;
  max-width: 100%;
}

.vm-shell-bubble {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.vm-shell-msg.is-user .vm-shell-bubble {
  background: #161b22;
  border: 1px solid #2a3340;
  color: #bef264;
  border-radius: 10px 10px 4px 10px;
  padding: 8px 12px;
}

.vm-shell-msg.is-user .vm-shell-bubble::before {
  content: "$ ";
  color: #65a30d;
}

.vm-shell-msg.is-linux .vm-shell-bubble {
  width: 100%;
  background: transparent;
  color: #d8dee9;
  padding: 2px 2px 6px;
}

.vm-shell-stdout {
  color: #d8dee9;
}

.vm-shell-stderr {
  color: #fca5a5;
}

.vm-shell-exit {
  color: #64748b;
}

.vm-shell-pending {
  color: #64748b;
}

.vm-shell-composer {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  padding: 8px 10px 10px;
  background: #111318;
  border-top: 1px solid #1f242c;
}

.vm-shell-prompt {
  flex-shrink: 0;
  color: #a3e635;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 0 0 0 10px;
}

.vm-shell-composer input[type="text"] {
  flex: 1;
  height: 42px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  box-shadow: none;
  border-radius: 0;
}

.vm-shell-composer input[type="text"]:focus {
  border: 0;
  outline: none;
  box-shadow: none;
}

.vm-shell-composer input[type="text"]::placeholder {
  color: #64748b;
}

.vm-shell-send {
  width: 0;
  height: 38px;
  margin-left: 0;
  padding: 0;
  border: 1px solid #FECDD3;
  border-radius: 50%;
  background: #FFF1F2;
  color: #9F1239;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.72);
  overflow: hidden;
  pointer-events: none;
  transition:
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vm-shell-send svg {
  width: 16px;
  height: 16px;
  color: #9F1239;
}

.vm-shell-send:hover {
  background: #FFE4E6;
}

.vm-shell-send.is-visible {
  width: 38px;
  margin-left: 8px;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.vm-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  justify-content: center;
  padding: 18px 8px;
}

.vm-placeholder strong {
  font-size: 14px;
  color: var(--accent-dark);
}

.vm-placeholder p {
  font-size: 13px;
  color: var(--text-muted);
}

.vm-cron-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.vm-cron-view[hidden] {
  display: none !important;
}

.vm-cron-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}

.vm-cron-list::-webkit-scrollbar {
  width: 6px;
}

.vm-cron-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.vm-cron-empty {
  margin: auto;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.vm-cron-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #F8FAFC;
}

.vm-cron-item-main {
  min-width: 0;
}

.vm-cron-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

.vm-cron-item-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.vm-cron-item-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.vm-cron-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vm-cron-freq,
.vm-cron-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vm-cron-chip,
.vm-cron-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.vm-cron-chip:hover,
.vm-cron-day:hover {
  background: var(--soft-red-bg);
}

.vm-cron-chip.is-active,
.vm-cron-day.is-active {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.vm-cron-preview {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.vm-cron-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.vm-files-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.modal-card-vm-image {
  max-width: 860px;
}

.modal-card.modal-card-vm-edit {
  width: min(1440px, calc(100vw - 48px));
  max-width: min(1440px, calc(100vw - 48px));
  height: min(88vh, calc(100vh - 64px));
  max-height: min(88vh, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px;
}

.modal-card-vm-edit .modal-header,
.modal-card-vm-edit .modal-footer {
  flex-shrink: 0;
}

.modal-card-vm-edit .modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vm-edit-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #FFFFFF;
}

.vm-edit-gutter {
  flex: 0 0 52px;
  padding: 14px 10px 14px 8px;
  overflow: hidden;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  opacity: 0.35;
  background: #F8FAFC;
  border-right: 1px solid var(--border-color);
  white-space: pre;
  user-select: none;
  pointer-events: none;
}

.vm-edit-textarea {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  resize: none;
  border: none;
  border-radius: 0;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-main);
  background: #FFFFFF;
  tab-size: 4;
  overflow: auto;
  white-space: pre;
}

.vm-edit-textarea:focus {
  outline: none;
}

.vm-edit-python {
  background: #1E1E1E;
  border-color: #3C3C3C;
}

.vm-edit-python .vm-edit-gutter {
  background: #1E1E1E;
  color: #858585;
  opacity: 1;
  border-right-color: #3C3C3C;
}

.vm-edit-code {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #1E1E1E;
}

.vm-edit-highlight,
.vm-edit-python .vm-edit-textarea {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

.vm-edit-highlight {
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  color: #D4D4D4;
  background: transparent;
}

.vm-edit-highlight code {
  display: block;
  min-width: max-content;
  font: inherit;
  color: inherit;
}

.vm-edit-python .vm-edit-textarea {
  z-index: 1;
  color: transparent;
  caret-color: #D4D4D4;
  background: transparent;
  resize: none;
  width: 100%;
  height: 100%;
}

.vm-edit-python .vm-edit-textarea::selection {
  background: rgba(38, 79, 120, 0.85);
  color: transparent;
}

.py-kw { color: #C586C0; }
.py-fn { color: #DCDCAA; }
.py-cls { color: #4EC9B0; }
.py-str { color: #CE9178; }
.py-num { color: #B5CEA8; }
.py-cmt { color: #6A9955; }
.py-dec { color: #DCDCAA; }

.vm-image-preview {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 8px;
  background: #F8FAFC;
}

@media (max-width: 1024px) {
  .layout-top {
    grid-template-columns: 1fr;
  }
  .layout-top-right {
    height: auto;
    min-height: 0;
  }
  .etl-panel .layout-top {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
  }
  .exec-pane.is-visible {
    flex: none;
    height: auto;
    min-height: 220px;
    max-height: none;
  }
}

/* Botões */
.btn-primary {
  background: var(--primary-red);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover { background: var(--primary-red-hover); }

.btn-outline {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-outline.btn-access {
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 14px;
}

.btn-sm { font-size: 11px; padding: 4px 8px; }

.btn-copy {
  background: #F1F5F9;
  color: var(--accent-dark);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover { background: #E2E8F0; }

/* Tabela de Logs */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-bar input {
  border-radius: 999px;
  padding: 8px 14px;
}

.filter-bar input[type="date"] {
  min-width: 160px;
}

input, select {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary-red);
}

.logs-table-wrapper {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.db-table th, .db-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.db-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
}

.db-table tbody tr { cursor: pointer; }
.db-table tbody tr.is-month-active { background: #FFF1F2; }
.db-table tbody tr.is-highlighted { background: #FFE4E6; }
.db-table tbody tr:hover { background: #F8FAFC; }
.db-table tbody tr.is-month-active:hover { background: #FFE4E6; }
.db-table tbody tr.is-highlighted:hover { background: #FECDD3; }

.chart-wrap {
  position: relative;
  height: 240px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-legend-swatch.is-success { background: #10B981; }
.chart-legend-swatch.is-error { background: #EF4444; }

/* Status Badges */
.status-tag {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.status-sucesso { background: #DEF7EC; color: #03543F; }
.status-erro { background: #FDE8E8; color: #9B1C1C; }

.kanban-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

.btn-delete {
  background: none;
  border: none;
  color: #DC2626;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-delete:hover {
  background: #FEF2F2;
  text-decoration: underline;
}

/* Rotina (crontab) */
.routine-count {
  background: #F1F5F9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.routine-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.routine-list::-webkit-scrollbar { width: 6px; }
.routine-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.routine-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94A3B8;
  margin: 12px 0 6px;
}

.routine-list .routine-group:first-child {
  margin-top: 0;
}

.routine-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #F8FAFC;
  margin-bottom: 6px;
}

.routine-item.weekly {
  background: #FFF7F7;
  border-color: #FECACA;
}

.routine-item.is-next {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.routine-item.is-last:not(.is-next) {
  background: #FFF8F8;
  border-color: #FECACA;
}

.routine-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.routine-item.weekly .routine-time,
.routine-item.is-next .routine-time,
.routine-item.is-last .routine-time {
  background: #FFF1F2;
  color: #9F1239;
  border-color: #FECDD3;
}

.routine-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.routine-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-tag {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.routine-tag.is-next {
  background: #E31C23;
  color: #FFFFFF;
  border: 1px solid #E31C23;
}

.routine-tag.is-last {
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
}

.routine-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Footer (só no fim da página) */
.site-footer {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
}

.site-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: var(--docs-footer-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-footer-copy {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.site-footer-docs {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: #9F1239;
  cursor: pointer;
}

.site-footer-docs:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.docs-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card-docs {
  max-width: 560px;
  width: 90%;
  padding: 22px 24px 18px;
}

.modal-card-docs .modal-body {
  gap: 14px;
}

.docs-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.docs-form-grid .form-group:first-child,
.docs-form-grid .docs-file-field {
  grid-column: 1 / -1;
}

.docs-form-grid .form-group {
  min-width: 0;
}

.docs-form-grid input,
.docs-form-grid select {
  width: 100%;
}

.docs-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #FECDD3;
  border-radius: 8px;
  background: #FFF1F2;
  color: #9F1239;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.docs-file-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.docs-file-btn:hover {
  background: #FECDD3;
  border-color: #FDA4AF;
}

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

/* Modais Centralizados */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--overlay-scrim);
  backdrop-filter: blur(var(--overlay-blur));
  -webkit-backdrop-filter: blur(var(--overlay-blur));
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.modal-card-users {
  max-width: 720px;
}

.modal-card-account {
  max-width: 520px;
}

.account-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.account-modal-kicker {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.theme-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9F1239;
}

.theme-pill:hover {
  background: var(--soft-red-bg);
}

.theme-pill.is-solid,
.theme-pill.is-active {
  background: #FFF1F2;
  color: #9F1239;
  border-color: #FECDD3;
}

.theme-pill.is-solid:hover,
.theme-pill.is-active:hover {
  background: #FFE4E6;
  border-color: #FDA4AF;
}

.user-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analyst-perms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 0;
  padding: 2px 2px 8px;
}

.perm-section-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -2px;
  padding: 0 2px 8px;
  background: #F8FAFC;
}

.perm-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.perm-card[hidden] {
  display: none !important;
}

.perm-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.perm-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #FFF1F2;
  color: #9F1239;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perm-card-icon svg {
  width: 16px;
  height: 16px;
}

.perm-card-head strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

.perm-card-head .perm-hint {
  display: block;
  margin-top: 1px;
}

.perm-sub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #EEF2F7;
}

.perm-lead,
.perm-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

#mgrTabPermissoes #permsListView:not([hidden]),
#mgrTabPermissoes #permsFormView:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#mgrTabPermissoes #permsListView[hidden],
#mgrTabPermissoes #permsFormView[hidden] {
  display: none !important;
}

.form-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

#profileModal .form-group input,
.modal-card-users .form-group input,
.modal-card-users .form-group select {
  border-radius: 10px;
}

#profileModal .form-group input:focus,
.modal-card-users .form-group input:focus,
.modal-card-connections .form-group input:focus {
  outline: none;
  border-color: #FECACA;
  box-shadow: 0 0 0 3px rgba(254, 205, 211, 0.45);
}

.modal-card-connections .form-group input,
.modal-card-connections .form-group select {
  border-radius: 10px;
}

.modal-card-security {
  max-width: 920px;
  width: min(92vw, 920px);
  max-height: 88vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.modal-card-security .modal-header,
.modal-card-security .modal-footer {
  padding: 16px 20px;
  flex-shrink: 0;
}

.modal-card-security .modal-body {
  padding: 0 20px 16px;
  overflow: auto;
}

.security-report {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
}

.security-report h3 {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-dark);
}

.security-report p {
  margin: 0;
  color: var(--text-muted);
}

.security-report-lead {
  color: var(--text-main);
}

.security-callout {
  padding: 12px 14px;
  border: 1px solid #FECDD3;
  background: var(--soft-red-bg);
  border-radius: 10px;
}

.security-callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-red);
  font-size: 12px;
}

.security-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.security-stat {
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #FFFFFF;
}

.security-stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-dark);
}

.security-stat span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.security-table-wrap {
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.security-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.security-table th,
.security-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.security-table th {
  position: sticky;
  top: 0;
  background: #FFF1F2;
  color: #9F1239;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.security-table tbody tr:last-child td {
  border-bottom: none;
}

.security-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.security-note {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #FFFFFF;
}

.security-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
}

.security-report ol {
  margin: 0;
  padding-left: 18px;
}

.security-report li + li {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .security-grid {
    grid-template-columns: 1fr;
  }

  .health-hero {
    flex-wrap: wrap;
  }

  .health-sec-link {
    margin-left: 28px;
  }
}

.modal-card-permission {
  max-width: 420px;
}

.modal-card-connections {
  max-width: 760px;
}

#permissionModal {
  z-index: 10050;
}

.permission-modal-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--accent-dark);
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.users-toolbar-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #FFFFFF;
}

.users-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #FECACA;
  background: var(--soft-red-bg);
  color: var(--primary-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.users-row-id {
  min-width: 0;
  flex: 1;
}

.users-row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

.users-row-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-word;
}

.users-row-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.btn-user-delete {
  color: #DC2626;
  border-color: #FECACA;
}

.btn-user-delete:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
}

.users-password-target {
  font-size: 13px;
  color: var(--text-muted);
}

.task-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--accent-dark); }
.btn-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-main);
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #FECACA;
}
.form-group input[readonly] {
  background: #F8FAFC;
  color: var(--text-muted);
}
.form-error {
  color: #EF4444;
  font-size: 11px;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* Cards de conexões */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.conn-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.conn-card.is-choice {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.conn-card.is-choice:hover {
  border-color: #FECACA;
}

.conn-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.conn-card-photo {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--soft-red-bg);
  color: var(--primary-red);
  border: 1px solid #FECACA;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conn-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.conn-card-photo svg {
  width: 22px;
  height: 22px;
  color: #9F1239;
}

.conn-status {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: #94A3B8;
}

.conn-status.is-online {
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
  animation: agent-online-glow 2.6s ease-in-out infinite;
}

.conn-status.is-offline {
  background: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.conn-status.is-checking {
  background: #94A3B8;
  animation: conn-status-pulse 1.1s ease-in-out infinite;
}

@keyframes conn-status-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.conn-card-id {
  min-width: 0;
  padding-top: 2px;
}

.conn-card-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.25;
}

.conn-card-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-word;
}

.conn-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.conn-card-actions .btn-expand {
  flex: 0 0 auto;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.conn-form-footer {
  justify-content: space-between;
  align-items: center;
}

.conn-form-footer-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.credential-info { font-size: 12px; }
.credential-info span { font-weight: 600; color: var(--accent-dark); }
.code-val { font-family: monospace; background: #F1F5F9; padding: 2px 6px; border-radius: 4px; }

/* Agente MIA: overlay cobre o site inteiro (header incluso, borrado).
   Não travar overflow do body — isso mata o sticky e o header some no scroll. */
body.agent-open .fab-dock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.agent-overlay {
  --mia-fill: #FFF1F2;
  --mia-ink: #9F1239;
  --mia-line: #FECDD3;
  --mia-fill-hover: #FFE4E6;
  --mia-line-hover: #FDA4AF;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  position: fixed;
  inset: 0;
  z-index: 400;
  padding: calc(var(--header-height) + 10px) 20px 0 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(1.4px);
  -webkit-backdrop-filter: blur(1.4px);
  overscroll-behavior: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.agent-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.agent-stage {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}

.agent-chat,
.agent-query-shell {
  background: #FFFFFF;
  border: 1px solid var(--mia-line);
  box-shadow: 0 24px 60px rgba(159, 18, 57, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.agent-chat {
  width: 520px;
  max-width: 100%;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 20px 20px 0 0;
  border-bottom: none;
  pointer-events: auto;
  transform: translateY(36px);
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s ease;
}

.agent-overlay.is-open .agent-chat {
  transform: translateY(0);
  opacity: 1;
}

.agent-query-panel {
  display: none;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}

.agent-query-panel.is-open {
  display: flex;
  margin-bottom: 24px;
  pointer-events: auto;
}

.agent-query-shell {
  flex: 1;
  width: 100%;
  border-radius: 20px;
}

.agent-query-beak {
  position: absolute;
  right: -12px;
  width: 18px;
  height: 22px;
  transform: translateY(-50%);
  background: #FFFFFF;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  filter: drop-shadow(2px 1px 3px rgba(159, 18, 57, 0.12));
  z-index: 5;
  pointer-events: none;
}

.agent-chat-head,
.agent-query-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 18px;
  border-bottom: 1px solid var(--mia-line);
  background: #FFFFFF;
}

.agent-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.agent-head-pill,
.agent-close {
  height: 34px;
  border: 1px solid var(--mia-line);
  background: var(--mia-fill);
  color: var(--mia-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.agent-head-pill {
  gap: 0;
  max-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.22s ease, background 0.15s, color 0.15s, border-color 0.15s;
}

.agent-head-pill-label {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  transition: max-width 0.22s ease, opacity 0.16s ease, margin 0.22s ease;
}

.agent-head-pill:hover,
.agent-head-pill:focus-visible,
.agent-head-pill.is-active {
  max-width: 140px;
  background: var(--mia-fill-hover);
  border-color: var(--mia-line-hover);
  color: var(--mia-ink);
}

.agent-head-pill.is-expanded {
  max-width: 140px;
}

.agent-head-pill:hover .agent-head-pill-label,
.agent-head-pill:focus-visible .agent-head-pill-label,
.agent-head-pill.is-active .agent-head-pill-label,
.agent-head-pill.is-expanded .agent-head-pill-label {
  max-width: 90px;
  opacity: 1;
  margin-left: 8px;
}

.agent-close {
  width: 34px;
  border-radius: 999px;
}

.agent-head-pill svg,
.agent-close svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.agent-head-pill:hover,
.agent-close:hover,
.agent-close:focus-visible {
  background: var(--mia-fill-hover);
  border-color: var(--mia-line-hover);
  color: var(--mia-ink);
}

.agent-chat-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.agent-history {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.agent-history[hidden] {
  display: none;
}

.agent-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mia-line);
}

.agent-history-head strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
}

.agent-history-new {
  border: 1px solid var(--mia-line);
  background: var(--mia-fill);
  color: var(--mia-ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.agent-history-new:hover {
  background: var(--mia-fill-hover);
  border-color: var(--mia-line-hover);
}

.agent-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.agent-history-empty {
  margin: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.agent-history-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: start;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 10px 10px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.agent-history-item:hover {
  background: var(--mia-fill);
}

.agent-history-item.is-active {
  background: var(--mia-fill);
  border-color: var(--mia-line);
}

.agent-history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-history-preview {
  grid-column: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-history-meta {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.agent-history-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}

.agent-history-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.agent-history-delete svg {
  width: 14px;
  height: 14px;
  display: block;
}

.agent-history-delete:hover {
  background: var(--mia-fill);
  color: var(--mia-ink);
}

.agent-chat-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mia-fill);
  color: var(--mia-ink);
  border: 1px solid var(--mia-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.agent-avatar svg {
  width: 22px;
  height: 22px;
}

.agent-avatar img,
.agent-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  display: block;
}

.agent-chat-identity strong,
.agent-query-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
}

.agent-chat-identity > div > span,
.agent-query-meta {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.agent-online {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: #22C55E;
  opacity: 0.55;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
  animation: agent-online-glow 2.6s ease-in-out infinite;
}

@keyframes agent-online-glow {
  0%, 100% {
    background: #16A34A;
    opacity: 0.45;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
  }
  50% {
    background: #4ADE80;
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
  }
}

.agent-query-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.agent-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--mia-line);
  background: var(--mia-fill);
  color: var(--mia-ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.agent-export-btn svg {
  width: 14px;
  height: 14px;
}

.agent-sql-btn {
  border-color: var(--mia-line);
  background: var(--mia-fill);
  color: var(--mia-ink);
}

.agent-export-btn:hover,
.agent-export-btn.agent-sql-btn:hover {
  background: var(--mia-fill-hover);
  border-color: var(--mia-line-hover);
}

.agent-messages {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 14px;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-wallpaper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: url("../img/chat-doodle.webp?v=2");
  background-repeat: repeat;
  background-position: top left;
  background-size: 400px;
  opacity: 0.14;
  filter: hue-rotate(150deg) saturate(1.45);
  mix-blend-mode: multiply;
}

.agent-messages > :not(.agent-wallpaper) {
  position: relative;
  z-index: 1;
}

.agent-msg {
  display: flex;
  gap: 8px;
  max-width: 92%;
}

.agent-msg.is-user {
  align-self: flex-end;
  flex-direction: column;
  align-items: flex-end;
}

.agent-msg.is-agent {
  align-self: flex-start;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: end;
}

.agent-msg.is-agent .agent-msg-avatar {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 2px;
}

.agent-msg.is-agent .agent-bubble-wrap {
  grid-column: 2;
  grid-row: 1;
}

.agent-msg.is-agent .agent-msg-time {
  grid-column: 2;
  grid-row: 2;
}

.agent-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mia-fill);
  color: var(--mia-ink);
  border: 1px solid var(--mia-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.agent-msg-avatar svg {
  width: 14px;
  height: 14px;
}

.agent-bubble-wrap {
  position: relative;
  isolation: isolate;
}

.agent-bubble {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.agent-msg.is-agent .agent-bubble {
  background: #FFFFFF;
  border: 1px solid var(--mia-line);
  border-bottom-left-radius: 4px;
}

.agent-msg.is-user .agent-bubble {
  background: var(--mia-fill);
  color: var(--mia-ink);
  border: 1px solid var(--mia-line);
  border-bottom-right-radius: 4px;
}

.agent-msg.is-agent .agent-bubble-wrap::before,
.agent-msg.is-user .agent-bubble-wrap::before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
  z-index: 0;
  pointer-events: none;
}

.agent-msg.is-agent .agent-bubble-wrap::before {
  left: -6px;
  background: #FFFFFF;
  border-left: 1px solid var(--mia-line);
  border-bottom: 1px solid var(--mia-line);
  border-bottom-left-radius: 2px;
  transform: skewX(-38deg);
  transform-origin: 100% 100%;
}

.agent-msg.is-user .agent-bubble-wrap::before {
  right: -6px;
  background: var(--mia-fill);
  border-right: 1px solid var(--mia-line);
  border-bottom: 1px solid var(--mia-line);
  border-bottom-right-radius: 2px;
  transform: skewX(38deg);
  transform-origin: 0 100%;
}

.agent-msg-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--mia-ink);
  opacity: 0.5;
  padding: 0 6px;
  line-height: 1;
}

.agent-bubble p + p {
  margin-top: 8px;
}

.agent-bubble ul,
.agent-bubble ol {
  margin: 8px 0 8px 18px;
}

.agent-bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}

.agent-bubble th,
.agent-bubble td {
  border: 1px solid var(--mia-line);
  padding: 6px 8px;
  text-align: left;
}

.agent-bubble strong {
  font-weight: 700;
}

.agent-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--mia-fill);
  color: var(--mia-ink);
  padding: 1px 5px;
  border-radius: 4px;
}

.agent-sql pre,
.agent-sql pre code {
  background: transparent;
  color: var(--text-main);
  padding: 0;
  border-radius: 0;
  display: block;
  white-space: inherit;
  font-size: inherit;
}

.agent-sql {
  margin-top: 10px;
  border: 1px solid var(--mia-line);
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
}

.agent-sql-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--mia-fill);
  border-bottom: 1px solid var(--mia-line);
}

.agent-sql-head span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mia-ink);
}

.agent-sql-run:disabled {
  cursor: wait;
}

.agent-sql pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  color: var(--text-main);
  background: #FFFFFF;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.agent-sql pre code {
  font-family: inherit;
}

.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.agent-chip {
  border: 1px solid var(--mia-line);
  background: var(--mia-fill);
  color: var(--mia-ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.agent-chip:hover {
  border-color: var(--mia-line-hover);
  background: var(--mia-fill-hover);
  color: var(--mia-ink);
}

.agent-typing {
  display: inline-flex;
  gap: 5px;
  padding: 2px 6px;
}

.agent-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FDA4AF;
  animation: agent-dot 1s infinite ease-in-out;
}

.agent-typing span:nth-child(2) { animation-delay: 0.15s; }
.agent-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes agent-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.agent-composer {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #FFFFFF;
  border-top: 1px solid var(--mia-line);
}

.agent-composer input[type="text"] {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  background: #FFFFFF;
  border: 1px solid var(--mia-line);
  color: var(--text-main);
}

.agent-composer input[type="text"]::placeholder {
  color: var(--mia-ink);
  opacity: 0.55;
}

.agent-composer input[type="text"]:focus {
  outline: none;
  border-color: var(--mia-line-hover);
  background: var(--mia-fill);
  box-shadow: 0 0 0 3px rgba(254, 205, 211, 0.45);
}

.agent-send {
  width: 0;
  height: 44px;
  margin-left: 0;
  padding: 0;
  border: 1px solid #FECDD3;
  border-radius: 50%;
  background: #FFF1F2;
  color: #9F1239;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  opacity: 0;
  transform: scale(0.72);
  overflow: hidden;
  pointer-events: none;
  transition:
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.agent-send svg {
  width: 18px;
  height: 18px;
  color: #9F1239;
}

.agent-send:hover {
  background: #FFE4E6;
}

.agent-send.is-visible {
  width: 44px;
  margin-left: 8px;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.agent-query-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-query-empty,
.agent-query-error {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 16px;
}

.agent-query-error {
  color: var(--mia-ink);
}

.agent-query-table-wrap {
  flex: 1;
  min-height: 0;
  background: #FFFFFF;
  border: 1px solid var(--mia-line);
  border-radius: 12px;
  overflow: auto;
}

.agent-query-table-wrap .db-table th,
.agent-query-table-wrap .db-table td {
  white-space: nowrap;
}

.agent-query-table-wrap .db-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--mia-fill);
  color: var(--mia-ink);
  box-shadow: 0 1px 0 var(--mia-line);
}

.agent-query-sql {
  flex-shrink: 0;
  max-height: 120px;
  overflow: auto;
  margin-top: 0;
  font-size: 11px;
  color: var(--text-main);
  background: var(--mia-fill);
  border: 1px dashed var(--mia-line);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.agent-messages,
.agent-history-list,
.agent-query-table-wrap,
.agent-sql pre,
.agent-query-sql {
  scrollbar-width: thin;
  scrollbar-color: var(--mia-line) transparent;
}

.agent-messages::-webkit-scrollbar,
.agent-history-list::-webkit-scrollbar,
.agent-query-table-wrap::-webkit-scrollbar,
.agent-sql pre::-webkit-scrollbar,
.agent-query-sql::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.agent-messages::-webkit-scrollbar-thumb,
.agent-history-list::-webkit-scrollbar-thumb,
.agent-query-table-wrap::-webkit-scrollbar-thumb,
.agent-sql pre::-webkit-scrollbar-thumb,
.agent-query-sql::-webkit-scrollbar-thumb {
  background: var(--mia-line);
  border-radius: 999px;
}

.agent-messages::-webkit-scrollbar-track,
.agent-history-list::-webkit-scrollbar-track,
.agent-query-table-wrap::-webkit-scrollbar-track,
.agent-sql pre::-webkit-scrollbar-track,
.agent-query-sql::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 980px) {
  .agent-stage {
    position: relative;
    height: 100%;
  }

  .agent-chat {
    width: 100%;
    max-width: 100%;
  }

  .agent-query-panel.is-open {
    position: absolute;
    inset: 12px 0 24px;
    z-index: 2;
    margin-bottom: 0;
  }

  .agent-query-beak {
    display: none;
  }
}

body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -8%, #FFE4E6 0%, transparent 58%),
    var(--bg-color);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 32px 28px;
}

.login-card .brand {
  margin-bottom: 16px;
}

.login-kicker {
  display: inline-flex;
  margin-bottom: 12px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.login-copy {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.login-error {
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.login-card .form-group {
  margin-bottom: 12px;
}

.login-card .form-group input {
  padding: 10px 12px;
  border-radius: 10px;
}

.login-card .form-group input:focus {
  outline: none;
  border-color: #FECACA;
  box-shadow: 0 0 0 3px rgba(254, 205, 211, 0.45);
}

.login-submit {
  width: 100%;
  max-width: none;
  height: 44px;
  justify-content: center;
  margin-top: 10px;
  font-size: 13px;
}

.login-submit .btn-expand-label {
  max-width: none;
}

.login-foot {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* Celular: empilha e cabe na tela. Desktop (acima de 720px) não muda. */
@media (max-width: 720px) {
  :root {
    --header-height: 63px; /* inner 10+42+10 + border 1 */
    --main-padding-top: 12px;
    --main-padding-bottom: 72px;
    --card-padding: 14px;
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .main-content-full {
    padding: var(--main-padding-top) 12px var(--main-padding-bottom);
    overflow-x: clip;
  }

  .page-section-bar-inner {
    padding: 0 12px;
  }

  .top-header-inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-logo {
    height: 28px;
  }

  .brand-title {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand-subtitle {
    display: none;
  }

  .user-chip-btn {
    padding: 2px;
    gap: 6px;
  }

  .user-chip-id {
    display: none;
  }

  .user-popover {
    width: min(380px, calc(100vw - 24px));
    right: 0;
  }

  .card {
    padding: var(--card-padding);
    margin-bottom: 16px;
  }

  .card-header {
    align-items: flex-start;
  }

  .card-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .card-header-actions .btn-expand {
    flex: 0 0 auto;
  }

  .vm-tab-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .vm-files-toolbar {
    align-items: stretch;
  }

  .vm-files-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .vm-files-table {
    min-width: 560px;
  }

  .vm-python-pip {
    flex-wrap: wrap;
  }

  .vm-python-pip input[type="text"] {
    flex: 1 1 100%;
  }

  .vm-python-picker .vm-files-table {
    min-width: 0;
  }

  .modal-card.modal-card-vm-edit,
  .modal-card-vm-image {
    width: 100%;
    max-width: none;
    height: min(92dvh, 92vh);
    max-height: min(92dvh, 92vh);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-bar input,
  .filter-bar input[type="date"] {
    width: 100%;
    min-width: 0;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .logs-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .logs-table-wrapper .db-table {
    min-width: 560px;
  }

  .layout-top {
    gap: 16px;
  }

  .layout-top-right {
    min-height: 0;
    height: auto;
  }

  .card-rotina {
    max-height: min(70vh, var(--section-body-height-mobile));
  }

  .site-footer-inner {
    padding: 0 12px calc(env(safe-area-inset-bottom));
    min-height: calc(var(--docs-footer-height) + env(safe-area-inset-bottom));
  }

  .fab-dock {
    right: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .fab-ai {
    height: 48px;
    padding: 0 16px 0 14px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: env(safe-area-inset-top) 0 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
  }

  .modal-card {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 92vh);
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .users-toolbar {
    flex-wrap: wrap;
  }

  .users-row {
    flex-direction: column;
    align-items: stretch;
  }

  .users-row-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .report-axis-grid {
    grid-template-columns: 1fr;
  }

  .conn-form-footer {
    flex-wrap: wrap;
  }

  .credential-row {
    flex-wrap: wrap;
  }

  .agent-overlay {
    padding: calc(var(--header-height) + 8px) 0 0;
  }

  .agent-chat {
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .agent-query-panel.is-open {
    inset: 8px 8px 16px;
  }

  .agent-query-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .agent-query-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .agent-messages {
    padding: 14px 12px 12px;
  }

  .agent-composer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .agent-history {
    width: min(280px, 78vw);
  }

  body.login-page {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .login-card {
    padding: 24px 18px;
    border-radius: 16px;
  }
}

.sf-panel {
  margin-bottom: 0;
}

.sf-panel > .sf-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sf-panel > .sf-view[hidden] {
  display: none !important;
}

.sf-toolbar {
  flex-wrap: wrap;
}

.sf-search {
  min-width: 180px;
  flex: 1 1 180px;
  max-width: 320px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  align-self: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #FFFFFF;
  appearance: none;
  -webkit-appearance: none;
}

.sf-search:focus {
  outline: none;
  border-color: #FECACA;
}

.perm-sub .perm-sf-search {
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
}

.sf-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.sf-list-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}

#sfObjectsGrid.is-dimmed {
  opacity: 0.35;
  pointer-events: none;
}

.sf-loading,
.dv-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 13px;
}

.sf-loading[hidden],
#sfLoading[hidden],
.dv-loading[hidden] {
  display: none !important;
}

#sfLoading.sf-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(248, 250, 252, 0.72);
}

.sf-donut,
.dv-donut {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #FECACA;
  border-top-color: #9F1239;
  animation: sf-spin 0.75s linear infinite;
}

.dv-loading.is-compact {
  min-height: 64px;
  padding: 8px 0;
  gap: 8px;
  font-size: 12px;
}

.dv-loading.is-compact .dv-donut {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

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

.sf-table-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
  margin: 0 0 8px;
}

.sf-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #FFFFFF;
}

.sf-soql-body {
  flex: 1 1 auto;
  min-height: 0;
}

.sf-soql-body .lakehouse-toolbar #sfSoqlRunBtn {
  margin-left: auto;
}

.sf-sql-stack {
  min-height: 140px;
}

.sf-col-row {
  cursor: default;
  font-weight: 400;
}

.sf-col-row:hover {
  background: transparent;
}

.sf-col-type {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.sf-rel-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  position: relative;
}

.sf-rel-stage {
  position: relative;
  margin: 24px auto;
}

.sf-rel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sf-rel-line {
  stroke: #FECACA;
  stroke-width: 2;
}

.sf-rel-line.is-parent {
  stroke: #FB7185;
}

.sf-rel-line.is-child {
  stroke: #94A3B8;
  stroke-dasharray: 5 4;
}

.sf-rel-center,
.sf-rel-node {
  position: absolute;
  width: 240px;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1;
}

.sf-rel-center {
  border-color: #9F1239;
  box-shadow: 0 8px 24px rgba(159, 18, 57, 0.12);
  z-index: 2;
}

.sf-rel-node {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.sf-rel-node:hover {
  border-color: #FB7185;
}

.sf-rel-empty {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-muted);
}

.sf-rel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 8px 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.sf-rel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: #94A3B8;
}

.sf-rel-dot.is-parent {
  background: #FB7185;
}

.sf-rel-legend span {
  display: inline-flex;
  align-items: center;
}

.conn-card-actions .btn-expand:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.sf-card-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  margin-top: auto;
}

.sf-card-actions .btn-expand-outline {
  flex-direction: row-reverse;
}

.sf-card-actions .btn-expand-outline:hover .btn-expand-label,
.sf-card-actions .btn-expand-outline:focus-visible .btn-expand-label {
  margin-left: 0;
  margin-right: 8px;
}