:root {
  --ink: #17212b;
  --muted: #6b7785;
  --line: #dfe5eb;
  --bg: #f4f6f8;
  --nav: #ffffff;
  --blue: #176fa5;
  --green: #23834f;
  --red: #b83242;
  --yellow: #a56b00;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  color: var(--ink);
}

.brand strong {
  color: #17212b;
}

.brand small,
.nav-label,
.sidebar footer {
  color: #748294;
}

.nav-item {
  color: #536273;
}

.nav-item:hover,
.nav-item.active {
  background: #edf4f8;
  color: #145f8a;
}

.main {
  background: var(--bg);
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.topbar h1 small,
.title-row p,
.panel p,
.metric small,
.progress-label,
li small {
  color: var(--muted);
}

.panel,
.status span,
th {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.panel {
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.06);
}

th {
  color: var(--muted);
  background: #f5f7f9;
}

input,
select,
textarea {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: #8793a0;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.secondary {
  background: #e9f4f8;
  color: #145f8a;
}

.ghost {
  background: #eef2f4;
  color: var(--ink);
}

.quick {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.hero {
  background: linear-gradient(125deg, #0f5b7f, #1686a8);
  color: #fff;
}

.hero p,
.hero .kicker {
  color: #c7e8f1;
}

.emergency {
  background: #7d1f25;
}

/* Camada visual alinhada à referência TracePlatform, em tema claro. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 240px;
  flex-basis: 240px;
  padding: 24px 15px;
  overflow-y: auto;
  transition:
    width 0.2s ease,
    transform 0.2s ease;
}

.brand {
  margin-bottom: 30px;
}

.nav-label {
  margin-top: 22px;
  padding: 7px 12px 6px;
  color: #31526b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-bottom: 1px solid #e7edf1;
}

.nav-item {
  border-radius: 8px;
  padding: 14px 13px;
  margin: 4px 0;
  color: #263b4d;
  font-weight: 750;
  font-size: 15px;
}

.nav-item {
  display: block;
  text-decoration: none;
}

.nav-item:hover {
  background: #e7f1f6;
  color: #0e5d87;
}

.nav-item.active {
  background: #dceef6;
  color: #0b5c87;
  box-shadow: inset 4px 0 #176fa5;
  font-weight: 850;
}

.topbar {
  min-height: 64px;
  padding: 16px 30px;
}

.main {
  margin-left: 240px;
  transition: margin-left 0.2s ease;
}

.topbar h1 {
  font-size: 18px;
}

.sidebar-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  margin-right: 10px;
}

.local i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  margin-right: 5px;
}

.content {
  max-width: 1280px;
  padding: 32px;
}

.title-row {
  margin-bottom: 22px;
}

.title-row h2 {
  font-size: 29px;
}

.panel {
  border-radius: 9px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h3 {
  margin-bottom: 5px;
}

.panel-heading p {
  margin-top: 0;
}

.filters {
  padding: 15px 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  align-items: end;
}

.filter-grid label {
  margin: 0;
}

.reference-table-panel {
  padding: 0;
  overflow-x: auto;
}

.reference-table-panel table {
  min-width: 1050px;
}

.reference-table-panel th,
.reference-table-panel td {
  padding: 14px 16px;
}

.search-row {
  max-width: 360px;
  margin-bottom: 18px;
}

.text-link {
  border: 0;
  background: transparent;
  color: #176fa5;
  cursor: pointer;
  font-weight: 700;
  padding: 4px 7px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: max-content;
}

.dala-actions-header {
  align-items: center;
}

.dala-actions-header>.actions {
  margin-left: auto;
}

.dala-actions-table {
  min-width: 920px;
}

.error-logs-table {
  min-width: 900px;
}

.error-message-cell {
  min-width: 320px;
  white-space: normal;
}

.action-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-order>span {
  min-width: 18px;
  font-weight: 800;
  text-align: center;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.icon-button:hover:not(:disabled),
.icon-button:focus-visible:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
  outline: none;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.section-title {
  margin: 40px 0 18px;
  font-size: 26px;
}

.dala-action-editor,
.dala-trigger-editor {
  margin-top: 18px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

@media (max-width: 760px) {
  .dala-actions-header>.actions {
    margin-left: 0;
    width: 100%;
  }
}

.danger-link {
  color: var(--red);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.dashboard-metrics .metric strong {
  font-size: 25px;
}

.dashboard-metric-link {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.dashboard-metric-link:hover,
.dashboard-metric-link:focus-visible {
  transform: translateY(-2px);
  border-color: #9ec7dc;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.12);
  outline: 2px solid #9ec7dc;
  outline-offset: 2px;
}

.dashboard-metric-link span {
  display: block;
  margin-top: 9px;
  color: #176fa5;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-readonly {
  display: block;
  padding: 9px;
  border: 1px dashed #cbd8e2;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.dashboard-card-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  width: 100%;
  gap: 10px;
}

.dashboard-card-links .button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  white-space: normal;
}

.dashboard-dalas {
  margin-top: 4px;
}

.dashboard-dalas .panel-heading {
  margin-bottom: 16px;
}

.dashboard-dalas .panel-heading h3 {
  margin: 3px 0;
  font-size: 23px;
}

.dashboard-dalas .panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.dala-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.dala-album-card {
  aspect-ratio: 1 / 1;
  min-height: 300px;
  padding: 18px;
  border: 1px solid #d9e3e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.dala-album-card:hover {
  transform: translateY(-3px);
  border-color: #9ec7dc;
  box-shadow: 0 12px 22px rgba(23, 33, 43, 0.11);
}

.dala-album-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dala-album-card h3 {
  font-size: 17px;
  line-height: 1.2;
  margin: 3px 0 6px;
  overflow-wrap: anywhere;
}

.dala-album-card code {
  color: #4b6477;
  font-size: 11px;
  font-weight: 750;
}

.album-label {
  color: #176fa5;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dala-album-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 10px;
  padding: 13px 0;
  border-top: 1px solid #e8edf1;
  border-bottom: 1px solid #e8edf1;
}

.dala-album-info small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dala-album-info strong {
  display: block;
  margin-top: 4px;
  color: #263b4d;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dala-romaneio-info {
  padding: 10px 0;
}

.album-progress .progress {
  height: 7px;
  margin: 0 0 5px;
}

.album-progress small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.dala-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.dala-controls .button {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 10px 6px;
  font-size: 13px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dala-controls .button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.dala-album-card footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
}

.dala-album-card footer>span {
  width: 100%;
  max-width: none;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dala-album-card .button {
  margin: 0;
  padding: 8px 10px;
}

.compact-help {
  padding: 16px 20px;
}

.company-activation-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-color: #b9e3eb;
  background: #f1fbfd;
}

.company-activation-panel h3 {
  margin: 4px 0 5px;
}

.company-activation-panel p {
  margin: 0 0 12px;
  color: var(--muted);
}

.company-activation-panel small {
  display: block;
  color: var(--muted);
}

.company-activation-code {
  display: block;
  margin: 0 0 10px;
  color: #075f79;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(21px, 3vw, 30px);
  letter-spacing: .12em;
}

.selected-company-context {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.selected-company-context strong {
  color: var(--ink);
}

.selected-company-context small {
  color: var(--muted);
}

.compact-help p,
.field-help {
  color: var(--muted);
}

.settings-card {
  max-width: 900px;
}

.settings-card h3:not(:first-child) {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 26px;
}

.compact-grid {
  gap: 0 18px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f2f7;
  color: #176fa5;
  font-weight: 800;
  float: left;
  margin-right: 9px;
}

.user-name {
  color: var(--ink);
  font-weight: 700;
}

.logout-link {
  border: 0;
  background: transparent;
  padding: 9px 0 0;
  color: #176fa5;
  cursor: pointer;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-right: 12px;
  vertical-align: middle;
}

.nav-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell.sidebar-collapsed .sidebar {
  width: 110px;
  padding: 24px 14px;
  background: #f7f9fc;
  border-right-color: #dfe6ee;
}

.shell.sidebar-collapsed .main {
  margin-left: 110px;
}

.shell.sidebar-collapsed .brand {
  margin: 7px 0 28px;
  text-align: center;
}

.shell.sidebar-collapsed .brand strong {
  font-size: 0;
}

.shell.sidebar-collapsed .brand strong::after {
  content: "TRACE";
  color: #263b4d;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 900;
}

.shell.sidebar-collapsed .brand small {
  display: block;
  color: #768596;
  font-size: 6px;
  letter-spacing: 0.15em;
  margin-top: 2px;
}

.shell.sidebar-collapsed .nav-label {
  display: none !important;
}

.shell.sidebar-collapsed .nav-item {
  position: relative;
  width: 70px;
  height: 70px;
  padding: 0;
  margin: 5px auto;
  display: grid;
  place-items: center;
  color: #506174;
  border-radius: 17px;
  box-shadow: none;
}

.shell.sidebar-collapsed .nav-item:hover {
  color: #176fa5;
  background: #e9f2f7;
}

.shell.sidebar-collapsed .nav-item.active {
  color: #176fa5;
  background: #dceaf5;
  box-shadow: none;
}

.shell.sidebar-collapsed .nav-icon {
  width: 31px;
  height: 31px;
  margin: 0;
}

.shell.sidebar-collapsed .nav-icon svg {
  width: 31px;
  height: 31px;
  stroke-width: 1.8;
}

.shell.sidebar-collapsed .nav-text {
  display: none;
}

.shell.sidebar-collapsed .nav-section-end {
  margin-bottom: 28px;
}

.shell.sidebar-collapsed .nav-section-end::after {
  content: "";
  position: absolute;
  bottom: -17px;
  left: 0;
  right: 0;
  border-bottom: 1px solid #d7e0e8;
}

.shell.sidebar-collapsed .sidebar footer {
  margin: auto 0 0;
  padding: 20px 0 24px;
  text-align: center;
  border-top: 1px solid #d7e0e8;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border: 1px solid #c7d4e1;
  background: #e5edf5;
  color: #263b4d;
  font-size: 24px;
}

.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .sidebar footer::after {
  content: "DALLOGIX\A TRACE";
  white-space: pre;
  display: block;
  margin-top: 22px;
  color: #768596;
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  font-weight: 900;
}

@media (max-width: 620px) {
  .sidebar {
    width: 240px;
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .shell.sidebar-collapsed .sidebar {
    width: 240px;
    transform: translateX(-100%);
  }

  .shell.sidebar-collapsed .main {
    margin-left: 0;
  }

  .topbar {
    padding-left: 16px;
  }
}

@media (max-width: 620px) {
  .dala-album-grid {
    grid-template-columns: 1fr;
  }

  .dala-album-card {
    min-height: 410px;
  }
}

@media (min-width: 621px) and (max-width: 850px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .sidebar {
    width: 210px;
    flex-basis: 210px;
  }

  .main {
    margin-left: 210px;
  }

  .shell.sidebar-collapsed .main {
    margin-left: 110px;
  }
}

/* Referência visual: TracePlatform em tema claro. */
:root {
  --ink: #142332;
  --muted: #718091;
  --line: #d6e0e7;
  --bg: #eef3f6;
  --nav: #ffffff;
  --blue: #1769ff;
  --green: #08a64b;
  --red: #ef4655;
  --yellow: #f08a00;
}

body {
  background: #eef3f6;
  color: var(--ink);
  font-family: var(--font-ui);
}

.sidebar {
  background: #fff;
  color: var(--ink);
  border-right: 1px solid #dce5eb;
  box-shadow: 8px 0 24px rgba(20, 35, 50, 0.06);
}

.brand {
  padding: 12px 10px 18px;
  border-bottom: 1px solid #e2e9ee;
}

.brand strong {
  color: #122b40;
  font-size: 34px;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand small {
  color: #567185;
  font-size: 11px;
  letter-spacing: 0.38em;
  margin-top: 5px;
}

.nav-label {
  color: #6a7f8d;
  border-bottom-color: #e3eaee;
}

.nav-item {
  color: #334c5e;
}

.nav-item:hover,
.nav-item.active {
  background: #e9f5f8;
  color: #0d6c91;
}

.nav-item.active {
  box-shadow: inset 4px 0 #1ba8c8;
}

.main {
  background: #eef3f6;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d6e0e7;
  box-shadow: 0 2px 12px rgba(20, 35, 50, 0.04);
}

.topbar h1 {
  color: #142332;
}

.panel,
.status span,
th {
  background: #fff;
  border-color: #d6e0e7;
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(20, 35, 50, 0.06);
}

input,
select,
textarea {
  background: #fff;
  border-color: #cbd8e0;
  color: var(--ink);
}

.primary {
  background: #1769ff;
  color: #fff;
}

.secondary {
  background: #e6f6fa;
  color: #0d6c91;
}

.ghost {
  background: #edf2f5;
  color: var(--ink);
}

.local {
  background: #e5f6f8;
  border-color: #c9e8ec;
  color: #147b91;
}

.sidebar footer {
  color: #69808f;
  border-top-color: #dce5eb;
}

.user-name {
  color: var(--ink);
}

.logout-link {
  color: #1769ff;
}

/* Último override do menu lateral, após todos os blocos responsivos. */
.sidebar {
  width: 256px;
  flex-basis: 256px;
  padding: 0;
  background: #2d354c;
  color: #f7f9fc;
  border-right: 0;
  box-shadow: none;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.brand {
  height: 120px;
  margin: 0;
  padding: 12px;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand strong {
  color: #f7f9fc;
}

.brand small {
  color: rgba(247, 249, 252, 0.7);
}

.sidebar nav {
  padding: 0 8px;
}

.nav-label {
  height: 32px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  color: rgba(247, 249, 252, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}

.nav-item {
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  color: #f7f9fc;
  font-size: 14px;
  font-weight: 400;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: #5c667f;
  color: #fff;
  box-shadow: none;
  font-weight: 500;
}

.nav-section-end {
  margin-bottom: 17px;
}

.nav-icon,
.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon {
  flex: 0 0 16px;
  margin: 0;
}

.sidebar footer {
  margin-top: auto;
  padding: 12px;
  border-top: 0;
  color: #f7f9fc;
}

.user-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  background: #46516a;
  color: #f7f9fc;
}

.user-name,
.sidebar footer b {
  color: #f7f9fc;
}

.logout-link {
  color: #b9c1d0;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 0;
  color: #142332;
  border-radius: 8px;
}

.sidebar-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0 5px, currentColor 5px 7px, transparent 7px);
}

.shell.sidebar-collapsed .sidebar {
  width: 48px;
  flex-basis: 48px;
  padding: 0;
  background: #2d354c;
}

.shell.sidebar-collapsed .main {
  margin-left: 0;
}

.shell.sidebar-collapsed .brand {
  height: 64px;
  padding: 8px;
  text-align: center;
}

.shell.sidebar-collapsed .brand strong {
  font-size: 0;
}

.shell.sidebar-collapsed .brand strong::after {
  content: "T";
  color: #f7f9fc;
  font-size: 18px;
  font-style: normal;
}

.shell.sidebar-collapsed .brand small,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .sidebar nav {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .nav-item {
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto;
}

.topbar {
  min-height: 48px;
  padding: 6px 16px;
}

.main {
  margin-left: 0;
}

/* Último nível de override: medidas do menu da referência. */
.sidebar {
  width: 256px;
  flex-basis: 256px;
  padding: 0;
  background: #2d354c;
  color: #f7f9fc;
  border-right: 0;
  box-shadow: none;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.brand {
  height: 120px;
  margin: 0;
  padding: 12px;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand strong {
  color: #f7f9fc;
}

.brand small {
  color: rgba(247, 249, 252, 0.7);
}

.sidebar nav {
  padding: 0 8px;
}

.nav-label {
  height: 32px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  color: rgba(247, 249, 252, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}

.nav-item {
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  color: #f7f9fc;
  font-size: 14px;
  font-weight: 400;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: #5c667f;
  color: #fff;
  box-shadow: none;
  font-weight: 500;
}

.nav-section-end {
  margin-bottom: 17px;
}

.nav-icon,
.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon {
  flex: 0 0 16px;
  margin: 0;
}

.sidebar footer {
  margin-top: auto;
  padding: 12px;
  border-top: 0;
  color: #f7f9fc;
}

.user-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  background: #46516a;
  color: #f7f9fc;
}

.user-name,
.sidebar footer b {
  color: #f7f9fc;
}

.logout-link {
  color: #b9c1d0;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 0;
  color: #142332;
  border-radius: 8px;
}

.sidebar-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0 5px, currentColor 5px 7px, transparent 7px);
}

.shell.sidebar-collapsed .sidebar {
  width: 48px;
  flex-basis: 48px;
  padding: 0;
  background: #2d354c;
}

.shell.sidebar-collapsed .main {
  margin-left: 0;
}

.shell.sidebar-collapsed .brand {
  height: 64px;
  padding: 8px;
  text-align: center;
}

.shell.sidebar-collapsed .brand strong {
  font-size: 0;
}

.shell.sidebar-collapsed .brand strong::after {
  content: "T";
  color: #f7f9fc;
  font-size: 18px;
  font-style: normal;
}

.shell.sidebar-collapsed .brand small,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .sidebar nav {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .nav-item {
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto;
}

.title-row.has-back {
  align-items: flex-start;
}

.title-row .page-back {
  flex: 0 0 auto;
  margin-top: 4px;
}

.dala-view-header {
  position: relative;
  align-items: center;
}

.dala-view-header>div {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

/* Padrão único para ações do sistema. A variante small mantém apenas a
   compactação necessária para tabelas e cartões. */
.button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.005em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(16, 43, 59, 0.13);
}

.button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.button.small {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 12px;
}

/* Menu lateral alinhado à referência TracePlatform. */
.sidebar {
  width: 256px;
  flex: 0 0 256px;
  padding: 0;
  background: #2d354c;
  color: #f7f9fc;
  border-right: 0;
  box-shadow: none;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.brand {
  height: 120px;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 0;
}

.brand strong {
  color: #f7f9fc;
  font-size: 34px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.brand small {
  color: rgba(247, 249, 252, 0.7);
  font-size: 11px;
  letter-spacing: 0.38em;
  margin-top: 5px;
}

.sidebar nav {
  padding: 0 8px;
}

.nav-label {
  height: 32px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  color: rgba(247, 249, 252, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}

.nav-item {
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  color: #f7f9fc;
  font-size: 14px;
  font-weight: 400;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: #5c667f;
  color: #fff;
  box-shadow: none;
  font-weight: 500;
}

.nav-section-end {
  margin-bottom: 17px;
}

.nav-icon,
.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon {
  flex: 0 0 16px;
  margin: 0;
}

.nav-icon svg {
  stroke-width: 2;
}

.sidebar footer {
  margin-top: auto;
  padding: 12px;
  border-top: 0;
  color: #f7f9fc;
}

.user-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  background: #46516a;
  color: #f7f9fc;
}

.user-name,
.sidebar footer b {
  color: #f7f9fc;
}

.logout-link {
  color: #b9c1d0;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #f7f9fc;
  font-size: 0;
  border-radius: 8px;
}

.sidebar-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0 5px, currentColor 5px 7px, transparent 7px);
}

.sidebar-toggle:hover {
  background: rgba(20, 35, 50, 0.08);
}

.shell.sidebar-collapsed .sidebar {
  width: 48px;
  flex-basis: 48px;
  padding: 0;
  background: #2d354c;
}

.shell.sidebar-collapsed .main {
  margin-left: 0;
}

.shell.sidebar-collapsed .brand {
  height: 64px;
  padding: 8px;
  text-align: center;
}

.shell.sidebar-collapsed .brand strong {
  font-size: 0;
}

.shell.sidebar-collapsed .brand strong::after {
  content: "T";
  color: #f7f9fc;
  font-size: 18px;
  font-style: normal;
}

.shell.sidebar-collapsed .brand small,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .sidebar nav {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .nav-item {
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  justify-content: center;
}

.shell.sidebar-collapsed .nav-section-end {
  margin-bottom: 17px;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto;
}


/* Refino visual para a IHM industrial: leitura à distância, toque amplo e estado sempre visível. */
:root {
  --navy: #102b3b;
  --navy-soft: #183d50;
  --cyan: #1a9bc0;
  --cyan-soft: #e5f5fa;
  --steel: #eef3f6;
  --shadow-lg: 0 12px 30px rgba(16, 43, 59, 0.09);
}

body {
  font-family: var(--font-ui);
  background: #edf2f5;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, #102533 100%);
  border-right: 0;
  box-shadow: 8px 0 24px rgba(16, 43, 59, 0.08);
}

.brand strong {
  color: #f7fbfd;
  letter-spacing: 0.19em;
}

.brand small {
  color: #8fb3c1;
}

.nav-label {
  color: #86aab8;
  border-bottom-color: rgba(167, 211, 224, 0.18);
}

.nav-item {
  color: #d7e7ed;
  border-radius: 10px;
  min-height: 52px;
  display: flex !important;
  align-items: center;
}

.nav-item:hover {
  background: rgba(84, 190, 218, 0.14);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg,
      rgba(60, 185, 218, 0.26),
      rgba(60, 185, 218, 0.08));
  color: #fff;
  box-shadow: inset 5px 0 var(--cyan);
}

.shell.sidebar-collapsed .nav-item {
  display: grid !important;
  place-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  padding: 0;
  margin: 6px auto;
  text-align: center;
}

.shell.sidebar-collapsed .nav-item .nav-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
}

.shell.sidebar-collapsed .nav-item .nav-icon svg {
  width: 38px;
  height: 38px;
}

.shell.sidebar-collapsed .nav-item::before {
  left: calc(100% + 12px);
}

.shell.sidebar-collapsed .nav-section-end::after {
  left: 8px;
  right: 8px;
}

.nav-icon {
  flex: 0 0 30px;
}

.main {
  background: #edf2f5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 1px 0 rgba(16, 43, 59, 0.06),
    0 8px 20px rgba(16, 43, 59, 0.04);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  color: var(--navy);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.local {
  padding: 8px 12px;
  border: 1px solid #cfe8ef;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: #126882;
}

.content {
  max-width: 1440px;
  padding: 38px 42px 56px;
}

.title-row {
  align-items: center;
  margin-bottom: 28px;
}

.title-row h2 {
  color: var(--navy);
  font-size: clamp(29px, 3vw, 38px);
  letter-spacing: -0.035em;
}

.title-row p {
  font-size: 14px;
  line-height: 1.55;
  max-width: 720px;
}

.panel {
  border-color: #d7e2e8;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(16, 43, 59, 0.055);
}

.panel:hover {
  border-color: #c6d9e2;
}

.button {
  min-height: 44px;
  border-radius: 9px;
  padding: 12px 18px;
  font-size: 13px;
  letter-spacing: 0.005em;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(16, 43, 59, 0.13);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(26, 155, 192, 0.34);
  outline-offset: 2px;
}

.button.small {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 12px;
}

.primary {
  background: var(--navy-soft);
}

.primary:hover:not(:disabled) {
  background: #21556e;
}

.secondary {
  background: var(--cyan-soft);
  color: #126882;
}

.ghost {
  background: var(--steel);
}

.metric {
  min-height: 126px;
  border-top: 4px solid #cbdde5;
}

.dashboard-metrics .metric:nth-child(1) {
  border-top-color: var(--cyan);
}

.dashboard-metrics .metric:nth-child(2) {
  border-top-color: var(--green);
}

.dashboard-metrics .metric:nth-child(3) {
  border-top-color: var(--yellow);
}

.dashboard-metrics .metric:nth-child(4) {
  border-top-color: var(--red);
}

.dashboard-metric-link {
  min-height: 126px;
}

.dashboard-metric-link strong {
  font-size: 34px !important;
  color: var(--navy);
}

.dashboard-metric-link span {
  font-size: 12px;
}

.hero {
  background: linear-gradient(125deg, #102f42 0%, #126782 62%, #1a9bc0 100%);
  box-shadow: var(--shadow-lg);
}

.hero h3 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.hero strong {
  font-size: 54px;
}

.status {
  gap: 12px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  align-items: stretch;
}

.status span {
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 9px;
  min-width: 0;
}

.progress {
  height: 12px;
  background: #d9e8ee;
}

.progress i {
  background: var(--cyan);
}

table {
  font-size: 13px;
}

th {
  letter-spacing: 0.06em;
}

th,
td {
  padding: 16px 14px;
}

input,
select,
textarea {
  min-height: 46px;
  border-radius: 9px;
  font-size: 14px;
}

.dala-album-card,
.machine-card,
.company-card {
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(16, 43, 59, 0.07);
}

.dala-album-card {
  min-height: 430px;
}

.dala-album-card h3 {
  font-size: 19px;
}

.dala-album-info strong {
  font-size: 14px;
}

.dala-controls {
  min-height: 64px;
  align-items: stretch;
}

.dashboard-card-links .button {
  min-height: 38px;
}

.work-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.work-controls .button {
  margin: 0;
  min-width: 138px;
}

.work-routine-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.work-emergency-zone {
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0c7cc;
}

.work-emergency-zone .button {
  min-width: 190px;
  min-height: 48px;
  font-size: 16px;
}

.work-critical-metric {
  border-color: #b7dfe7;
  background: #f1fbfc;
}

.work-critical-metric strong {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
}

@media (max-width: 760px) {
  .work-routine-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .work-routine-controls .button {
    min-width: 0;
    width: 100%;
  }

  .work-emergency-zone .button {
    width: 100%;
  }
}

.work-loading-picker {
  margin-bottom: 24px;
  padding: 20px 24px;
  border-left: 5px solid var(--cyan);
  background: linear-gradient(100deg, #fff 0%, #f3fbfd 100%);
}

.work-loading-summary .kicker {
  display: block;
  margin-bottom: 5px;
}

.work-loading-summary strong {
  display: block;
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.work-loading-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.work-loading-picker .button {
  flex: 0 0 auto;
  margin: 0;
}

.dala-selection-screen {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 28px;
  border: 1px solid #cfe1e8;
  border-radius: 16px;
  background: #f8fcfd;
}

.dala-selection-heading {
  margin-bottom: 22px;
}

.dala-selection-heading h3 {
  margin: 7px 0 5px;
  font-size: 28px;
  color: var(--navy);
}

.dala-selection-heading p {
  margin: 0;
  color: var(--muted);
}

.detached-loading-list {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.detached-loading-card {
  display: grid;
  gap: 10px;
  margin: 0;
  border-color: #f4bd55;
  background: #fffaf0;
}

.detached-loading-card h3,
.detached-loading-card p {
  margin: 0;
}

.detached-loading-card p {
  color: var(--muted);
}

.reassign-loading-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.dala-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.dala-selection-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 24px;
  border: 2px solid #d3e3e9;
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(16, 43, 59, 0.07);
}

.dala-selection-card:hover,
.dala-selection-card:focus-visible {
  border-color: var(--cyan);
  outline: 3px solid rgba(26, 155, 192, 0.2);
  outline-offset: 3px;
}

.dala-selection-card strong {
  font-size: 24px;
}

.dala-selection-card span:not(.kicker) {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.dala-selection-card b {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 20px;
  background: var(--cyan-soft);
  color: #126882;
  font-size: 13px;
}

.dala-selection-card small {
  margin-top: auto;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 850;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions .button {
  margin: 0;
}

.product-edit-actions {
  justify-content: flex-end;
}

.emergency {
  border: 6px solid #a52f39;
  box-shadow: 0 14px 36px rgba(125, 31, 37, 0.2);
}

.emergency h2 {
  letter-spacing: 0.06em;
}

.page-error {
  border-top: 5px solid var(--cyan);
  box-shadow: var(--shadow-lg);
}

.empty-cell {
  font-size: 14px;
}

@media (min-width: 1100px) {
  .sidebar {
    width: 270px;
    flex-basis: 270px;
    padding: 28px 18px;
  }

  .main {
    margin-left: 270px;
  }

  .shell.sidebar-collapsed .main {
    margin-left: 120px;
  }

  .shell.sidebar-collapsed .sidebar {
    width: 120px;
  }

  .shell.sidebar-collapsed .nav-item {
    width: 78px;
    height: 78px;
  }

  .shell.sidebar-collapsed .nav-icon,
  .shell.sidebar-collapsed .nav-icon svg {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Operação industrial sem animações: estados mudam de forma imediata e previsível. */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.command-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 24, 34, 0.72);
}

.command-confirm {
  width: min(620px, 100%);
  padding: 34px;
  border: 2px solid var(--cyan);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(8, 24, 34, 0.28);
}

.command-confirm h2 {
  margin: 8px 0 12px;
  color: var(--navy);
  font-size: 30px;
}

.command-confirm p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.command-confirm-timer {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--cyan-soft);
  color: var(--navy);
  text-align: center;
}

.command-confirm-timer span {
  font-size: 22px;
  color: var(--cyan);
}

.command-confirm-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.command-confirm-actions .button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 86px;
  margin: 0;
  padding: 16px 22px;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 850;
}

.command-confirm-actions .button:focus-visible {
  outline-width: 5px;
  outline-offset: 4px;
}

@media (max-width: 560px) {
  .command-confirm-overlay {
    padding: 14px;
  }

  .command-confirm {
    padding: 24px 20px;
  }

  .command-confirm h2 {
    font-size: 25px;
  }

  .command-confirm-actions .button {
    min-height: 78px;
    font-size: 20px;
  }
}

.readonly-note {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-metrics,
.dala-album-grid,
.grid {
  gap: 24px;
}

.dashboard-metrics {
  align-items: stretch;
  grid-auto-rows: minmax(126px, 1fr);
}

.dashboard-metrics > .metric {
  height: 100%;
}

.dashboard-metrics > .panel + .panel {
  margin-top: 0;
}

.dashboard-dalas {
  margin-top: 10px;
}

.dala-album-card {
  aspect-ratio: auto;
  min-height: 360px;
  overflow: visible;
}

.dashboard-metric-link,
.dashboard-metric-link:hover,
.dashboard-metric-link:focus-visible {
  transform: none;
}

/* Cartões quadrados — máquinas e empresas */
.metric-green {
  color: var(--green);
}

.metric-red {
  color: var(--red);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.machine-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 235px;
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.06);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.machine-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(23, 33, 43, 0.1);
}

.machine-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.machine-card header strong {
  font-size: 15px;
  display: block;
  line-height: 1.25;
}

.machine-card header small {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.machine-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.machine-card dt {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 800;
}

.machine-card dd {
  margin: 4px 0 0;
  font-weight: 750;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-card .progress {
  margin: auto 0 8px;
}

.machine-card .progress-label {
  font-size: 10px;
}

.machine-card.is-offline {
  border-color: #f0d3d6;
  background: #fffbfb;
}

.company-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: stretch;
}

.company-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.06);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(23, 33, 43, 0.1);
}

.company-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.company-card-identity,
.company-card-statuses {
  min-width: 0;
}

.company-card header strong {
  font-size: 17px;
  display: block;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.company-card header small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.company-card header code {
  display: block;
  margin-top: 8px;
  color: #126882;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.company-card-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  max-width: 220px;
}

.company-card-statuses .badge {
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  padding: 6px 9px;
}

.company-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 6px 11px;
  background: #f8fafb;
}

.company-card-metrics b {
  font-size: 24px;
  display: block;
  line-height: 1.15;
}

.company-card-metrics small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.09em;
  font-weight: 800;
}

.company-card footer {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid #edf1f3;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
}

.company-card footer > .kicker {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.company-card footer .button {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.company-card footer > .actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 0;
}

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

  .company-card header {
    grid-template-columns: 1fr;
  }

  .company-card-statuses {
    justify-content: flex-start;
    max-width: none;
  }

  .company-card footer {
    align-items: stretch;
    flex-direction: column;
  }

  .company-card footer > .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .company-card footer .button {
    width: 100%;
  }

  .company-activation-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

.master-section-heading p {
  margin: 0;
  color: var(--muted);
}

.master-metrics {
  margin: 0 0 30px;
}

.master-section-heading {
  display: flex;
  align-items: flex-start;
  margin: 0 0 14px;
  padding-top: 28px;
  border-top: 1px solid #d6e0e7;
}

.master-section-heading h3 {
  margin: 3px 0 6px;
  color: #142332;
  font-size: 22px;
}

.master-log-heading {
  margin-top: 32px;
}

.master-log-preview {
  margin-bottom: 24px;
}

.shell.sidebar-collapsed .nav-item:hover::before {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #263b4d;
  color: #fff;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 30;
}

/* Componentes da etapa 24 — filtros, detalhes, status de equipamentos e botões auxiliares */
.grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-cards {
  align-items: stretch;
}

.detail-card small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.09em;
  font-weight: 800;
  display: block;
}

.detail-card strong {
  font-size: 17px;
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.metric-blue {
  color: var(--blue);
}

.metric-orange {
  color: #c26a00;
}

.badge.blue {
  background: var(--cyan-soft);
  color: #126882;
}

.badge.orange {
  background: #ffe9d2;
  color: #b05b00;
}

.warning {
  background: #f5e3bd;
  color: #6d4b00;
}

.required {
  color: var(--red);
}

.placeholder-panel {
  text-align: center;
  color: var(--muted);
  padding: 34px;
  border-style: dashed;
  box-shadow: none;
  background: transparent;
}

.page-error {
  max-width: 620px;
  margin: 54px auto;
  text-align: center;
  padding: 32px;
}


.page-error h2 {
  margin-top: 0;
}

.csv-legacy summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}

.csv-legacy[open] summary {
  color: var(--ink);
  margin-bottom: 14px;
}

/* Cadastro de acesso: deixa claro que o domínio é parte fixa do e-mail. */
.users-create-panel .panel-heading {
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-feedback {
  margin: 14px 4px 0;
  font-weight: 700;
  line-height: 1.4;
}

.status-refresh-feedback {
  position: sticky;
  top: 76px;
  z-index: 5;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--yellow);
  border-radius: 8px;
  background: #fff7df;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.08);
}

.form-feedback.is-error {
  color: var(--red);
}

.trace-inline-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #eef8fc;
  color: var(--ink);
  line-height: 1.4;
}

.trace-inline-feedback.is-error {
  border-color: var(--red);
  background: #fff1f1;
}

.users-create-panel #user-create-form .user-create-fields {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1.65fr)
    minmax(0, 1fr)
    minmax(0, 1.35fr);
}

.users-create-panel #user-create-form .user-create-fields.has-company-field {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1.65fr)
    minmax(0, 1fr)
    minmax(0, 1.35fr);
}

.users-create-panel #user-create-form .login-address-label {
  grid-column: auto;
}

.login-address-label {
  min-width: 0;
}

.users-create-panel #user-create-form .user-create-fields > label > input,
.users-create-panel #user-create-form .user-create-fields > label > select,
.users-create-panel #user-create-form .login-address,
.users-create-panel #user-create-form .password-field {
  width: 100%;
  height: 46px;
  min-height: 46px;
  margin-top: 8px;
  box-sizing: border-box;
}

.password-field {
  display: flex;
  align-items: stretch;
}

.password-field input {
  min-width: 0;
  flex: 1;
  margin-top: 0;
  height: 46px;
  min-height: 0;
  border-radius: 8px 0 0 8px;
  border-right: 0;
}

.password-field input:focus,
.password-field input:focus-visible {
  border-color: var(--line);
  outline: none;
  outline-offset: 0;
  box-shadow: none;
}

.password-toggle {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--cyan-soft);
  color: #126882;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.password-toggle:hover {
  background: #d9edf5;
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(26, 155, 192, 0.34);
  outline-offset: 2px;
}

.login-address {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.login-address:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(42, 111, 219, 0.14);
}

.login-address input {
  min-width: 0;
  flex: 1;
  margin-top: 0;
  height: 44px;
  min-height: 0;
  box-sizing: border-box;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent;
}

.login-address span {
  display: flex;
  align-items: center;
  height: 44px;
  min-height: 0;
  box-sizing: border-box;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  background: #eef4ff;
  color: #174d9c;
  font-weight: 800;
  white-space: nowrap;
}

.login-address-label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 700px) {
  .users-create-panel #user-create-form .user-create-fields,
  .users-create-panel #user-create-form .user-create-fields.has-company-field {
    grid-template-columns: 1fr;
  }

  .users-create-panel #user-create-form .login-address-label {
    grid-column: auto;
  }

  .login-address-label {
    min-width: 0;
  }

  .login-address span {
    padding: 0 9px;
    font-size: 0.84rem;
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .users-create-panel #user-create-form .user-create-fields,
  .users-create-panel #user-create-form .user-create-fields.has-company-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-create-panel #user-create-form .login-address-label {
    grid-column: span 2;
  }
}

