:root {
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafb;
  --app-border: #dde4ea;
  --app-border-strong: #c8d2dc;
  --app-text: #1f2933;
  --app-muted: #667784;
  --app-primary: #2364aa;
  --app-primary-strong: #174f88;
  --app-teal: #168a7a;
  --app-amber: #b87503;
  --app-rose: #ba3b46;
  --app-indigo: #5867c3;
  --app-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
  --app-content-max: 1360px;
  --app-page-gutter: 0.6rem;
}

html {
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

a {
  color: var(--app-primary);
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 0 rgba(31, 41, 51, 0.02);
  backdrop-filter: blur(10px);
}

.app-navbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  gap: 0.42rem;
  justify-content: space-between;
}

.app-navbar .navbar-collapse {
  min-width: 0;
}

.navbar-toggler {
  flex: 0 0 auto;
  margin-left: auto;
  border-color: var(--app-border-strong);
  border-radius: 8px;
}

.navbar-toggler-icon {
  position: relative;
  width: 1.25rem;
  height: 1rem;
  background-image: none;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon {
  border-top: 2px solid #465661;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  position: absolute;
  left: 0;
  width: 100%;
  content: "";
}

.navbar-toggler-icon::before {
  top: 0.38rem;
}

.navbar-toggler-icon::after {
  top: 0.78rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  flex: 0 1 auto;
  min-width: 160px;
  margin-right: 0.25rem;
}

.app-brand-mark-image {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
}

.app-brand-title,
.app-brand-subtitle {
  display: block;
  line-height: 1.1;
}

.app-brand-title {
  font-weight: 800;
  color: var(--app-text);
}

.app-brand-subtitle {
  margin-top: 0.15rem;
  color: var(--app-muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
}

.app-nav-links {
  gap: 0.02rem;
  min-width: 0;
}

.app-navbar-search {
  flex: 1 1 360px;
  max-width: 460px;
  position: relative;
}

.app-navbar-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-muted);
  pointer-events: none;
  z-index: 2;
}

.app-navbar-search-icon svg {
  width: 16px;
  height: 16px;
}

.app-navbar-search-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding-left: 2.15rem;
  padding-right: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: none;
}

.app-navbar-search-input::placeholder {
  color: var(--app-muted);
}

.app-navbar-search-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgba(35, 100, 170, 0.12);
}

.app-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: #465661;
  padding: 0;
}

.app-icon-pill:hover,
.app-icon-pill:focus {
  background: var(--app-surface-soft);
  color: var(--app-primary);
}

.app-icon-pill svg {
  width: 17px;
  height: 17px;
}

.app-icon-pill.dropdown-toggle::after,
.erp-alertas-toggle.dropdown-toggle::after {
  display: none;
}

.app-nav-launcher .dropdown-menu,
.app-user-nav .dropdown-menu {
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  padding: 0.55rem;
  min-width: 250px;
  max-width: min(320px, calc(100vw - 1rem));
}

.app-user-nav .dropdown-menu {
  min-width: 220px;
}

.app-nav-launcher .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  border-radius: 8px;
  padding: 0.48rem 0.7rem;
  font-weight: 650;
}

.app-nav-launcher .dropdown-item svg {
  width: 16px;
  height: 16px;
}

.app-user-nav .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  border-radius: 8px;
  padding: 0.48rem 0.7rem;
  font-weight: 650;
}

.app-user-nav .dropdown-item svg {
  width: 16px;
  height: 16px;
}

.app-nav-launcher .dropdown-item.active,
.app-nav-launcher .dropdown-item:active,
.app-nav-launcher .dropdown-item:hover,
.app-user-nav .dropdown-item.active,
.app-user-nav .dropdown-item:active,
.app-user-nav .dropdown-item:hover {
  background: #eaf2fb;
  color: var(--app-primary-strong);
}

.app-nav-launcher .dropdown-toggle::after {
  margin-left: 0.28rem;
}

.app-nav-links .nav-link,
.app-user-nav .nav-link,
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 32px;
  border-radius: 8px;
  color: #465661;
  font-weight: 650;
  padding: 0.28rem 0.42rem;
  font-size: 0.83rem;
  white-space: nowrap;
  max-width: 100%;
}

.app-nav-links .nav-link svg,
.app-user-nav .nav-link svg,
.btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.app-nav-links .nav-link:hover,
.app-user-nav .nav-link:hover,
.logout-button:hover {
  background: var(--app-surface-soft);
  color: var(--app-primary);
}

.app-nav-links .nav-link.active {
  background: #eaf2fb;
  color: var(--app-primary-strong);
}

.app-user-pill {
  max-width: 160px;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-user-nav {
  flex-shrink: 0;
  gap: 0.25rem;
}

.logout-form {
  margin: 0;
}

.logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.account-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 1rem;
}

.account-panel {
  min-height: 100%;
}

.auth-brand-logo {
  display: block;
  max-width: 420px;
  width: 100%;
  height: auto;
}

.selection-brand-banner {
  display: block;
  max-width: 360px;
  width: 100%;
  margin-inline: auto;
}

.systems-selection-page {
  max-width: 1320px;
}

.systems-selection-page > .text-center {
  max-width: 860px;
  margin-inline: auto;
}

.systems-selection-page .erp-system-card {
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.systems-selection-page .erp-system-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
  border-color: #c9d6e3;
}

.systems-selection-page .erp-system-card .card-body {
  display: flex;
  flex-direction: column;
}

