.navbar-vertical .navbar-brand {
  margin: 0;
  padding: 1rem 0.75rem 0.5rem;
}

.sidebar-logo-wrap {
  display: inline-block;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  line-height: 0;
}

.sidebar-logo-wrap img {
  max-height: 64px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.sidebar-logo-fallback {
  display: block;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.25;
}

.navbar-vertical .navbar-divider {
  margin: 0.35rem 1rem 0.5rem;
  border-color: rgba(255, 255, 255, 0.15);
}

a.external-link {
  color: var(--tblr-primary, #206bc4);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 0.15em;
}

a.external-link:hover {
  text-decoration-style: solid;
}

#sidebar-collapse-btn {
  position: fixed;
  z-index: 1045;
  top: 0.5rem;
  left: calc(var(--tblr-navbar-vertical-width, 16rem) - 1.125rem);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  transition: left 0.2s ease;
}

.page.sidebar-collapsed #sidebar-collapse-btn {
  left: 0.25rem;
  border-radius: 6px;
}

#sidebar-collapse-btn .icon-expanded { display: inline; }
#sidebar-collapse-btn .icon-collapsed { display: none; }
.page.sidebar-collapsed #sidebar-collapse-btn .icon-expanded { display: none; }
.page.sidebar-collapsed #sidebar-collapse-btn .icon-collapsed { display: inline; }

.app-topbar .navbar-brand {
  font-size: 1.125rem;
  font-weight: 600;
}

@media (min-width: 992px) {
  .page.sidebar-collapsed .navbar-vertical {
    transform: translateX(-100%);
    pointer-events: none;
  }
  .page.sidebar-collapsed .page-wrapper {
    margin-left: 0 !important;
  }
  .app-topbar .container-xl {
    padding-left: 0.75rem;
  }
}

.navbar-vertical {
  transition: transform 0.2s ease;
}

.badge-status-active {
  background-color: var(--tblr-success, #2fb344) !important;
  color: #fff !important;
}

.badge-status-inactive {
  background-color: var(--tblr-secondary, #6c757d) !important;
  color: #1a1a1a !important;
}

.logo-preview-box {
  display: inline-block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  max-width: 100%;
}

.logo-preview-box img {
  max-height: 80px;
  max-width: 280px;
  object-fit: contain;
  display: block;
}

/* Menu de contexto — fixo no viewport (não usar Bootstrap dropdown em .card/table).
   Classes legadas s3-ctx-* mantidas para storage_browse. Ver DOC/UI/01-menu-de-contexto.md */
.app-ctx-menu,
.s3-ctx-menu {
  position: fixed;
  z-index: 2000;
  display: none;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0;
}

.app-ctx-menu.is-open,
.s3-ctx-menu.is-open {
  display: block;
}

.app-ctx-menu .app-ctx-item,
.s3-ctx-menu .s3-ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  color: #1f2937;
  text-decoration: none;
  cursor: pointer;
}

.app-ctx-menu .app-ctx-item:hover,
.s3-ctx-menu .s3-ctx-item:hover {
  background: #f1f5f9;
}

.app-ctx-menu .app-ctx-item.danger,
.s3-ctx-menu .s3-ctx-item.danger {
  color: #d63939;
}

.app-ctx-menu hr,
.s3-ctx-menu hr {
  margin: 0.35rem 0;
  opacity: 0.15;
}

.app-ctx-trigger {
  white-space: nowrap;
}

/* Lista de etapas do job — reordenação por arrastar */
.job-steps-sortable .job-step-item {
  cursor: default;
  transition: background-color 0.15s ease;
}

.job-step-dragging {
  opacity: 0.55;
}

.job-step-drag-over {
  background-color: #f1f5f9;
}

.job-step-handle {
  cursor: grab;
  color: #6c757d;
  user-select: none;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  font-size: 1.1rem;
}

.job-step-handle:active {
  cursor: grabbing;
}

.job-step-handle[draggable="false"] {
  cursor: not-allowed;
  opacity: 0.4;
}

.s3-actions-btn {
  min-width: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
}

#copy-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2100;
}

/* Modal prévia Parquet */
.parquet-preview-dialog {
  max-width: min(1140px, 96vw);
}

.parquet-preview-dialog .modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.parquet-preview-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.parquet-preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}

.parquet-preview-meta {
  flex-shrink: 0;
}

.parquet-schema-section {
  flex-shrink: 0;
}

.parquet-schema-toggle {
  border-radius: 6px;
  font-size: 0.875rem;
}

.parquet-schema-toggle[aria-expanded="true"] {
  border-radius: 6px 6px 0 0;
  border-bottom: 0;
}

.parquet-schema-chevron {
  display: inline-block;
  width: 1rem;
  font-size: 0.75rem;
}

.parquet-schema-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 1.25rem;
  list-style: none;
  padding: 0.65rem 0.85rem;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #dee2e6;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  font-size: 0.78rem;
}

.parquet-schema-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.parquet-schema-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parquet-schema-type {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parquet-data-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0.25rem;
}

.parquet-data-label {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.parquet-data-scroll {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}

.parquet-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-size: 0.75rem;
  white-space: nowrap;
  vertical-align: bottom;
}

.parquet-data-table td {
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 992px) {
  .parquet-schema-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .parquet-schema-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