.manifest-item td {
  vertical-align: middle;
}

.manifest-item select,
.manifest-item input {
  margin-top: 0;
}

.machine-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
  gap: 24px;
}

.machine-grid .machine-card {
  min-height: 310px;
  padding: 24px;
}

.machine-grid .machine-card header strong {
  font-size: 19px;
}

.machine-grid .machine-card header small {
  font-size: 11px;
}

.machine-grid .machine-card dl {
  gap: 16px 22px;
}

.machine-grid .machine-card dt {
  font-size: 10px;
}

.machine-grid .machine-card dd {
  font-size: 15px;
}

.machine-grid .machine-card .progress-label {
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: #b8c2cc;
  margin-right: 7px;
  vertical-align: middle;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 131, 79, 0.15);
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 50, 66, 0.13);
}

.sync-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.sync-status-row .status-dot {
  flex: 0 0 auto;
}

.sync-status-row strong {
  white-space: nowrap;
}

.dala-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.dala-status {
  white-space: normal;
  font-size: 12px;
  color: var(--muted);
}

.reference-table-panel td:last-child {
  white-space: nowrap;
  min-width: 250px;
}

.dala-status .status-dot {
  margin-right: 6px;
}

/* Final palette pass: only the light TracePlatform treatment remains active. */
html,
body {
  background: #eef3f6;
  color: #142332;
}