.systems-selection-page .erp-system-card .d-grid {
  margin-top: auto;
}

.systems-selection-page .system-icon-wrap {
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
  padding: 0.15rem;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.systems-selection-page .system-icon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.systems-selection-page .system-icon-fallback {
  background: linear-gradient(180deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 14px;
}

.systems-selection-page .system-card-suprimentos {
  border-left: 5px solid var(--app-primary);
}

.systems-selection-page .system-card-engenharia {
  border-left: 5px solid #27313a;
}

.erp-route-result {
  padding: 0.95rem;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface-soft);
}

.erp-route-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.erp-route-summary {
  min-width: 0;
}

.erp-route-map-shell {
  min-width: 0;
}

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

.erp-route-kpi > div {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
}

.erp-route-map {
  min-height: 560px;
  height: 560px;
  border-radius: 14px;
  border: 1px solid var(--app-border);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(43, 108, 176, 0.06), rgba(43, 108, 176, 0.02));
  align-self: stretch;
}

.erp-route-map--lt01 {
  min-height: 640px;
  height: 640px;
}

@media (min-width: 993px) {
  .erp-route-map {
    position: sticky;
    top: 5.75rem;
    align-self: flex-start;
  }
}

.erp-route-map .leaflet-container {
  min-height: 560px;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

.erp-route-map--lt01 .leaflet-container {
  min-height: 640px;
}

.erp-route-leaflet {
  min-height: 560px;
  width: 100%;
  height: 100%;
}

.erp-route-leaflet-placeholder {
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.erp-route-iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  display: block;
  background: #fff;
}

.erp-route-google-link {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.25rem;
  border: 1px dashed var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
}

.erp-route-segments {
  margin-top: 1rem;
}

.erp-route-segment {
  padding: 0.9rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
}

.eng-exec-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1280px;
}

.eng-exec-table th,
.eng-exec-table td {
  vertical-align: middle;
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
}

.eng-exec-table td {
  line-height: 1.35;
}

.eng-exec-table td,
.eng-exec-table th {
  vertical-align: middle !important;
}

.eng-exec-table th:nth-child(1),
.eng-exec-table td:nth-child(1) {
  width: 4rem;
  white-space: nowrap;
}

.eng-exec-table th:nth-child(2),
.eng-exec-table td:nth-child(2) {
  min-width: 200px;
}

.eng-exec-table th:nth-child(3),
.eng-exec-table td:nth-child(3) {
  min-width: 260px;
}

.eng-exec-table th:nth-child(4),
.eng-exec-table td:nth-child(4),
.eng-exec-table th:nth-child(5),
.eng-exec-table td:nth-child(5),
.eng-exec-table th:nth-child(6),
.eng-exec-table td:nth-child(6),
.eng-exec-table th:nth-child(7),
.eng-exec-table td:nth-child(7) {
  white-space: nowrap;
}

.eng-exec-table th:nth-child(4),
.eng-exec-table td:nth-child(4) {
  width: 13%;
}

.eng-exec-table th:nth-child(5),
.eng-exec-table td:nth-child(5) {
  width: 14%;
}

.eng-exec-table th:nth-child(6),
.eng-exec-table td:nth-child(6) {
  width: 9%;
}

.eng-exec-table th:nth-child(7),
.eng-exec-table td:nth-child(7) {
  width: 21%;
}

.eng-exec-table td .btn {
  white-space: nowrap;
}

.eng-route-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eng-exec-table td .eng-route-text {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: normal;
}

.eng-exec-table td:nth-child(4),
.eng-exec-table td:nth-child(5),
.eng-exec-table td:nth-child(6),
.eng-exec-table td:nth-child(7) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.eng-exec-table td.eng-period-cell,
.eng-exec-table td.eng-status-cell,
.eng-exec-table td.eng-value-cell,
.eng-exec-table td.eng-route-cell {
  vertical-align: middle !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eng-exec-table td.eng-period-cell,
.eng-exec-table td.eng-route-cell {
  min-width: 0;
}

.eng-exec-table td.eng-period-cell .table-text-sub,
.eng-exec-table td.eng-route-cell .table-text-sub,
.eng-exec-table td.eng-route-cell .eng-route-text {
  white-space: nowrap !important;
}

.eng-exec-table td {
  vertical-align: top !important;
}

.eng-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.eng-timeline-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.eng-timeline-label {
  min-width: 0;
}

.eng-timeline-track {
  position: relative;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-soft);
  overflow: hidden;
}

.eng-timeline-track::before {
  content: "";
  position: absolute;
  inset-inline: 12px;
  top: 50%;
  height: 1px;
  background: color-mix(in srgb, var(--app-text) 14%, transparent);
  transform: translateY(-50%);
}

.eng-timeline-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  border-radius: 12px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  background: var(--eng-bar-color, rgba(43, 108, 176, 0.96));
  color: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
  overflow: hidden;
  min-width: 84px;
  max-width: calc(100% - 24px);
}

.eng-timeline-bar span {
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
}

@media (max-width: 992px) {
  .erp-route-grid {
    grid-template-columns: 1fr;
  }

  .erp-route-map {
    min-height: 300px;
    height: 300px;
  }

  .erp-route-map--lt01 {
    min-height: 360px;
    height: 360px;
  }

  .eng-timeline-row {
    grid-template-columns: 1fr;
  }

  .eng-timeline-axis {
    margin-left: 0;
  }

  .eng-timeline-track {
    min-height: 48px;
  }
}