.sidebar {
  background: #fff;
  color: #142332;
  border-right: 1px solid #dce5eb;
  box-shadow: 8px 0 24px rgba(20, 35, 50, 0.06);
}

.brand strong {
  color: #122b40;
  font-size: 34px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.brand small {
  color: #567185;
  font-size: 11px;
  letter-spacing: 0.38em;
}

.nav-label {
  color: #6a7f8d;
  border-bottom-color: #e3eaee;
}

.nav-item {
  color: #334c5e;
}

.nav-item:hover,
.nav-item.active {
  background: #e9f5f8;
  color: #0d6c91;
}

.nav-item.active {
  box-shadow: inset 4px 0 #1ba8c8;
}

.main {
  background: #eef3f6;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d6e0e7;
  box-shadow: 0 2px 12px rgba(20, 35, 50, 0.04);
}

.topbar h1 {
  color: #142332;
}

.panel,
.status span,
th {
  background: #fff;
  border-color: #d6e0e7;
  color: #142332;
  box-shadow: 0 5px 18px rgba(20, 35, 50, 0.06);
}

input,
select,
textarea {
  background: #fff;
  border-color: #cbd8e0;
  color: #142332;
}

.primary {
  background: #1769ff;
  color: #fff;
}

.secondary {
  background: #e6f6fa;
  color: #0d6c91;
}

.ghost {
  background: #edf2f5;
  color: #142332;
}

.local {
  background: #e5f6f8;
  border-color: #c9e8ec;
  color: #147b91;
}

.sidebar footer {
  color: #69808f;
  border-top-color: #dce5eb;
}

.user-name {
  color: #142332;
}

.logout-link {
  color: #1769ff;
}

/* Menu lateral da referência TracePlatform. */
.main {
  margin-left: 256px;
}

.shell.sidebar-collapsed .main {
  margin-left: 48px;
}

.topbar {
  min-height: 48px;
  padding: 6px 16px;
}

.sidebar {
  width: 256px;
  flex-basis: 256px;
  padding: 0;
  background: #2d354c;
  color: #f7f9fc;
  border-right: 0;
  box-shadow: none;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.brand {
  height: 120px;
  margin: 0;
  padding: 12px;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand strong {
  color: #f7f9fc;
}

.brand small {
  color: rgba(247, 249, 252, 0.7);
}

.sidebar nav {
  padding: 0 8px;
}

.nav-label {
  height: 32px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  color: rgba(247, 249, 252, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}

.nav-item {
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  color: #f7f9fc;
  font-size: 14px;
  font-weight: 400;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: #5c667f;
  color: #fff;
  box-shadow: none;
  font-weight: 500;
}

.nav-section-end {
  margin-bottom: 17px;
}

.nav-icon,
.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon {
  flex: 0 0 16px;
  margin: 0;
}

.sidebar footer {
  margin-top: auto;
  padding: 12px;
  border-top: 0;
  color: #f7f9fc;
}

.user-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  background: #46516a;
  color: #f7f9fc;
}

.user-name,
.sidebar footer b {
  color: #f7f9fc;
}

.logout-link {
  color: #b9c1d0;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 0;
  color: #142332;
  border-radius: 8px;
}

.sidebar-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0 5px, currentColor 5px 7px, transparent 7px);
}

.shell.sidebar-collapsed .sidebar {
  width: 48px;
  flex-basis: 48px;
  padding: 0;
  background: #2d354c;
}

.shell.sidebar-collapsed .main {
  margin-left: 48px;
}

.shell.sidebar-collapsed .brand {
  height: 64px;
  padding: 8px;
  text-align: center;
}

.shell.sidebar-collapsed .brand strong {
  font-size: 0;
}

.shell.sidebar-collapsed .brand strong::after {
  content: "T";
  color: #f7f9fc;
  font-size: 18px;
  font-style: normal;
}

.shell.sidebar-collapsed .brand small,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .sidebar nav {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .nav-item {
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 4px 0;
  padding: 8px;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 8px 4px;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto;
}

/* Base estável do menu: preserva a navegação e a animação existentes. */
.sidebar {
  width: 270px;
  flex-basis: 270px;
  padding: 28px 18px;
  background: #fff;
  color: #142332;
  border-right: 1px solid #dce5eb;
  box-shadow: 8px 0 24px rgba(20, 35, 50, 0.06);
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.brand {
  height: auto;
  margin: 0 10px 32px;
  padding: 12px 10px 18px;
  display: block;
  border-bottom: 1px solid #e2e9ee;
}

.brand strong {
  color: #122b40;
  font-size: 34px;
}

.brand small {
  color: #567185;
  font-size: 11px;
}

.sidebar nav {
  padding: 0;
}

.nav-label {
  height: auto;
  margin: 20px 0 7px;
  padding: 0 12px;
  display: block;
  color: #6a7f8d;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 10px;
}

.nav-item {
  height: auto;
  min-height: 52px;
  margin: 2px 0;
  padding: 11px 12px;
  display: flex !important;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  color: #334c5e;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  background: #e9f5f8;
  color: #0d6c91;
}

.nav-item.active {
  box-shadow: inset 4px 0 #1ba8c8;
}

.nav-section-end {
  margin-bottom: 0;
}

.nav-icon,
.nav-icon svg {
  width: 30px;
  height: 30px;
}

.nav-icon {
  flex: 0 0 30px;
  margin-right: 12px;
}

.sidebar footer {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid #dce5eb;
  color: #69808f;
}

.user-name,
.sidebar footer b {
  color: #142332;
}

.logout-link {
  color: #1769ff;
}

.sidebar-toggle {
  width: auto;
  height: auto;
  padding: 0;
  display: inline-grid;
  font-size: 20px;
  color: #718091;
}

.sidebar-toggle::before {
  display: none;
}

.main {
  margin-left: 270px;
}

.shell.sidebar-collapsed .sidebar {
  width: 120px;
  flex-basis: 120px;
  padding: 24px 14px;
  background: #f7f9fc;
}

/* Contraste dos botões secundários azul-claros */
.button.secondary {
  background: #cfeaf2;
  border-color: #a8d2df;
  color: #075b78;
}

.button.secondary:hover:not(:disabled),
.button.secondary:focus-visible {
  background: #b8dfe9;
  border-color: #80c2d3;
  color: #064b65;
}

.button.secondary:focus-visible {
  outline: 3px solid rgba(13, 108, 145, 0.3);
  outline-offset: 2px;
}

.button.secondary:disabled,
.button.secondary[aria-disabled="true"] {
  background: #e2f0f4;
  border-color: #c9e0e6;
  color: #6f8d99;
}

.shell.sidebar-collapsed .main {
  margin-left: 120px;
}

.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .nav-item {
  width: 78px;
  height: 78px;
  min-height: 78px;
  padding: 0;
  margin: 6px auto;
  display: grid !important;
  place-items: center;
  justify-content: center;
}

.shell.sidebar-collapsed .nav-item .nav-icon,
.shell.sidebar-collapsed .nav-item .nav-icon svg {
  width: 36px;
  height: 36px;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 20px 0 24px;
  text-align: center;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto 18px;
}

/* Contraste dos botões secundários azul-claros */
.button.secondary {
  background: #cfeaf2;
  border-color: #a8d2df;
  color: #075b78;
}

.button.secondary:hover:not(:disabled),
.button.secondary:focus-visible {
  background: #b8dfe9;
  border-color: #80c2d3;
  color: #064b65;
}

.button.secondary:focus-visible {
  outline: 3px solid rgba(13, 108, 145, 0.3);
  outline-offset: 2px;
}

.button.secondary:disabled,
.button.secondary[aria-disabled="true"] {
  background: #e2f0f4;
  border-color: #c9e0e6;
  color: #6f8d99;
}

/* Restauração da base anterior ao ajuste do menu lateral. */
.sidebar {
  width: 270px;
  flex-basis: 270px;
  padding: 28px 18px;
  background: #fff;
  color: #142332;
  border-right: 1px solid #dce5eb;
  box-shadow: 8px 0 24px rgba(20, 35, 50, 0.06);
  transition: none;
}

.brand {
  height: auto;
  margin: 0 10px 32px;
  padding: 12px 10px 18px;
  display: block;
  border-bottom: 1px solid #e2e9ee;
}

.brand strong {
  color: #122b40;
  font-size: 34px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.brand small {
  color: #567185;
  font-size: 11px;
  letter-spacing: 0.38em;
}

.sidebar nav {
  padding: 0;
}

.nav-label {
  height: auto;
  margin: 20px 0 7px;
  padding: 0 12px;
  display: block;
  color: #6a7f8d;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 10px;
}

.nav-item {
  height: auto;
  min-height: 52px;
  margin: 2px 0;
  padding: 11px 12px;
  display: flex !important;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  color: #334c5e;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  background: #e9f5f8;
  color: #0d6c91;
}

.nav-item.active {
  box-shadow: inset 4px 0 #1ba8c8;
}

.nav-icon,
.nav-icon svg {
  width: 30px;
  height: 30px;
}

.nav-icon {
  flex: 0 0 30px;
  margin-right: 12px;
}

.sidebar footer {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid #dce5eb;
  color: #69808f;
}

.user-name,
.sidebar footer b {
  color: #142332;
}

.logout-link {
  color: #1769ff;
}

.sidebar-toggle {
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: #718091;
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-toggle::before {
  display: none;
}

.topbar {
  min-height: 76px;
  padding: 19px 34px;
}

.main {
  margin-left: 270px;
}

.shell.sidebar-collapsed .sidebar {
  width: 120px;
  flex-basis: 120px;
  padding: 24px 14px;
  background: #f7f9fc;
}

.shell.sidebar-collapsed .main {
  margin-left: 120px;
}

.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .user-name,
.shell.sidebar-collapsed footer b,
.shell.sidebar-collapsed .logout-link {
  display: none;
}

.shell.sidebar-collapsed .nav-item {
  width: 78px;
  height: 78px;
  min-height: 78px;
  padding: 0;
  margin: 6px auto;
  display: grid !important;
  place-items: center;
  justify-content: center;
}

.shell.sidebar-collapsed .nav-item .nav-icon,
.shell.sidebar-collapsed .nav-item .nav-icon svg {
  width: 36px;
  height: 36px;
}

.shell.sidebar-collapsed .sidebar footer {
  padding: 20px 0 24px;
  text-align: center;
}

.shell.sidebar-collapsed .user-avatar {
  float: none;
  margin: 0 auto 18px;
}

/* Logos oficiais: preservam a identidade original em todos os temas. */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 10px;
}

.brand img {
  display: block;
  width: min(100%, 156px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(15, 35, 55, 0.18));
}

.brand {
  background: linear-gradient(145deg, #0b1a29, #173852);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 18px rgba(15, 35, 55, .12);
}

.sidebar-dallogix-logo {
  display: block;
  width: min(100%, 146px);
  height: auto;
  max-height: 54px;
  object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 4px 9px rgba(15, 35, 55, 0.18));
  background: #0b1a29;
  border-radius: 10px;
  padding: 7px 12px;
}

.nav-item[data-page="dalas"] .nav-icon {
  background: url("../assets/branding/conveyor.png") center / contain no-repeat;
}

.nav-item[data-page="dalas"] .nav-icon svg {
  visibility: hidden;
}

.sidebar-toggle {
  width: 64px;
  height: 64px;
  font-size: 32px;
  border-radius: 14px;
}

.sidebar .logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 18px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(23, 111, 165, 0.2);
  border-radius: 10px;
  background: #e8f2f8;
  color: #145f8a;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar .logout-link::before {
  content: "↪";
  margin-right: 8px;
  font-size: 18px;
  line-height: 1;
}

.sidebar .logout-link:hover,
.sidebar .logout-link:focus-visible {
  background: #d5eaf5;
  color: #0e5078;
  transform: translateY(-1px);
}

.login-brand {
  min-height: 128px;
  margin: 0 0 26px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b1a29, #132e43);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 28px rgba(7, 21, 31, .2);
}

.login-brand img {
  width: min(100%, 250px);
}

.login-card::after {
  content: "";
  display: block;
  width: 178px;
  height: 42px;
  margin: 18px auto 0;
  background: url("../assets/branding/dallogix.png") center / contain no-repeat;
  filter: drop-shadow(0 4px 9px rgba(15, 35, 55, 0.2));
}

.shell.sidebar-collapsed .brand img {
  width: 78px;
  max-width: none;
}

.shell.sidebar-collapsed .brand {
  min-height: 84px;
  padding: 8px 4px;
}

.shell.sidebar-collapsed .sidebar-dallogix-logo {
  width: 72px;
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .brand img {
    width: 132px;
  }

  .login-brand img {
    width: 220px;
  }
}

/* Ajustes finais para telas pequenas: leitura, toque e rolagem sem deformar o desktop. */
@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    flex-basis: auto;
    min-height: 0;
    padding: 12px 14px;
  }

  .brand {
    min-height: 72px;
    margin: 0 0 10px;
  }

  .brand img {
    width: 138px;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .nav-label {
    grid-column: 1 / -1;
    margin: 8px 0 0;
  }

  .nav-item {
    min-height: 46px;
    padding: 9px 10px;
  }

  .sidebar footer {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0 10px;
    margin-top: 12px;
    padding: 12px 4px 0;
  }

  .sidebar-dallogix-logo {
    grid-column: 1 / -1;
    width: 138px;
    margin-bottom: 10px;
  }

  .sidebar .logout-link {
    grid-column: 1 / -1;
    margin-top: 12px;
  }

  .main,
  .shell.sidebar-collapsed .main {
    margin-left: 0;
  }

  .topbar {
    padding: 10px 14px;
    min-height: 76px;
    flex-wrap: wrap;
  }

  .sidebar-toggle {
    width: 56px;
    height: 56px;
    font-size: 29px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .local {
    margin-left: auto;
    font-size: 11px;
  }

  .content {
    padding: 18px 14px;
  }

  .title-row {
    gap: 12px;
    margin-bottom: 18px;
  }

  .title-row h2 {
    font-size: 26px;
    line-height: 1.1;
  }

  .title-row .button {
    width: 100%;
    margin: 0;
  }

  .filter-grid,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 15px;
    border-radius: 12px;
  }

  .button {
    min-height: 44px;
  }

  .table-wrap {
    margin: 0 -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .login-page {
    padding: 14px;
  }

  .login-card {
    padding: 22px 18px;
  }

  .login-brand {
    min-height: 108px;
  }
}

@media (max-width: 760px) {
  .shell.sidebar-collapsed .sidebar {
    width: 100%;
    padding: 8px 12px;
  }

  .shell.sidebar-collapsed .brand {
    min-height: 56px;
    margin: 0;
    justify-content: flex-start;
  }

  .shell.sidebar-collapsed .brand img {
    width: 108px;
  }

  .shell.sidebar-collapsed .sidebar nav,
  .shell.sidebar-collapsed .sidebar footer {
    display: none;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {

  .sidebar,
  .shell.sidebar-collapsed .sidebar {
    width: 220px;
    flex-basis: 220px;
    padding: 20px 14px;
  }

  .main,
  .shell.sidebar-collapsed .main {
    margin-left: 220px;
  }

  .brand {
    min-height: 82px;
  }

  .brand img {
    width: 142px;
  }

  .content {
    padding: 24px;
  }

  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .topbar {
    padding: 14px 22px;
  }

  .title-row h2 {
    font-size: 28px;
  }

  .panel {
    padding: 18px;
  }
}

.work-back-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 18px;
}

.work-back-row .button {
  margin: 0;
}

.title-row.has-back {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 20px;
}

.dala-create-screen {
  max-width: 820px;
  margin: 6px auto 0;
}

.dala-create-panel {
  padding: 30px 34px 34px;
}

.dala-create-panel .grid.one {
  gap: 22px;
}

.dala-create-panel label {
  color: #395268;
  font-weight: 750;
}

.dala-create-panel input {
  margin-top: 8px;
  min-height: 48px;
}

.dala-create-panel small {
  display: block;
  margin-top: 7px;
  color: #74889a;
  font-weight: 500;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .dala-create-panel {
    padding: 20px;
  }
}

.title-row.has-back>div:not(.actions) {
  min-width: 0;
}

.title-row.has-back .page-back {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

.title-row.has-back .actions {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
}

.title-row.has-back>div:not(.actions) {
  grid-column: 2;
  grid-row: 1;
}

.dala-view-header>div {
  position: static;
  left: auto;
  transform: none;
  text-align: left;
}

@media (max-width: 760px) {
  .title-row.has-back {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
  }

  .title-row.has-back .actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .title-row.has-back .actions .button {
    width: 100%;
    margin: 4px 0;
  }

  .title-row.has-back>div:not(.actions) {
    grid-column: 2;
  }

  .title-row.has-back:not(.with-actions)>div:not(.actions) {
    grid-column: 2;
  }

  .title-row.has-back .page-back {
    width: auto;
  }
}

.shell.sidebar-collapsed .nav-item:hover::before {
  background: #102b40;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 8px 18px rgba(8, 25, 40, .22);
  pointer-events: none;
}

.sidebar {
  z-index: 100;
  overflow: visible;
}

.shell.sidebar-collapsed .nav-item:hover::before {
  z-index: 1000;
}

/* Ritmo visual comum: títulos, formulários, painéis e ações compartilham
   a mesma escala em todas as telas. */
.content {
  width: min(100%, 1360px);
  padding: 32px clamp(20px, 3vw, 40px) 48px;
}

.title-row,
.title-row.with-actions {
  min-height: 48px;
  margin-bottom: 24px;
  gap: 20px;
}

.title-row h2 {
  margin: 0;
}

.title-row.has-back {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.title-row.has-back>div:not(.actions) {
  order: 1;
}

.title-row.has-back>.page-back {
  order: 2;
  margin: 0 0 0 auto;
}

.title-row.has-back>.actions {
  order: 3;
  margin-top: 0;
}

.panel {
  padding: 24px;
}

.panel+.panel {
  margin-top: 20px;
}

label {
  margin: 0 0 16px;
  line-height: 1.35;
}

label:last-child {
  margin-bottom: 0;
}

input,
select,
textarea {
  margin-top: 8px;
  min-height: 46px;
  padding: 11px 13px;
}

.actions {
  margin-top: 24px;
  gap: 12px;
}

.panel-heading .actions,
.table-wrap .actions,
td .actions {
  margin-top: 0;
}

.button {
  min-width: 112px;
  min-height: 46px;
  padding: 12px 18px;
}

.button.small {
  min-width: 0;
}

.dala-page-header .actions {
  margin-top: 0;
  justify-content: flex-end;
}

.dala-page-header .page-back {
  margin: 0;
}

.reference-table-panel {
  padding: 0;
}

.reference-table-panel th,
.reference-table-panel td {
  padding: 15px 16px;
}

@media (max-width: 760px) {
  .content {
    padding: 24px 16px 36px;
  }

  .title-row,
  .title-row.with-actions,
  .dala-page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
  }

  .title-row .actions,
  .dala-page-header .actions {
    width: 100%;
    justify-content: stretch;
  }

  .title-row .actions .button,
  .dala-page-header .actions .button {
    flex: 1 1 auto;
  }

  .panel {
    padding: 18px;
  }

  .grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .grid.five {
    grid-template-columns: 1fr;
  }

  .actions .button {
    min-width: 0;
  }

  .title-row.has-back>.page-back {
    margin-left: 0;
  }
}

/* A tela de login usa apenas a marca principal no cabeçalho. */
.login-card::after {
  display: none;
}

/* Escala de leitura ampliada para operação em monitores e tablets. */
body {
  font-size: 16px;
  line-height: 1.5;
}

.nav-item {
  font-size: 15px;
}

.nav-label {
  font-size: 11px;
}

.topbar h1 {
  font-size: 20px;
}

.local {
  font-size: 13px;
}

.title-row p,
.panel p,
.compact-help,
.empty-cell {
  font-size: 15px;
}

label {
  font-size: 14px;
}

input,
select,
textarea {
  font-size: 15px;
}

table {
  font-size: 14px;
}

.button {
  font-size: 14px;
}

.button.small {
  font-size: 13px;
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .local {
    font-size: 12px;
  }

  .title-row p,
  .panel p,
  .compact-help,
  .empty-cell {
    font-size: 14px;
  }
}

/* Ampliação adicional solicitada para leitura à distância. */
body {
  font-size: 19px;
}

.nav-item {
  font-size: 18px;
}

.nav-label {
  font-size: 14px;
}

.topbar h1 {
  font-size: 23px;
}

.local {
  font-size: 16px;
}

.title-row p,
.panel p,
.compact-help,
.empty-cell {
  font-size: 18px;
}

label {
  font-size: 17px;
}

input,
select,
textarea {
  font-size: 18px;
}

table {
  font-size: 17px;
}

.button {
  font-size: 17px;
}

.button.small {
  font-size: 16px;
}

/* Textos internos dos cartões do dashboard acompanham a escala principal. */
.dala-album-card .album-label {
  font-size: 14px;
}

.dala-album-card h3 {
  font-size: 22px;
}

.dala-album-card code {
  font-size: 16px;
}

.dala-album-card .badge {
  font-size: 14px;
}

.dala-album-info small {
  font-size: 13px;
}

.dala-album-info strong {
  font-size: 17px;
}

.album-progress small {
  font-size: 14px;
}

.dala-album-card footer>span {
  font-size: 14px;
}

.dashboard-card-links .button {
  font-size: 16px;
}

/* Elementos auxiliares usam a mesma escala em todas as telas. */
small,
.kicker,
.badge,
.status span,
.progress-label,
.metric small,
li small,
th {
  font-size: 14px;
}

code {
  font-size: 16px;
}

/* Base único de tipografia e posicionamento para componentes equivalentes. */
h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.2;
}

h3 {
  margin: 0 0 12px;
}

h4 {
  margin: 0 0 8px;
}

p {
  line-height: 1.5;
}

.muted,
.field-help,
.login-description {
  color: var(--muted);
}

.text-link {
  font-size: 16px;
  line-height: 1.3;
}

.table-actions {
  gap: 8px;
}

.manifest-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 190px;
}

.dala-color-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(23, 33, 43, 0.2);
  border-radius: 50%;
  background: #8b949e;
}

.dala-color-swatch[data-color="VERDE"] {
  background: #23834f;
}

.dala-color-swatch[data-color="VERMELHO"] {
  background: #b83242;
}

.dala-color-swatch[data-color="AMBAR"] {
  background: #d79a00;
}

.dala-color-swatch[data-color="AZUL"] {
  background: #176fa5;
}

.import-feedback {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.import-feedback.is-success {
  color: var(--green);
}

.import-feedback.is-warning {
  color: #8a6100;
}

.import-feedback.is-error {
  color: var(--red);
}

.manifest-row-actions>.button {
  white-space: nowrap;
}

.table-action-menu {
  position: relative;
}

.table-action-menu summary {
  list-style: none;
  cursor: pointer;
}

.table-action-menu summary::-webkit-details-marker {
  display: none;
}

.table-action-menu-list {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 43, 59, 0.16);
}

.table-action-menu-list .button {
  width: 100%;
  text-align: left;
}

@media (max-width: 760px) {
  .manifest-row-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

.panel-heading {
  align-items: flex-start;
}

.panel-heading>.actions {
  align-self: center;
}

.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.metric strong {
  line-height: 1.15;
}

.status {
  gap: 12px;
}

.status span {
  line-height: 1.35;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav-item {
    font-size: 15px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .local {
    font-size: 13px;
  }

  .title-row p,
  .panel p,
  .compact-help,
  .empty-cell {
    font-size: 15px;
  }

  label {
    font-size: 14px;
  }

  input,
  select,
  textarea {
    font-size: 15px;
  }

  table {
    font-size: 14px;
  }

  .button {
    font-size: 14px;
  }

  .dala-album-card .album-label {
    font-size: 13px;
  }

  .dala-album-card h3 {
    font-size: 19px;
  }

  .dala-album-card code {
    font-size: 14px;
  }

  .dala-album-card .badge {
    font-size: 13px;
  }

  .dala-album-info small {
    font-size: 12px;
  }

  .dala-album-info strong {
    font-size: 15px;
  }

  .album-progress small,
  .dala-album-card footer>span {
    font-size: 13px;
  }

  .dashboard-card-links .button {
    font-size: 14px;
  }

  small,
  .kicker,
  .badge,
  .status span,
  .progress-label,
  .metric small,
  li small,
  th {
    font-size: 13px;
  }

  code {
    font-size: 14px;
  }

  .text-link {
    font-size: 14px;
  }

  .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-heading>.actions {
    align-self: stretch;
  }
}

.pdf-import-card {
  background: #fff;
  border-color: var(--line);
}

.pdf-import-card>p {
  margin: 0 0 22px;
}

.pdf-import-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.file-picker {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-picker-button {
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.pdf-import-card .actions {
  margin: 0;
  justify-content: flex-end;
  align-self: center;
}

.pdf-import-card .actions .button {
  min-width: 150px;
}

/* O cadastro fica separado do painel de itens para não parecer parte da tabela. */
.manifest-submit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 20px 0 24px;
}

.manifest-submit-actions .button {
  margin: 0;
}

@media (max-width: 760px) {
  .pdf-import-card form {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .file-picker {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .file-picker-button {
    width: 100%;
    justify-content: center;
  }

  .file-name {
    text-align: center;
  }

  .pdf-import-card .actions {
    justify-content: stretch;
  }

  .pdf-import-card .actions .button {
    width: 100%;
  }

  .manifest-submit-actions .button {
    width: 100%;
    justify-content: center;
  }
}

/* Base responsiva: mantém o conteúdo dentro da viewport e o foco visível. */
html,
body,
.shell,
.main,
.content {
  min-width: 0;
}

html,
body {
  overflow-x: clip;
}

:focus-visible {
  outline: 3px solid #1ba8c8;
  outline-offset: 3px;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* No celular, o botão controla um menu lateral sobre o conteúdo. */
@media (max-width: 760px) {

  .shell .sidebar,
  .shell.sidebar-collapsed .sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    width: min(280px, 85vw);
    height: calc(100dvh - 76px);
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    background: #fff;
    transform: translateX(-100%);
    visibility: hidden;
    z-index: 100;
  }

  .shell.mobile-menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .shell .main {
    margin-left: 0;
    min-width: 0;
  }

  .shell .topbar {
    position: sticky;
    top: 0;
    z-index: 101;
    height: 76px;
    min-height: 76px;
    padding: 8px 12px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .shell .topbar h1 {
    min-width: 0;
    font-size: 14px;
  }

  .shell .topbar .local {
    display: none;
  }

  .shell .sidebar-toggle {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }

  .shell .sidebar nav,
  .shell.sidebar-collapsed .sidebar nav {
    display: block;
  }

  .shell .sidebar .brand {
    display: block;
    min-height: 72px;
    margin: 0 0 16px;
  }

  .shell .sidebar .brand img {
    width: 138px;
  }

  .shell .sidebar .nav-label,
  .shell .sidebar .nav-text,
  .shell .sidebar .user-name,
  .shell .sidebar footer b,
  .shell .sidebar .logout-link {
    display: block;
  }

  .shell .sidebar .nav-item {
    display: flex !important;
    width: auto;
    height: auto;
    min-height: 48px;
    margin: 4px 0;
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .shell .sidebar .nav-icon,
  .shell .sidebar .nav-icon svg {
    width: 26px;
    height: 26px;
  }

  .shell .sidebar footer,
  .shell.sidebar-collapsed .sidebar footer {
    display: block;
    padding: 16px 0;
    text-align: left;
  }

  .shell .sidebar .nav-item::before {
    display: none;
  }
}

/* Cadastro de Dalas: identidade, conexão e ações em faixas separadas. */
.dalas-catalog {
  min-width: 0;
  width: 100%;
}

.dalas-register-list {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.dala-register {
  min-width: 0;
  background: #fff;
  border: 1px solid #dce5eb;
  border-radius: 14px;
}

.dala-register-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 30%);
  gap: 24px;
  padding: 24px;
  align-items: start;
}

.dala-register-heading h3 {
  margin: 0 0 8px;
  font-size: 21px;
  color: #142332;
  overflow-wrap: anywhere;
}

.dala-register-heading p {
  margin: 0;
  color: #69808f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dala-register-heading code {
  display: inline;
  margin-left: 6px;
  color: #334c5e;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dala-field-label,
.dala-register-connection dt {
  display: block;
  color: #69808f;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dala-register-status {
  min-width: 0;
}

.dala-register-status .dala-status {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dala-register-connection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 20px 24px;
  background: #f7fafb;
  border-top: 1px solid #e8eef2;
  gap: 20px;
}

.dala-register-connection dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #334c5e;
  overflow-wrap: anywhere;
}

.dala-register-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #e8eef2;
}

.dala-register-actions .text-link {
  min-height: 44px;
  padding: 10px 14px;
  margin: 0;
  border-radius: 8px;
}

.dala-register-actions .text-link:hover {
  background: #e9f5f8;
}

.dala-register-actions .danger-link {
  margin-left: auto;
}

@media (max-width: 760px) {
  .dala-register-heading {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    gap: 18px;
  }

  .dala-register-connection {
    padding: 18px 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .dala-register-connection>div:first-child {
    grid-column: 1 / -1;
  }

  .dala-register-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .dala-register-actions .danger-link {
    margin-left: 0;
  }
}

/* Catálogo de Dalas: tabela alinhada e responsiva. */
.dalas-reference-screen {
  width: 100%;
  min-width: 0;
}

.dalas-reference-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.dalas-reference-header h2 {
  margin: 0;
  color: #142332;
  font-size: 30px;
  line-height: 1.15;
}

.dalas-reference-header .button {
  flex: 0 0 auto;
  min-width: 140px;
}

.dalas-reference-table-wrap {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e2e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 35, 50, 0.06);
}

.dalas-reference-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.dalas-reference-table th,
.dalas-reference-table td {
  min-width: 0;
  padding: 20px 18px;
  border-bottom: 1px solid #e5edf1;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.dalas-reference-table th {
  color: #62798a;
  background: #f7fafb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dalas-reference-table td {
  color: #263b4b;
  font-size: 14px;
}

.dalas-reference-table tbody tr:last-child td {
  border-bottom: 0;
}

.dalas-reference-table td strong {
  color: #142332;
  font-size: 15px;
}

.dalas-reference-table td code {
  color: #35566b;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dalas-reference-table th:nth-child(1),
.dalas-reference-table td:nth-child(1) {
  width: 15%;
}

.dalas-reference-table th:nth-child(2),
.dalas-reference-table td:nth-child(2) {
  width: 16%;
}

.dalas-reference-table th:nth-child(3),
.dalas-reference-table td:nth-child(3) {
  width: 14%;
}

.dalas-reference-table th:nth-child(4),
.dalas-reference-table td:nth-child(4),
.dalas-reference-table th:nth-child(5),
.dalas-reference-table td:nth-child(5) {
  width: 10%;
}

.dalas-reference-table th:nth-child(6),
.dalas-reference-table td:nth-child(6) {
  width: 17%;
}

.dalas-reference-table th:nth-child(7),
.dalas-reference-table td:nth-child(7) {
  width: 18%;
}

.dala-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  line-height: 1.35;
}

.dala-status .status-dot {
  flex: 0 0 auto;
  margin: 5px 0 0;
}

.dala-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dala-reference-action {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #b6c7d1;
  border-radius: 8px;
  background: #fff;
  color: #245c79;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dala-reference-action:hover,
.dala-reference-action:focus-visible {
  border-color: #1daac4;
  background: #edf9fb;
}

.dala-reference-action.danger {
  color: #a33443;
}

.empty-cell {
  padding: 34px 20px !important;
  text-align: center !important;
  color: #69808f !important;
}

@media (max-width: 980px) and (min-width: 761px) {

  .dalas-reference-table th,
  .dalas-reference-table td {
    padding: 16px 12px;
  }

  .dalas-reference-action {
    padding-inline: 8px;
  }
}

@media (max-width: 760px) {
  .dalas-reference-header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 18px;
  }

  .dalas-reference-header h2 {
    font-size: 26px;
  }

  .dalas-reference-header .button {
    width: 100%;
  }

  .dalas-reference-table-wrap {
    overflow: visible;
  }

  .dalas-reference-table,
  .dalas-reference-table tbody,
  .dalas-reference-table tr,
  .dalas-reference-table td {
    display: block;
    width: 100%;
  }

  .dalas-reference-table thead {
    display: none;
  }

  .dalas-reference-table tr {
    padding: 8px 16px;
    border-bottom: 1px solid #e5edf1;
  }

  .dalas-reference-table tbody tr:last-child {
    border-bottom: 0;
  }

  .dalas-reference-table td {
    display: grid;
    grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0;
  }

  .dalas-reference-table td::before {
    content: attr(data-label);
    color: #69808f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .dalas-reference-table td[data-label="Ações"] {
    display: block;
    padding-top: 14px;
  }

  .dalas-reference-table td[data-label="Ações"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .dala-reference-actions {
    gap: 8px;
  }

  .dala-reference-action {
    flex: 1 1 auto;
  }
}

/* A tabela de Dalas em Configurações usa células nativas; o status não deve virar um flex item. */
.settings-dalas-table-wrap {
  overflow-x: auto;
}

.settings-dalas-table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
  border-collapse: collapse;
}

.settings-dalas-table th,
.settings-dalas-table td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.settings-dalas-table th:nth-child(1),
.settings-dalas-table td:nth-child(1) {
  width: 20%;
}

.settings-dalas-table th:nth-child(2),
.settings-dalas-table td:nth-child(2) {
  width: 25%;
}

.settings-dalas-table th:nth-child(3),
.settings-dalas-table td:nth-child(3) {
  width: 20%;
}

.settings-dalas-table th:nth-child(4),
.settings-dalas-table td:nth-child(4) {
  width: 15%;
}

.settings-dalas-table th:nth-child(5),
.settings-dalas-table td:nth-child(5) {
  width: 20%;
}

.settings-dalas-table td.dala-status {
  display: table-cell;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
}

/* Parâmetros do PDF: uma área de configuração curta, legível e sem campos largos demais. */
.pdf-import-panel {
  padding-block: 20px;
}

.pdf-import-heading {
  margin-bottom: 10px;
}

.pdf-import-heading h3 {
  margin-bottom: 4px;
}

.pdf-import-heading .compact-help {
  margin: 0;
  max-width: none;
}

.pdf-import-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}

.pdf-import-fields label,
.pdf-import-footer label {
  margin: 0;
  color: #395268;
  font-size: 14px;
  font-weight: 700;
}

.pdf-import-fields input,
.pdf-import-footer select {
  min-height: 42px;
  margin-top: 5px;
  padding: 8px 11px;
  font-size: 15px;
}

.pdf-import-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.pdf-import-footer label {
  width: min(100%, 360px);
}

.pdf-import-footer .actions {
  margin: 0;
}

.pdf-import-footer .button {
  min-height: 42px;
  padding-block: 9px;
}

@media (max-width: 1050px) {
  .pdf-import-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .pdf-import-fields {
    grid-template-columns: 1fr;
  }

  .pdf-import-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-import-footer label,
  .pdf-import-footer .actions,
  .pdf-import-footer .button {
    width: 100%;
  }
}

/* Ajustes finais de responsividade: conteúdo centrado, menus estáveis e tabelas sem rolagem lateral. */
html,
body,
.shell,
.main,
.content {
  min-width: 0;
}

html,
body {
  overflow-x: clip;
}

.topbar {
  position: relative;
}

.topbar h1 {
  position: absolute;
  left: 50%;
  max-width: calc(100% - 180px);
  margin: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.sidebar {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 761px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
  }
}

.filter-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.filter-toggle {
  margin: 0;
}

.date-filter-control {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.date-filter-control input {
  min-width: 0;
  flex: 1 1 auto;
}

.date-clear {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: #315c73;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.date-clear:hover,
.date-clear:focus-visible {
  border-color: #1daac4;
  background: #edf9fb;
}

.mobile-card-table {
  width: 100%;
  min-width: 0 !important;
}

@media (max-width: 900px) {
  .mobile-card-table {
    display: block;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 12px;
  }

  .mobile-card-table tbody tr {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
  }

  .mobile-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(100px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 11px 13px;
    border-bottom: 1px solid #e7edf1;
    overflow-wrap: anywhere;
  }

  .mobile-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .mobile-card-table tbody td[data-label]::before {
    content: attr(data-label);
    color: #69808f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
  }

  .mobile-card-table tbody td.empty-cell {
    display: block;
    text-align: center;
  }

  .mobile-card-table tbody td.empty-cell::before {
    display: none;
  }

  .mobile-card-table .button,
  .mobile-card-table .table-actions {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar h1 {
    left: 50%;
    max-width: calc(100% - 88px);
    font-size: 14px;
  }

  .topbar h1 .page-context {
    display: none;
  }

  .shell .sidebar,
  .shell.sidebar-collapsed .sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    width: min(280px, 86vw);
    height: calc(100dvh - 76px);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    visibility: hidden;
  }

  .shell.mobile-menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .shell .main,
  .shell.sidebar-collapsed .main {
    margin-left: 0;
    min-width: 0;
  }

  .shell .topbar {
    position: sticky;
    top: 0;
    z-index: 101;
  }

  .shell .sidebar-toggle {
    position: relative;
    z-index: 102;
    margin: 0;
  }

  .content {
    width: 100%;
    padding-inline: 12px;
  }

  .filter-toolbar {
    justify-content: stretch;
  }

  .filter-toggle {
    width: 100%;
  }

  .date-filter-control {
    width: 100%;
  }

  .date-clear {
    min-height: 42px;
  }
}

@media (max-width: 420px) {
  .mobile-card-table tbody td {
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    padding-inline: 11px;
  }

  .date-filter-control {
    gap: 6px;
  }

  .date-clear {
    padding-inline: 8px;
  }
}

/* Chrome dinâmico: evita exibir links e estados de conexão antes da hidratação. */
.sidebar nav {
  visibility: hidden;
}

.sidebar nav.is-hydrated {
  visibility: visible;
}

.topbar h1 .brand-context {
  font-weight: inherit;
}

.topbar h1 .page-context {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 600;
}

.local.is-degraded {
  background: #fff4d6;
  border-color: #f0d38a;
  color: #8a6100;
}

.local.is-offline {
  background: #fde8eb;
  border-color: #efb9c1;
  color: #a33443;
}

.local.is-degraded i {
  background: #d79a00;
}

.local.is-offline i {
  background: var(--red);
}

/* Organização da referência da tela de Dalas, preservando a paleta global. */
.dalas-reference-header {
  margin-bottom: 30px;
}

.dalas-reference-header h2 {
  font-size: 34px;
}

.dalas-reference-header .button.primary {
  min-width: 158px;
  min-height: 48px;
  padding: 11px 22px;
  font-size: 17px;
}

.dalas-reference-table-wrap {
  border-radius: 18px;
}

.dalas-reference-table th {
  padding: 20px 22px;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.dalas-reference-table td {
  padding: 24px 22px;
  font-size: 16px;
}

.dalas-reference-table td strong {
  font-size: 18px;
}

.dalas-reference-table td code {
  font-size: 16px;
}

.dalas-reference-table th:nth-child(1),
.dalas-reference-table td:nth-child(1) {
  width: 17%;
}

.dalas-reference-table th:nth-child(2),
.dalas-reference-table td:nth-child(2) {
  width: 13%;
}

.dalas-reference-table th:nth-child(3),
.dalas-reference-table td:nth-child(3) {
  width: 14%;
}

.dalas-reference-table th:nth-child(4),
.dalas-reference-table td:nth-child(4),
.dalas-reference-table th:nth-child(5),
.dalas-reference-table td:nth-child(5) {
  width: 9%;
}

.dalas-reference-table th:nth-child(6),
.dalas-reference-table td:nth-child(6) {
  width: 18%;
}

.dalas-reference-table th:nth-child(7),
.dalas-reference-table td:nth-child(7) {
  width: 20%;
}

.dalas-reference-table td:first-child strong {
  display: block;
  overflow-wrap: anywhere;
}

.dala-status {
  font-size: 14px;
}

.dala-reference-actions {
  gap: 9px;
}

.dala-reference-action {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
}

@media (min-width: 1700px) {
  .dala-reference-actions {
    flex-wrap: nowrap;
  }
}

@media (max-width: 760px) {
  .dalas-reference-header {
    margin-bottom: 22px;
  }

  .dalas-reference-header h2 {
    font-size: 29px;
  }

  .dalas-reference-header .button.primary {
    min-height: 46px;
    font-size: 16px;
  }

  .dalas-reference-table th {
    padding: 16px 18px;
    font-size: 14px;
  }

  .dalas-reference-table td {
    padding: 18px;
    font-size: 15px;
  }

  .dalas-reference-table td strong {
    font-size: 17px;
  }

  .dala-reference-action {
    font-size: 13px;
  }
}

/* A tabela usa melhor a largura disponível em telas grandes. */
@media (min-width: 1201px) {
  .dalas-reference-table-wrap {
    width: calc(100% + 160px);
    margin-left: -80px;
  }

  .shell:not(.sidebar-collapsed) .dalas-reference-table-wrap {
    width: 100%;
    margin-left: 0;
  }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .dalas-reference-table-wrap {
    width: calc(100% + 48px);
    margin-left: -24px;
  }
}

@media (max-width: 760px) {
  .dalas-reference-table-wrap {
    width: 100%;
    margin-left: 0;
  }
}

/* Visualização da Dala: cadastro, operação e diagnóstico em blocos contínuos. */
.dala-page-kicker {
  display: block;
  margin-bottom: 6px;
  color: #6b8292;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dala-page-header {
  align-items: flex-start;
}

.dala-page-header h2 {
  margin: 0 0 6px;
}

.dala-page-header p {
  margin: 0;
}

.dala-overview-panel,
.dala-stats-panel,
.dala-diagnostics-panel {
  padding: 26px;
  border-radius: 14px;
}

.dala-overview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2ebef;
}

.dala-overview-heading h3,
.dala-stats-panel h3,
.dala-diagnostics-panel h3 {
  margin: 0;
}

.dala-status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 360px;
  margin: 0;
  color: #5f7483;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-align: right;
}

.dala-status-line .status-dot {
  flex: 0 0 auto;
  margin: 0;
}

.dala-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 28px;
  padding-top: 24px;
}

.dala-info-item {
  min-width: 0;
}

.dala-info-item small {
  display: block;
  margin-bottom: 8px;
  color: #6b8292;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dala-info-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: #142332;
  font-size: 16px;
  line-height: 1.3;
}

.dala-info-item code {
  color: #35566b;
  font-size: 15px;
}

.dala-stats-panel {
  margin-top: 18px;
}

.dala-stats-panel .panel-heading {
  align-items: flex-end;
}

.dala-last-signal {
  color: #6b8292;
  font-size: 13px;
}

.dala-stats-grid {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #e2ebef;
}

.dala-diagnostics-panel {
  margin-top: 18px;
}

.dala-diagnostics-panel .panel-heading {
  margin-bottom: 18px;
}

.dala-diagnostics-panel .table-wrap {
  margin: 0;
}

@media (max-width: 1000px) and (min-width: 761px) {
  .dala-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dala-page-header {
    align-items: stretch;
  }

  .dala-page-header .actions {
    width: 100%;
  }

  .dala-page-header .actions .button {
    width: 100%;
  }

  .dala-overview-panel,
  .dala-stats-panel,
  .dala-diagnostics-panel {
    padding: 20px 16px;
  }

  .dala-overview-heading {
    flex-direction: column;
    gap: 16px;
  }

  .dala-status-line {
    max-width: none;
    text-align: left;
  }

  .dala-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }

  .dala-stats-panel .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dala-last-signal {
    font-size: 12px;
  }

  .dala-stats-grid {
    gap: 18px;
  }
}

/* Referência visual da tela de Dalas: painel escuro e tabela operacional. */
.dalas-reference-screen {
  width: calc(100% + 64px);
  min-height: calc(100vh - 76px);
  margin: -32px;
  padding: 36px 32px 56px;
  background: #0f172a;
  color: #f7f9fc;
}

.dalas-reference-header {
  margin: 0 auto 40px;
  max-width: 100%;
}

.dalas-reference-header h2 {
  color: #f7f9fc;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.dalas-reference-header .button.primary {
  min-width: 192px;
  min-height: 54px;
  padding: 13px 28px;
  border-radius: 15px;
  font-size: 19px;
}

.dalas-reference-table-wrap {
  max-width: 100%;
  border: 1px solid #31435e;
  border-radius: 22px;
  background: #1d2a40;
  box-shadow: none;
}

.dalas-reference-table th,
.dalas-reference-table td {
  border-bottom-color: #30415b;
}

.dalas-reference-table th {
  padding: 25px 28px;
  background: #1d2a40;
  color: #9eafc8;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.dalas-reference-table td {
  padding: 28px;
  color: #dce5f2;
  font-size: 17px;
}

.dalas-reference-table td strong {
  color: #f7f9fc;
  font-size: 19px;
}

.dalas-reference-table td code {
  color: #dce5f2;
  font-size: 17px;
}

.dalas-reference-table th:nth-child(1),
.dalas-reference-table td:nth-child(1) {
  width: 9%;
}

.dalas-reference-table th:nth-child(2),
.dalas-reference-table td:nth-child(2) {
  width: 15%;
}

.dalas-reference-table th:nth-child(3),
.dalas-reference-table td:nth-child(3) {
  width: 14%;
}

.dalas-reference-table th:nth-child(4),
.dalas-reference-table td:nth-child(4),
.dalas-reference-table th:nth-child(5),
.dalas-reference-table td:nth-child(5) {
  width: 8%;
}

.dalas-reference-table th:nth-child(6),
.dalas-reference-table td:nth-child(6) {
  width: 21%;
}

.dalas-reference-table th:nth-child(7),
.dalas-reference-table td:nth-child(7) {
  width: 20%;
}

.dala-status {
  color: #dce5f2;
  font-size: 16px;
}

.dala-status .status-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  background: #ff3345;
  box-shadow: 0 0 0 5px rgba(255, 51, 69, 0.14);
}

.dala-reference-actions {
  flex-wrap: nowrap;
  gap: 10px;
}

.dala-reference-action {
  min-height: 47px;
  padding: 9px 14px;
  border: 2px solid #f3f6fb;
  border-radius: 12px;
  background: transparent;
  color: #f7f9fc;
  font-size: 15px;
  white-space: nowrap;
}

.dala-reference-action:hover,
.dala-reference-action:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dala-reference-action.danger {
  color: #f7f9fc;
}

.empty-cell {
  color: #c2cfdf !important;
}

@media (max-width: 1200px) and (min-width: 761px) {
  .dalas-reference-screen {
    padding-inline: 24px;
  }

  .dalas-reference-table th,
  .dalas-reference-table td {
    padding-inline: 16px;
  }

  .dalas-reference-table td {
    font-size: 15px;
  }

  .dalas-reference-table td code {
    font-size: 15px;
  }

  .dala-reference-action {
    padding-inline: 9px;
    font-size: 13px;
  }
}

@media (max-width: 760px) {
  .dalas-reference-screen {
    width: calc(100% + 28px);
    min-height: calc(100vh - 76px);
    margin: -18px -14px -36px;
    padding: 28px 14px 42px;
  }

  .dalas-reference-header {
    margin-bottom: 24px;
  }

  .dalas-reference-header h2 {
    font-size: 30px;
  }

  .dalas-reference-header .button.primary {
    min-height: 50px;
    font-size: 17px;
  }

  .dalas-reference-table-wrap {
    border-radius: 16px;
  }

  .dalas-reference-table tr {
    padding: 10px 16px;
    border-bottom-color: #30415b;
  }

  .dalas-reference-table td {
    color: #dce5f2;
    font-size: 15px;
  }

  .dalas-reference-table td strong {
    color: #fff;
    font-size: 16px;
  }

  .dalas-reference-table td code {
    color: #dce5f2;
    font-size: 15px;
  }

  .dalas-reference-table td::before {
    color: #9eafc8;
  }

  .dala-reference-actions {
    flex-wrap: wrap;
  }

  .dala-reference-action {
    flex: 1 1 auto;
  }
}

/* A tela de Dalas segue a paleta clara global; o refinamento é apenas estrutural. */
.dalas-reference-screen {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

.dalas-reference-header {
  margin: 0 0 24px;
}

.dalas-reference-header h2 {
  color: #142332;
  font-size: 30px;
  letter-spacing: normal;
}

.dalas-reference-header .button.primary {
  min-width: 140px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: inherit;
}

.dalas-reference-table-wrap {
  border: 1px solid #d7e2e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 35, 50, 0.06);
}

.dalas-reference-table th,
.dalas-reference-table td {
  border-bottom-color: #e5edf1;
}

.dalas-reference-table th {
  padding: 20px 18px;
  background: #f7fafb;
  color: #62798a;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dalas-reference-table td {
  padding: 20px 18px;
  color: #263b4b;
  font-size: 14px;
}

.dalas-reference-table td strong {
  color: #142332;
  font-size: 15px;
}

.dalas-reference-table td code {
  color: #35566b;
  font-size: inherit;
}

.dalas-reference-table th:nth-child(1),
.dalas-reference-table td:nth-child(1) {
  width: 9%;
}

.dalas-reference-table th:nth-child(2),
.dalas-reference-table td:nth-child(2) {
  width: 15%;
}

.dalas-reference-table th:nth-child(3),
.dalas-reference-table td:nth-child(3) {
  width: 14%;
}

.dalas-reference-table th:nth-child(4),
.dalas-reference-table td:nth-child(4),
.dalas-reference-table th:nth-child(5),
.dalas-reference-table td:nth-child(5) {
  width: 8%;
}

.dalas-reference-table th:nth-child(6),
.dalas-reference-table td:nth-child(6) {
  width: 18%;
}

.dalas-reference-table th:nth-child(7),
.dalas-reference-table td:nth-child(7) {
  width: 28%;
}

.dala-status {
  color: #69808f;
  font-size: 12px;
}

.dala-status .status-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  background: #b8c2cc;
  box-shadow: none;
}

.dala-status .status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 131, 79, 0.15);
}

.dala-status .status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 50, 66, 0.13);
}

.dala-reference-actions {
  flex-wrap: wrap;
  gap: 7px;
}

.dala-reference-action {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #b6c7d1;
  border-radius: 8px;
  background: #fff;
  color: #245c79;
  font-size: 11px;
  white-space: nowrap;
}

.dala-reference-action:hover,
.dala-reference-action:focus-visible {
  border-color: #1daac4;
  background: #edf9fb;
  color: #245c79;
}

.dala-reference-action.danger {
  color: #a33443;
}

.empty-cell {
  color: #69808f !important;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 600px) {
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Dashboard: preserve the existing light palette while making loading and
   urgency visible before the operational data arrives. */
.dala-album-grid.is-loading {
  align-items: stretch;
}

.dala-album-card-skeleton {
  min-height: 236px;
  pointer-events: none;
}

.dala-album-card-skeleton .skeleton-line,
.dala-album-card-skeleton .skeleton-badge,
.dala-album-card-skeleton .skeleton-progress,
.dala-album-card-skeleton .skeleton-button {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #edf3f6 25%, #f7fafb 50%, #edf3f6 75%);
  background-size: 200% 100%;
  animation: trace-skeleton-shimmer 1.35s ease-in-out infinite;
}

.dala-album-card-skeleton .skeleton-label {
  width: 56px;
  height: 10px;
  margin-bottom: 10px;
}

.dala-album-card-skeleton .skeleton-title {
  width: min(180px, 70%);
  height: 22px;
  margin-bottom: 8px;
}

.dala-album-card-skeleton .skeleton-code {
  width: 112px;
  height: 12px;
}

.dala-album-card-skeleton .skeleton-badge {
  width: 78px;
  height: 28px;
  border-radius: 999px;
}

.dala-album-card-skeleton .dala-album-info {
  gap: 14px;
}

.dala-album-card-skeleton .dala-album-info>div {
  min-width: 0;
}

.dala-album-card-skeleton .dala-album-info .skeleton-line:first-child {
  width: 58px;
  height: 10px;
  margin-bottom: 7px;
}

.dala-album-card-skeleton .skeleton-value {
  width: 76px;
  height: 16px;
}

.dala-album-card-skeleton .skeleton-progress {
  width: 100%;
  height: 8px;
  margin-top: 18px;
}

.dala-album-card-skeleton .skeleton-footer {
  width: 92px;
  height: 12px;
}

.dala-album-card-skeleton .skeleton-button {
  width: 142px;
  height: 34px;
}

@keyframes trace-skeleton-shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1200px) and (min-width: 761px) {

  .dalas-reference-table th,
  .dalas-reference-table td {
    padding-inline: 12px;
  }

  .dala-reference-action {
    padding-inline: 8px;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .dalas-reference-screen {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .dalas-reference-header {
    margin-bottom: 18px;
  }

  .dalas-reference-header h2 {
    font-size: 26px;
  }

  .dalas-reference-header .button.primary {
    min-height: 44px;
    font-size: inherit;
  }

  .dalas-reference-table-wrap {
    border-radius: 14px;
  }

  .dalas-reference-table tr {
    border-bottom-color: #e5edf1;
  }

  .dalas-reference-table td,
  .dalas-reference-table td code {
    color: #263b4b;
    font-size: 14px;
  }

  .dalas-reference-table td strong {
    color: #142332;
    font-size: 15px;
  }

  .dalas-reference-table td::before {
    color: #69808f;
  }

  .dala-reference-actions {
    flex-wrap: wrap;
  }

  .dala-reference-action {
    flex: 1 1 auto;
  }
}