.erp-access-denied-modal .modal-content {
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

.erp-access-denied-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: #f8fbff;
  color: var(--app-primary);
  border: 1px solid #d5e4f3;
}

.erp-access-denied-icon svg {
  width: 38px;
  height: 38px;
}

.evol01-topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.evol01-topbar .badge {
  min-height: 28px;
  padding-inline: 0.65rem;
  border-radius: 999px;
}

.evol01-topbar .btn,
.evol01-topbar .dropdown-toggle {
  border-radius: 999px;
}

@media (max-width: 992px) {
  .account-page-grid {
    grid-template-columns: 1fr;
  }
}

.app-main {
  width: min(calc(100% - (var(--app-page-gutter) * 2)), var(--app-content-max));
  max-width: var(--app-content-max);
  margin-inline: auto;
  padding-top: 0.9rem;
  padding-bottom: 2.1rem;
}

.app-shell {
  animation: appFadeIn 0.18s ease-out;
}

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-alert-stack {
  margin-bottom: 1rem;
}

.app-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}

.app-page-header > div:first-child {
  min-width: 0;
}

.app-page-kicker {
  color: var(--app-muted);
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.app-page-header h1 {
  margin: 0;
  font-size: 1.54rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.app-page-subtitle {
  max-width: 660px;
  margin: 0.35rem 0 0;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 32px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn svg {
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover {
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
}

.btn-outline-primary {
  color: var(--app-primary);
  border-color: #a9c7e8;
}

.btn-outline-primary:hover {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-outline-secondary {
  color: #4d5e6a;
  border-color: var(--app-border-strong);
}

.section-panel,
.metric-card,
.form-panel,
.auth-card,
.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
}

.section-panel {
  min-width: 0;
  margin-bottom: 0.75rem;
}

.card {
  overflow: hidden;
}

.card-header {
  background: var(--app-surface-soft);
  border-bottom-color: var(--app-border);
  font-weight: 800;
}

.section-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
}

.section-panel-header > div:first-child {
  min-width: 0;
}

.section-panel-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.section-panel-subtitle {
  margin: 0.2rem 0 0;
  color: var(--app-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.section-panel-body {
  padding: 0.8rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 0.72rem;
  margin-bottom: 0.72rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 0.78rem;
}

.metric-card.compact {
  min-height: 116px;
}

.eng-board-stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.eng-board-stat-card:hover {
  color: inherit;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .eng-board-stat-card:hover {
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.28);
}

.metric-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--metric-accent, var(--app-primary));
  background: color-mix(in srgb, var(--metric-accent, var(--app-primary)) 12%, white);
  border: 1px solid color-mix(in srgb, var(--metric-accent, var(--app-primary)) 24%, white);
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-accent, var(--app-primary));
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.metric-value {
  margin: 0.45rem 0 0.4rem;
  color: var(--app-text);
  font-size: 2rem;
  line-height: 1;
  font-weight: 850;
}

.metric-note {
  color: var(--app-muted);
  margin: 0;
  min-height: 42px;
}

.metric-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.metric-link svg {
  width: 16px;
  height: 16px;
}

.metric-card.primary { --metric-accent: var(--app-primary); }
.metric-card.teal { --metric-accent: var(--app-teal); }
.metric-card.amber { --metric-accent: var(--app-amber); }
.metric-card.indigo { --metric-accent: var(--app-indigo); }

.quick-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.quick-action-list.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 62px;
  padding: 0.8rem;
  color: var(--app-text);
  text-decoration: none;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
}

.quick-action:hover {
  color: var(--app-primary-strong);
  border-color: #a9c7e8;
  background: #f1f7fd;
  transform: translateY(-1px);
}

.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eaf2fb;
  color: var(--app-primary);
}

.quick-action-title {
  display: block;
  font-weight: 800;
}

.quick-action-caption {
  display: block;
  color: var(--app-muted);
  font-size: 0.84rem;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-toolbar form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-toolbar .form-label {
  margin-bottom: 0;
}

.dashboard-toolbar .form-select {
  min-width: 180px;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.table-responsive {
  border-radius: inherit;
}

.table-responsive .table {
  width: 100%;
  table-layout: fixed;
}

.table-responsive th,
.table-responsive td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.table-responsive td:last-child,
.table-responsive th:last-child {
  white-space: nowrap;
}

.table-responsive .table {
  width: 100%;
  table-layout: fixed;
}

.table-responsive th,
.table-responsive td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.table-responsive td:last-child,
.table-responsive th:last-child {
  white-space: nowrap;
}

.table thead th {
  color: #52626e;
  background: var(--app-surface-soft);
  border-bottom: 1px solid var(--app-border);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td,
.table tfoot th {
  border-color: #e8edf2;
  vertical-align: middle;
  min-width: 0;
  overflow-wrap: break-word;
}

.table tbody tr:hover {
  background: #fbfcfd;
}

.table-text-block {
  min-width: 0;
  width: 100%;
}

.table-text-main,
.table-text-sub {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-text-main {
  font-weight: 800;
  color: var(--app-text);
  white-space: nowrap;
}

.table-text-sub {
  color: var(--app-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.table-text-sub.tight {
  margin-top: 0.05rem;
}

.eng-items-table {
  table-layout: fixed;
}

.eng-items-table th,
.eng-items-table td {
  vertical-align: middle;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.eng-items-table td {
  white-space: normal;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: break-word;
}

.eng-items-table td .table-text-main {
  white-space: normal;
}

.eng-items-table td .table-text-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.eng-exec-table td,
.eng-exec-table td .table-text-sub,
.eng-exec-table td .table-text-sub.tight {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.eng-items-table td:nth-child(1),
.eng-items-table td:nth-child(6),
.eng-items-table td:nth-child(7),
.eng-items-table td:nth-child(8) {
  white-space: nowrap;
}

.erp-topbar-label {
  color: var(--app-muted);
  font-size: 0.875rem;
  line-height: 1.2;
}

html[data-theme="dark"] .erp-topbar-label {
  color: #cbd5e1;
}

.erp-topbar-section {
  color: var(--app-muted);
  font-weight: 800;
}

html[data-theme="dark"] .erp-topbar-section {
  color: #94a3b8;
}

.table a:not(.btn) {
  text-decoration: none;
  font-weight: 750;
}

.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.table-action-group .btn {
  white-space: normal;
  text-align: left;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-toolbar form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-toolbar .form-label {
  margin-bottom: 0;
}

.dashboard-toolbar .form-select {
  min-width: 180px;
}

.section-panel form.row {
  --bs-gutter-x: 0.7rem;
}

.section-panel form.row > [class*="col-"] {
  min-width: 0;
}

.section-panel form.row .col-auto {
  flex: 0 0 auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 850;
  border: 1px solid transparent;
}

.status-open,
.status-pending {
  color: #7a4b00;
  background: #fff5df;
  border-color: #f1d49a;
}

.status-approved,
.status-accepted {
  color: #0e665a;
  background: #e6f5f2;
  border-color: #bfe2dc;
}

.status-rejected,
.status-canceled {
  color: #983341;
  background: #fdecef;
  border-color: #f3c0c7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.em_andamento {
  color: #0f5f93;
  background: #e8f2fb;
  border-color: #b8d5ef;
}

.status-pill.em_risco {
  color: #9c5a00;
  background: #fff1d7;
  border-color: #f0c96e;
}

.status-pill.concluido {
  color: #126b56;
  background: #e5f5ef;
  border-color: #b9e4d1;
}

.status-pill.outros {
  color: #475569;
  background: #eef2f7;
  border-color: #d5dde8;
}

.detail-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.detail-strip.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-strip.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-item {
  min-height: 74px;
  padding: 0.8rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.detail-label {
  color: var(--app-muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-value {
  display: block;
  margin-top: 0.25rem;
  font-weight: 800;
}

.form-panel {
  padding: 1.15rem;
}

.form-label,
label {
  color: #40515c;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-color: var(--app-border-strong);
  border-radius: 8px;
  min-height: 40px;
}

.form-control:focus,
.form-select:focus {
  border-color: #8ebbe8;
  box-shadow: 0 0 0 0.2rem rgba(35, 100, 170, 0.14);
}

.empty-state {
  padding: 2rem 1rem;
  color: var(--app-muted);
  text-align: center;
}

.auth-wrap {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(100%, 460px);
  padding: 1.4rem;
}

.auth-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #e7f5f2;
  color: var(--app-teal);
  border: 1px solid #bfe2dc;
  font-weight: 850;
  margin-bottom: 1rem;
}

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

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dashboard-toolbar form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dashboard-toolbar .form-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.dashboard-toolbar .form-select {
  min-width: 160px;
}

.dashboard-toolbar .app-actions {
  justify-content: flex-end;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.eng-board-panel {
  overflow: hidden;
}

.eng-board-header {
  align-items: center;
}

.eng-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.eng-board-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.eng-board-filter .input-group {
  min-width: min(100%, 360px);
}

.eng-board-filter .input-group-text {
  background: var(--app-surface-soft);
  border-color: var(--app-border);
  color: var(--app-muted);
}

.eng-board-filter .form-control {
  min-width: 220px;
}

.eng-board-filter .form-select {
  min-width: 150px;
}

.eng-board-stats {
  margin-bottom: 0.85rem;
}

.eng-board-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
}

.eng-board-column {
  display: flex;
  flex-direction: column;
  min-height: 370px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  overflow: hidden;
}

.eng-board-column-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-soft);
}

.eng-board-column-title {
  font-weight: 850;
  font-size: 0.92rem;
}

.eng-board-column-subtitle {
  margin-top: 0.15rem;
  color: var(--app-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.eng-board-column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding-inline: 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
  color: var(--app-primary-strong);
  font-weight: 850;
}

.eng-board-column-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  min-height: 0;
}

.eng-board-item {
  display: block;
  text-decoration: none;
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--app-surface-soft);
  padding: 0.7rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.eng-board-item:hover {
  transform: translateY(-1px);
  border-color: #a9c7e8;
  background: color-mix(in srgb, var(--app-primary) 7%, var(--app-surface));
  color: var(--app-text);
}

.eng-board-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.eng-board-item-code {
  font-weight: 850;
  font-size: 0.78rem;
  color: var(--app-primary);
}

.eng-board-item-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid transparent;
  background: rgba(96, 165, 250, 0.12);
  color: var(--app-primary-strong);
}

.eng-board-item-pill.em_andamento {
  background: rgba(22, 138, 122, 0.12);
  color: var(--app-teal);
  border-color: rgba(22, 138, 122, 0.2);
}

.eng-board-item-pill.parado {
  background: rgba(184, 117, 3, 0.12);
  color: var(--app-amber);
  border-color: rgba(184, 117, 3, 0.22);
}

.eng-board-item-pill.feito {
  background: rgba(88, 103, 195, 0.12);
  color: var(--app-indigo);
  border-color: rgba(88, 103, 195, 0.2);
}

.eng-board-item-title {
  font-weight: 850;
  line-height: 1.25;
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.eng-board-item-meta,
.eng-board-item-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--app-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.eng-board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px dashed var(--app-border);
  border-radius: 8px;
  color: var(--app-muted);
  text-align: center;
}

.eng-board-empty svg {
  width: 18px;
  height: 18px;
}

.eng-board-chart-grid {
  margin-top: 1rem;
}

.eng-timeline-panel {
  margin-top: 1rem;
}

.eng-timeline-scale {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  color: var(--app-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.eng-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.eng-timeline-axis {
  position: relative;
  height: 1.5rem;
  margin-left: clamp(14rem, 26vw, 18.75rem);
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--app-border);
}

.eng-timeline-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--app-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

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

.format-card {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
  padding: 0.9rem;
}

.format-card h3 {
  font-size: 0.95rem;
  font-weight: 850;
  margin-bottom: 0.55rem;
}

.pedido-items-layout {
  align-items: stretch;
  --pedido-workbench-height: clamp(540px, 60vh, 640px);
}

.pedido-items-layout > [class*="col-"] {
  display: flex;
}

.pedido-workbench-panel {
  width: 100%;
  height: var(--pedido-workbench-height);
  display: flex;
  flex-direction: column;
}

.pedido-workbench-panel.h-100 {
  height: var(--pedido-workbench-height) !important;
}

.pedido-workbench-panel .section-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.pedido-individual-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  background:
    linear-gradient(#ffffff 30%, rgba(255, 255, 255, 0)) top / 100% 28px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0), #ffffff 70%) bottom / 100% 28px no-repeat,
    var(--app-surface);
}

.pedido-individual-scroll table {
  min-width: 650px;
}

.pedido-individual-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.pedido-material-builder {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(190px, 0.72fr);
  gap: 1rem;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.material-catalog-panel,
.material-selection-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.material-catalog-panel,
.material-selection-panel,
.material-dropzone {
  display: flex;
  flex-direction: column;
}

.material-catalog {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 0.25rem;
}

.material-catalog-item {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  min-height: 76px;
  padding: 0.75rem;
  text-align: left;
  color: var(--app-text);
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.material-catalog-item:hover,
.material-catalog-item:focus-visible {
  background: #f1f7fd;
  border-color: #a9c7e8;
  box-shadow: 0 8px 18px rgba(35, 100, 170, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.material-catalog-item:active {
  cursor: grabbing;
}

.material-catalog-main {
  display: grid;
  gap: 0.12rem;
}

.material-catalog-main strong {
  color: var(--app-primary-strong);
  font-size: 0.78rem;
}

.material-catalog-main span {
  font-weight: 800;
  line-height: 1.25;
}

.material-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.material-catalog-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  color: #52626e;
  background: #eef3f7;
  border: 1px solid #dde7ef;
  font-size: 0.76rem;
  font-weight: 800;
}

.material-catalog-empty {
  padding: 1.2rem;
  text-align: center;
  color: var(--app-muted);
  border: 1px dashed var(--app-border-strong);
  border-radius: 8px;
  background: var(--app-surface-soft);
}

.material-selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.material-selection-head > svg {
  width: 22px;
  height: 22px;
  color: var(--app-teal);
}

.material-dropzone {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.75rem;
  border: 1px dashed #a9c7e8;
  border-radius: 8px;
  background: #f8fbfe;
  overflow: auto;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.material-dropzone.is-dragover {
  background: #eef7ff;
  border-color: var(--app-primary);
  box-shadow: inset 0 0 0 1px rgba(35, 100, 170, 0.16);
}

.dropzone-empty {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 100%;
  color: var(--app-muted);
  text-align: center;
}

.dropzone-empty svg {
  width: 34px;
  height: 34px;
  color: #8ba5b7;
}

.selected-material-list {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.selected-material-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.8rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.selected-material-row.is-highlighted {
  border-color: var(--app-amber);
  box-shadow: 0 0 0 0.2rem rgba(184, 117, 3, 0.12);
}

.selected-material-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.selected-material-summary strong,
.selected-material-summary span {
  display: block;
}

.selected-material-summary strong {
  color: var(--app-primary-strong);
  font-size: 0.78rem;
}

.selected-material-summary span {
  font-weight: 850;
  line-height: 1.25;
}

.selected-material-summary small {
  color: var(--app-muted);
  white-space: nowrap;
}

.selected-material-fields {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(120px, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

.selected-material-fields .form-label {
  font-size: 0.78rem;
}

.selected-material-controls {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.selected-material-controls .form-check {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.selected-material-controls .form-check-input {
  margin: 0;
}

.is-system-value {
  background-color: #f4f7fa;
  color: #52626e;
}

@media (max-width: 1199.98px) {
  .detail-strip,
  .detail-strip.four,
  .detail-strip.three,
  .chart-grid,
  .quick-action-list.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-material-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-material-controls {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .pedido-workbench-panel {
    height: auto;
  }

  .pedido-workbench-panel.h-100 {
    height: auto !important;
  }

  .pedido-individual-scroll,
  .pedido-material-builder {
    max-height: none;
    height: auto;
  }

  .pedido-individual-scroll {
    min-height: 320px;
  }

  .pedido-material-builder {
    grid-template-rows: auto auto;
  }

  .material-catalog,
  .material-dropzone {
    max-height: 360px;
  }

  .material-dropzone {
    min-height: 260px;
  }
}

@media (max-width: 767.98px) {
  :root {
    --app-page-gutter: 0.55rem;
  }

  .app-page-header,
  .section-panel-header {
    flex-direction: column;
  }

  .app-page-header {
    gap: 0.85rem;
  }

  .app-page-header h1 {
    font-size: 1.55rem;
  }

  .app-page-subtitle {
    max-width: 100%;
    line-height: 1.45;
    word-break: break-word;
  }

  .app-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-actions .btn,
  .section-panel form.row .btn,
  .table-action-group .btn {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .dashboard-toolbar {
    align-items: stretch;
  }

  .dashboard-toolbar form,
  .dashboard-toolbar .app-actions {
    width: 100%;
  }

  .dashboard-toolbar .form-select,
  .dashboard-toolbar .app-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .section-panel form.row .col-auto {
    flex: 1 1 100%;
    width: 100%;
  }

  .section-panel-header {
    padding: 0.9rem 0.95rem;
  }

  .section-panel-body {
    padding: 0.95rem;
  }

  .metric-grid,
  .quick-action-list,
  .quick-action-list.three,
  .upload-format-grid,
  .detail-strip,
  .detail-strip.four,
  .detail-strip.three,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .app-brand {
    min-width: 0;
  }

  .app-brand-title {
    font-size: 1rem;
  }

  .app-brand-subtitle {
    font-size: 0.68rem;
  }

  .app-main {
    padding-top: 1rem;
  }

  .app-navbar-inner {
    gap: 0.5rem;
  }

  .app-brand {
    gap: 0.55rem;
  }

  .selected-material-summary,
  .material-selection-head {
    flex-direction: column;
  }

  .selected-material-summary small {
    white-space: normal;
  }

  .selected-material-fields,
  .selected-material-controls {
    grid-template-columns: 1fr;
  }

  .selected-material-controls {
    justify-items: stretch;
  }
}

@media (max-width: 575.98px) {
  :root {
    --app-page-gutter: 0.45rem;
  }

  .app-main {
    width: calc(100% - (var(--app-page-gutter) * 2));
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
  }

  .app-navbar-inner {
    gap: 0.35rem;
  }

  .app-brand {
    gap: 0.42rem;
  }

  .app-brand-mark-image {
    width: 28px;
    height: 28px;
  }

  .app-brand-title {
    font-size: 0.94rem;
  }

  .app-brand-subtitle {
    display: none;
  }

  .app-icon-pill,
  .app-user-pill {
    height: 32px;
  }

  .app-icon-pill svg,
  .app-user-pill svg {
    width: 15px;
    height: 15px;
  }

  .app-page-header {
    gap: 0.7rem;
    margin-bottom: 0.7rem;
  }

  .app-page-kicker {
    font-size: 0.66rem;
  }

  .app-page-header h1 {
    font-size: 1.32rem;
  }

  .app-page-subtitle {
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .section-panel-header {
    padding: 0.72rem 0.78rem;
  }

  .section-panel-body {
    padding: 0.78rem;
  }

  .metric-card {
    min-height: auto;
    padding: 0.7rem;
  }

  .metric-value {
    font-size: 1.7rem;
  }

  .quick-action {
    min-height: 56px;
    padding: 0.7rem;
  }

  .quick-action-icon {
    width: 32px;
    height: 32px;
  }

  .quick-action-title {
    font-size: 0.95rem;
  }

  .quick-action-caption {
    font-size: 0.79rem;
  }

  .btn {
    min-height: 31px;
    font-size: 0.88rem;
  }

  .table {
    font-size: 0.82rem;
  }

  .table-responsive {
    border-radius: 10px;
  }

  .dashboard-toolbar {
    gap: 0.45rem;
  }

  .dashboard-toolbar form,
  .dashboard-toolbar .app-actions {
    width: 100%;
  }

  .dashboard-toolbar .form-select,
  .dashboard-toolbar .app-actions .btn,
  .app-actions .btn,
  .section-panel form.row .btn {
    width: 100%;
    min-width: 0;
  }

  .navbar-toggler {
    margin-left: 0;
  }
}

@media (min-width: 1400px) and (max-width: 1640px) {
  .app-brand {
    min-width: 156px;
    gap: 0.48rem;
    margin-right: 0.15rem;
  }

  .app-brand-mark,
  .app-brand-mark-image {
    width: 32px;
    height: 32px;
  }

  .app-brand-title {
    font-size: 0.96rem;
  }

  .app-brand-subtitle {
    font-size: 0.66rem;
  }

  .app-nav-links .nav-link,
  .app-user-nav .nav-link,
  .logout-button {
    min-height: 32px;
    padding: 0.3rem 0.38rem;
    font-size: 0.81rem;
  }

  .app-nav-links .nav-link svg,
  .app-user-nav .nav-link svg,
  .btn svg {
    width: 16px;
    height: 16px;
  }

  .app-user-pill {
    max-width: 154px;
  }
}

@media (max-width: 1199.98px) {
  .app-page-header {
    flex-direction: column;
  }

  .app-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-navbar-inner {
    gap: 0.5rem;
  }

  .app-brand {
    min-width: 0;
  }

  .app-navbar-search {
    max-width: 380px;
  }
}

@media (max-width: 991.98px) {
  .navbar.navbar-expand-lg {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .navbar-expand-lg .navbar-toggler {
    display: block;
  }

  .navbar-expand-lg .navbar-collapse {
    display: none !important;
    flex-basis: 100%;
    flex-grow: 1;
    align-items: flex-start;
  }

  .navbar-expand-lg .navbar-collapse.show,
  .navbar-expand-lg .navbar-collapse.collapsing {
    display: block !important;
  }

  .navbar-expand-lg .navbar-nav {
    flex-direction: column;
  }

  .app-navbar .navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--app-border);
  }

  .app-nav-links,
  .app-user-nav {
    gap: 0.25rem;
  }

  .app-navbar-search {
    order: 3;
    width: 100%;
    max-width: none;
    margin-top: 0.35rem;
  }

  .app-nav-links {
    flex-wrap: wrap;
  }

  .app-nav-links .nav-link,
  .app-user-nav .nav-link,
  .logout-button {
    justify-content: flex-start;
    width: 100%;
    white-space: normal;
    text-align: left;
  }

  .app-nav-launcher .dropdown-menu,
  .app-user-nav .dropdown-menu {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
  }

  .app-user-pill {
    max-width: none;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #101a2c;
  --app-surface: #172338;
  --app-surface-soft: #1c2a43;
  --app-border: #31435d;
  --app-border-strong: #455a78;
  --app-text: #eef4ff;
  --app-muted: #b0bfd2;
  --app-primary: #7fb2ff;
  --app-primary-strong: #a9cffd;
  --app-teal: #44e0ca;
  --app-amber: #ffd166;
  --app-rose: #ff8a97;
  --app-indigo: #a78bfa;
  --app-shadow: 0 16px 36px rgba(2, 6, 23, 0.34);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 36%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: var(--app-text);
}

html[data-theme="dark"] a {
  color: #93c5fd;
}

html[data-theme="dark"] .app-navbar,
html[data-theme="dark"] .evol01-topbar {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: var(--app-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .app-brand-title,
html[data-theme="dark"] .app-brand-subtitle,
html[data-theme="dark"] .app-page-kicker,
html[data-theme="dark"] .app-page-header h1,
html[data-theme="dark"] .section-panel-title,
html[data-theme="dark"] .section-panel-title,
html[data-theme="dark"] .h1,
html[data-theme="dark"] .h2,
html[data-theme="dark"] .h3,
html[data-theme="dark"] .h4,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--app-text);
}

html[data-theme="dark"] .app-brand-subtitle,
html[data-theme="dark"] .app-page-subtitle,
html[data-theme="dark"] .section-panel-subtitle,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small.text-muted,
html[data-theme="dark"] .erp-quick-filter-meta,
html[data-theme="dark"] .metric-note,
html[data-theme="dark"] .login-subtitle,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] label,
html[data-theme="dark"] .helptext,
html[data-theme="dark"] .help-block,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .card-text,
html[data-theme="dark"] .detail-label,
html[data-theme="dark"] .format-card p,
html[data-theme="dark"] .material-catalog-meta span,
html[data-theme="dark"] .dropzone-empty,
html[data-theme="dark"] .selected-material-summary small,
html[data-theme="dark"] .metric-label {
  color: #c1cde0 !important;
}

html[data-theme="dark"] .table-text-sub,
html[data-theme="dark"] .table-text-sub.tight,
html[data-theme="dark"] .metric-note {
  color: #c7d4e4 !important;
}

html[data-theme="dark"] .app-nav-links .nav-link,
html[data-theme="dark"] .app-user-nav .nav-link,
html[data-theme="dark"] .logout-button,
html[data-theme="dark"] .erp-admin-quicknav a {
  color: #d2dbe8;
}

html[data-theme="dark"] .app-nav-links .nav-link:hover,
html[data-theme="dark"] .app-user-nav .nav-link:hover,
html[data-theme="dark"] .logout-button:hover,
html[data-theme="dark"] .erp-admin-quicknav a:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

html[data-theme="dark"] .app-nav-links .nav-link.active,
html[data-theme="dark"] .erp-admin-quicknav a.active {
  background: rgba(96, 165, 250, 0.16);
  color: #eff6ff;
}

html[data-theme="dark"] .app-user-pill,
html[data-theme="dark"] .badge.text-bg-dark,
html[data-theme="dark"] .badge.text-bg-light {
  background: rgba(148, 163, 184, 0.14) !important;
  border-color: var(--app-border) !important;
  color: #e5edf7 !important;
}

html[data-theme="dark"] .status-pill.em_andamento {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] .status-pill.em_risco {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="dark"] .status-pill.concluido {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

html[data-theme="dark"] .status-pill.outros {
  color: #dbe4f0;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .card,
html[data-theme="dark"] .section-panel,
html[data-theme="dark"] .inline-group,
html[data-theme="dark"] fieldset.module,
html[data-theme="dark"] .submit-row,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .erp-quick-filter-box,
html[data-theme="dark"] .erp-table-pagination-box,
html[data-theme="dark"] .erp-system-card,
html[data-theme="dark"] .erp-access-denied-modal .modal-content,
html[data-theme="dark"] .evol01-topbar,
html[data-theme="dark"] .auth-note,
html[data-theme="dark"] .auth-brand-pill,
html[data-theme="dark"] .security-badge {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow);
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .erp-table-pagination-box,
html[data-theme="dark"] .erp-quick-filter-box {
  background: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] .table tbody tr:hover {
  background-color: rgba(96, 165, 250, 0.08);
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .module td,
html[data-theme="dark"] .module th {
  border-color: var(--app-border);
  color: var(--app-text);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-body-tertiary,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .dropdown-item-text {
  background-color: var(--app-surface) !important;
  color: var(--app-text) !important;
  border-color: var(--app-border) !important;
}

html[data-theme="dark"] .dropdown-menu .dropdown-item {
  color: var(--app-text);
}

html[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .dropdown-menu .dropdown-item:focus,
html[data-theme="dark"] .dropdown-menu .dropdown-item.active {
  background: rgba(96, 165, 250, 0.14);
  color: #fff;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] .vTextField {
  background-color: #111c30;
  color: var(--app-text);
  border-color: var(--app-border);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #76859a;
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-dark,
html[data-theme="dark"] .btn-outline-primary {
  color: #dbeafe;
  border-color: var(--app-border-strong);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-primary:hover {
  background: rgba(96, 165, 250, 0.12);
  color: #fff;
}

html[data-theme="dark"] .section-panel-header,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .module h2,
html[data-theme="dark"] .module caption,
html[data-theme="dark"] body.dashboard .module caption,
html[data-theme="dark"] .inline-group h2 {
  background: rgba(17, 28, 48, 0.96) !important;
  color: var(--app-text) !important;
  border-bottom-color: var(--app-border);
}

html[data-theme="dark"] .erp-system-card {
  background: linear-gradient(180deg, #172338 0%, #101a2c 100%);
}

html[data-theme="dark"] .system-card-suprimentos {
  border-left-color: var(--app-primary);
}

html[data-theme="dark"] .system-card-engenharia {
  border-left-color: #475569;
}

html[data-theme="dark"] .selection-brand-banner,
html[data-theme="dark"] .auth-brand-logo {
  filter: brightness(0.94) contrast(1.08);
}

html[data-theme="dark"] .erp-theme-menu-subtitle {
  color: #94a3b8;
}

html[data-theme="dark"] .erp-scroll-top {
  background: #111827;
  color: var(--app-text);
  border-color: var(--app-border);
}

html[data-theme="dark"] .erp-scroll-top:hover {
  background: #162033;
}

html[data-theme="dark"] .section-panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .detail-item,
html[data-theme="dark"] .format-card,
html[data-theme="dark"] .material-catalog-item,
html[data-theme="dark"] .selected-material-row,
html[data-theme="dark"] .material-dropzone,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .erp-quick-filter-box,
html[data-theme="dark"] .erp-table-pagination-box {
  background: var(--app-surface);
  color: var(--app-text);
}

html[data-theme="dark"] .section-panel-header,
html[data-theme="dark"] .form-panel .mb-3 .form-text,
html[data-theme="dark"] .form-panel .helptext,
html[data-theme="dark"] .form-panel .help-block,
html[data-theme="dark"] .material-catalog-empty {
  color: var(--app-muted) !important;
}

html[data-theme="dark"] .material-catalog-item:hover,
html[data-theme="dark"] .material-catalog-item:focus-visible,
html[data-theme="dark"] .quick-action:hover {
  background: rgba(127, 178, 255, 0.12);
  border-color: rgba(127, 178, 255, 0.45);
}

html[data-theme="dark"] .material-catalog-main strong,
html[data-theme="dark"] .selected-material-summary strong,
html[data-theme="dark"] .detail-value,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .quick-action-title,
html[data-theme="dark"] .section-panel-title {
  color: var(--app-text);
}

html[data-theme="dark"] .material-catalog-main span,
html[data-theme="dark"] .material-catalog-meta span,
html[data-theme="dark"] .selected-material-summary span,
html[data-theme="dark"] .dropzone-empty strong,
html[data-theme="dark"] .quick-action-caption,
html[data-theme="dark"] .detail-label {
  color: #c4d0df;
}

html[data-theme="light"] .bg-dark,
html[data-theme="light"] .text-bg-dark,
html[data-theme="light"] .badge.text-bg-dark {
  background: #eaf2fb !important;
  border-color: #c7d8ea !important;
  color: #16324d !important;
}

html[data-theme="light"] .bg-dark.text-light,
html[data-theme="light"] .bg-dark .text-light {
  color: #1f2937 !important;
}

html[data-theme="light"] .btn-dark {
  background: linear-gradient(180deg, #2364aa, #1d4ed8) !important;
  border-color: #2364aa !important;
  color: #ffffff !important;
}

html[data-theme="light"] .btn-outline-dark {
  background: #ffffff !important;
  border-color: #b9ccdf !important;
  color: #1e3a5f !important;
}

html[data-theme="light"] .btn-outline-dark:hover {
  background: #eff6ff !important;
  border-color: #7fb2ff !important;
  color: #17324d !important;
}

html[data-theme="light"] .text-light {
  color: #334155 !important;
}

html[data-theme="light"] .text-light a,
html[data-theme="light"] a.text-light {
  color: #2364aa !important;
}

@media (max-width: 768px) {
  .erp-route-kpi {
    grid-template-columns: 1fr;
  }
}

.erp-route-segments {
  grid-column: 1 / -1;
}
