/* Base visual compacta da area administrativa SAFISA. */
:root {
  --bg-page: #edf3f9;
  --surface: #ffffff;
  --surface-soft: #f5f9fd;
  --surface-blue: #eef5fc;
  --primary-900: #0b2d56;
  --primary-800: #124276;
  --primary-700: #1d5c97;
  --primary-600: #2e74b5;
  --primary-100: #e7f1fb;
  --accent: #ef8b1d;
  --accent-dark: #cf6f09;
  --danger: #d64545;
  --danger-dark: #b93131;
  --success: #1e8b68;
  --text: #132538;
  --text-soft: #607286;
  --text-inverse: #f7fbff;
  --border: #d9e4ef;
  --menu-border: rgba(196, 211, 226, 0.9);
  --menu-surface: rgba(255, 255, 255, 0.92);
  --menu-surface-soft: rgba(243, 248, 252, 0.96);
  --menu-hover-start: #1d5c97;
  --menu-hover-end: #ef8b1d;
  --menu-glow: 0 18px 30px rgba(10, 35, 64, 0.16);
  --shadow-lg: 0 26px 42px rgba(10, 35, 64, 0.14);
  --shadow-md: 0 16px 30px rgba(10, 35, 64, 0.1);
  --shadow-sm: 0 10px 20px rgba(10, 35, 64, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 0.22s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(46, 116, 181, 0.16), transparent 22%),
    radial-gradient(circle at bottom right, rgba(239, 139, 29, 0.08), transparent 16%),
    linear-gradient(180deg, #f4f8fc 0%, #e7eef7 100%);
}

body.has-modal,
body.has-drawer {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.servo-sheet-page-body {
  background:
    radial-gradient(circle at top left, rgba(53, 129, 227, 0.08), transparent 24%),
    linear-gradient(180deg, #edf4fc 0%, #f7fbff 38%, #eef5fc 100%);
}

.servo-sheet-page {
  width: min(100%, 100vw);
  max-width: none;
  padding: 8px 10px 12px;
}

.servo-sheet-shell {
  width: 100%;
  max-width: none;
  padding: 10px 10px 8px;
  border-radius: 20px;
}

.servo-sheet-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.servo-sheet-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.servo-sheet-page-title {
  margin: 0;
  color: #163a67;
  font-size: clamp(1.55rem, 1.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.servo-sheet-page-subtitle,
.servo-sheet-panel-subtext {
  margin: 0;
  color: #5f789a;
  font-size: 0.96rem;
}

.servo-sheet-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.servo-sheet-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef4fb;
  color: #163a67;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.servo-sheet-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 62, 117, 0.12);
}

.servo-sheet-action-btn.is-neutral {
  border-color: #d9e5f2;
  background: #f8fbff;
}

.servo-sheet-action-btn.is-blue {
  background: #1f5d9f;
  color: #fff;
  box-shadow: 0 10px 20px rgba(31, 93, 159, 0.22);
}

.servo-sheet-action-btn.is-orange {
  background: #ff9d2f;
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 157, 47, 0.24);
}

.servo-sheet-action-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.servo-sheet-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
}

.servo-sheet-action-icon svg {
  width: 15px;
  height: 15px;
}

.servo-sheet-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.servo-sheet-scope-switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #eef4fb;
  border: 1px solid #dbe6f2;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.servo-sheet-scope-switch .segmented-btn {
  min-width: 110px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f789a;
  font-size: 0.86rem;
  font-weight: 800;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.servo-sheet-scope-switch .segmented-btn.is-active {
  background: #103d75;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(16, 61, 117, 0.18), 0 0 16px rgba(16, 61, 117, 0.28);
}

.servo-sheet-scope-switch .segmented-btn:not(.is-active):hover {
  color: #163a67;
}

.servo-sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0 14px;
  color: #647a98;
  font-size: 0.8rem;
}

.servo-sheet-legend strong {
  color: #163a67;
}

.servo-sheet-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #6f86a0;
  border-radius: 16px;
  background: #fbfdff;
}

.servo-sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #163a67;
}

.servo-sheet-table th,
.servo-sheet-table td {
  border-right: 1px solid #8599b1;
  border-bottom: 1px solid #667d99;
  padding: 0;
}

.servo-sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #c9d8e8;
  border-bottom-color: #526b88;
}

.servo-sheet-model-col,
.servo-sheet-model-cell {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #eaf1f8;
}

.servo-sheet-total-col,
  .servo-sheet-total-cell {
    width: 48px;
    min-width: 48px;
    text-align: center;
    font-weight: 800;
    color: #06aa84;
  }

.servo-sheet-total-col {
  background: #f4f9ff;
}

.servo-sheet-head-accent {
  color: #00b489 !important;
}

.servo-sheet-head-warn {
  color: #ffa22e !important;
}

.servo-sheet-model-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: center;
  min-height: 72px;
  padding: 8px 8px;
  color: #6f84a3;
}

.servo-sheet-model-head strong {
  color: #6f84a3;
  font-size: 0.86rem;
}

.chat-widget-shell {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
}

.chat-widget-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: var(--text-inverse);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.chat-widget-shell.is-open .chat-widget-trigger {
  display: none;
}

.chat-widget-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 34px rgba(11, 45, 86, 0.24);
}

.chat-widget-trigger:focus-visible,
.chat-widget-back:focus-visible,
.chat-widget-close:focus-visible,
.chat-widget-send:focus-visible,
.chat-widget-user-card:focus-visible,
.chat-widget-input:focus-visible {
  outline: 2px solid rgba(46, 116, 181, 0.38);
  outline-offset: 2px;
}

.chat-widget-trigger-icon,
.chat-widget-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-trigger-icon svg,
.chat-widget-status-icon svg,
.chat-widget-send svg {
  width: 20px;
  height: 20px;
}

.chat-widget-trigger-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(207, 111, 9, 0.3);
}

.chat-widget-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(380px, calc(100vw - 20px));
  height: min(680px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(220, 223, 228, 0.94);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 26px 44px rgba(17, 34, 62, 0.18);
}

.chat-widget-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(221, 224, 229, 0.96);
  background: #fff;
}

.chat-widget-header-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.chat-widget-header-title {
  font-size: 0.9rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.08em;
  color: #202020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget-header-subtitle {
  color: #8a7b69;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget-back,
.chat-widget-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #262626;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.chat-widget-back:hover,
.chat-widget-close:hover {
  background: rgba(19, 37, 56, 0.06);
}

.chat-widget-back svg {
  width: 18px;
  height: 18px;
}

.chat-widget-status {
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.chat-widget-status.is-visible {
  display: block;
}

.chat-widget-status.is-error {
  background: rgba(214, 69, 69, 0.12);
  color: var(--danger-dark);
}

.chat-widget-status.is-success {
  background: rgba(30, 139, 104, 0.12);
  color: var(--success);
}

.chat-widget-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.chat-widget-screen {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: auto;
}

.chat-widget-screen-list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 248, 246, 0.96));
}

.chat-widget-screen-thread {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-widget-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 8px;
}

.chat-widget-section-label {
  color: #9b7047;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.chat-widget-screen-meta {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.chat-widget-user-list,
.chat-widget-message-list {
  min-height: 0;
  overflow-y: auto;
}

.chat-widget-user-list {
  padding: 0 12px 14px;
}

.chat-widget-user-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(221, 224, 229, 0.95);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(18, 32, 55, 0.08);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.chat-widget-user-card:hover,
.chat-widget-user-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(46, 116, 181, 0.22);
  box-shadow: 0 10px 24px rgba(18, 32, 55, 0.12);
}

.chat-widget-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(230, 229, 228, 0.95), rgba(246, 243, 240, 0.95));
  color: #263549;
  font-size: 0.8rem;
  font-weight: 800;
}

.chat-widget-user-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-widget-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-widget-user-name-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-widget-user-top strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  font-weight: 800;
  font-style: italic;
  color: #121212;
  letter-spacing: 0.02em;
}

.chat-widget-presence {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8a8f96;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.chat-widget-presence::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #b6bcc4;
}

.chat-widget-presence.is-online {
  color: #16815f;
}

.chat-widget-presence.is-online::before {
  background: #20b486;
  box-shadow: 0 0 0 3px rgba(32, 180, 134, 0.13);
}

.chat-widget-presence.is-offline {
  color: #8a8f96;
}

.chat-widget-user-top time,
.chat-widget-user-subline,
.chat-widget-user-preview {
  color: #7e7f82;
  font-size: 0.73rem;
}

.chat-widget-user-subline {
  text-transform: lowercase;
}

.chat-widget-user-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget-user-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.chat-widget-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
  background: linear-gradient(180deg, #fff 0%, #fdfcfb 100%);
}

.chat-widget-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #c7c7c7;
  font-size: 0.84rem;
  text-align: center;
}

.chat-widget-empty strong {
  color: #d0cdc9;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.chat-widget-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #cfcac4;
}

.chat-widget-empty-icon svg {
  width: 34px;
  height: 34px;
}

.chat-widget-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}

.chat-widget-date-separator span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(19, 37, 56, 0.08);
  color: #7f8a95;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-widget-message {
  display: flex;
}

.chat-widget-message.is-mine {
  justify-content: flex-end;
}

.chat-widget-message.is-theirs {
  justify-content: flex-start;
}

.chat-widget-message-bubble {
  max-width: min(82%, 258px);
  padding: 11px 12px 10px;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.chat-widget-message.is-theirs .chat-widget-message-bubble {
  border-top-left-radius: 8px;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(225, 228, 232, 0.95);
  box-shadow: 0 6px 16px rgba(18, 32, 55, 0.08);
}

.chat-widget-message.is-mine .chat-widget-message-bubble {
  border-top-right-radius: 8px;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 92, 151, 0.28);
}

.chat-widget-message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-widget-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.72rem;
}

.chat-widget-message.is-theirs .chat-widget-message-meta {
  color: rgba(19, 37, 56, 0.58);
}

.chat-widget-message.is-mine .chat-widget-message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.chat-widget-status-icon {
  width: 14px;
  height: 14px;
}

.chat-widget-status-icon svg {
  width: 14px;
  height: 14px;
}

.chat-widget-composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: end;
  margin-top: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(221, 224, 229, 0.96);
  background: #fff;
}

.chat-widget-input {
  width: 100%;
  min-height: 48px;
  max-height: 110px;
  padding: 13px 16px;
  border: 1px solid rgba(209, 213, 219, 0.98);
  border-radius: 14px;
  resize: vertical;
  background: #fff;
  color: var(--text);
  font-size: 0.92rem;
}

.chat-widget-input:disabled {
  background: #f6f5f4;
  cursor: default;
}

.chat-widget-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(207, 111, 9, 0.2);
}

.chat-widget-send:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

@media (max-width: 880px) {
  .chat-widget-panel {
    width: min(390px, calc(100vw - 18px));
    height: min(680px, calc(100vh - 36px));
  }
}

@media (max-width: 560px) {
  .chat-widget-shell {
    right: 10px;
    bottom: 10px;
  }

  .chat-widget-trigger {
    width: 54px;
    height: 54px;
  }

  .chat-widget-panel {
    right: -2px;
    bottom: 0;
    width: calc(100vw - 20px);
    height: min(680px, calc(100vh - 20px));
    border-radius: 18px;
  }

  .chat-widget-header,
  .chat-widget-composer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-widget-screen-head,
  .chat-widget-message-list {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-widget-user-list {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.servo-sheet-total-col.servo-sheet-head-accent {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.servo-sheet-vertical-col {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  text-align: center;
  vertical-align: bottom;
}

.servo-sheet-vertical-col > span,
.servo-sheet-vertical-col {
  color: #6f84a3;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.servo-sheet-vertical-col > span {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 116px;
  padding: 4px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
}

.servo-sheet-resource-col {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 116px;
  text-align: center;
  vertical-align: bottom;
  color: #6f84a3;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.servo-sheet-resource-col > span {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 106px;
  padding: 4px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  text-transform: uppercase;
}

.servo-sheet-divider-left {
  border-left: 2px solid #405a78 !important;
}

.servo-sheet-row:nth-child(odd) td,
.servo-sheet-row:nth-child(odd) th {
  background: #f4f8fc;
}

.servo-sheet-row:nth-child(even) td,
.servo-sheet-row:nth-child(even) th {
  background: #d6e2ee;
}

.servo-sheet-row:hover td,
.servo-sheet-row:hover th {
  background: #bdcede;
}

.servo-sheet-model-cell {
  padding: 6px 6px 6px 10px !important;
}

.servo-sheet-model-title {
  color: #173966;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.servo-sheet-body-marker {
  color: #ff9d2f;
  font-size: 0.95em;
  font-weight: 900;
  line-height: 1;
}

.servo-sheet-cell,
  .servo-sheet-total-cell {
    padding: 6px 6px !important;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 800;
  }

.servo-sheet-total-cell {
  font-size: 0.86rem;
  background: #f4f8fc;
}

.servo-sheet-total-row th,
.servo-sheet-total-row td {
  background: #c9d8e8;
  border-top: 1px solid #526b88;
  font-weight: 800;
}

.servo-sheet-total-inline {
  color: #173966;
}

.servo-sheet-total-muted {
  color: #8ea0bb;
}

.servo-sheet-cell.is-zero {
  color: #8ea0bb;
}

.servo-sheet-cell.is-valued {
  color: #173966;
}

.servo-sheet-cell.is-dash {
  color: #8ea0bb;
}

.servo-sheet-signed-cell.is-negative {
  color: #e94d64;
}

.servo-sheet-signed-cell.is-positive {
  color: #ffa22e;
}

.servo-sheet-signed-cell.is-dash {
  color: #8ea0bb;
}

@media (max-width: 1100px) {
  .servo-sheet-page {
    padding: 14px 12px 18px;
  }

  .servo-sheet-toolbar,
  .servo-sheet-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .servo-sheet-model-col,
  .servo-sheet-model-cell {
    width: 206px;
    min-width: 206px;
    max-width: 206px;
  }

  .servo-sheet-model-title {
    font-size: 0.72rem;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }

  body,
  .servo-sheet-page-body {
    background: #fff !important;
  }

  .servo-sheet-page {
    padding: 0 !important;
  }

  .servo-sheet-shell {
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .servo-sheet-toolbar,
  .servo-sheet-scope-switch,
  .message {
    display: none !important;
  }

  .servo-sheet-wrapper {
    overflow: visible !important;
    border: 1px solid #d8e1ee !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .servo-sheet-table {
    width: 100% !important;
    min-width: 100% !important;
    color: #102b4d !important;
  }

  .servo-sheet-table thead th {
    position: static !important;
  }

  .sticky-col {
    position: static !important;
    background: #fff !important;
  }

  .servo-sheet-table th,
  .servo-sheet-table td {
    border-color: #000 !important;
  }

  .servo-sheet-model-head {
    min-height: 70px;
    padding: 8px 10px;
  }

  .servo-sheet-model-head strong {
    font-size: 0.95rem;
  }

  .servo-sheet-vertical-col {
    width: 22px;
    min-width: 22px;
    max-width: 22px;
  }

  .servo-sheet-vertical-col > span {
    min-height: 88px;
    font-size: 0.52rem;
  }

  .servo-sheet-resource-col {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 88px;
    font-size: 0.58rem;
  }

  .servo-sheet-resource-col > span {
    min-height: 82px;
    padding: 4px 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .servo-sheet-model-cell {
    padding: 5px 6px 5px 8px !important;
  }

  .servo-sheet-model-title {
    font-size: 0.68rem;
  }

  .servo-sheet-cell,
  .servo-sheet-total-cell {
    padding: 4px 4px !important;
    font-size: 0.68rem;
  }

  .servo-sheet-total-row th,
  .servo-sheet-total-row td {
    background: #f1f6fd !important;
  }
}

/* Menu recolhivel da area administrativa. */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 24, 45, 0.42);
  backdrop-filter: blur(4px);
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(300px, calc(100vw - 24px));
  height: 100vh;
  padding: 24px 18px;
  color: var(--text-inverse);
  background:
    linear-gradient(180deg, rgba(8, 24, 45, 0.98), rgba(11, 33, 62, 0.98)),
    linear-gradient(140deg, rgba(239, 139, 29, 0.15), transparent 30%);
  box-shadow: var(--shadow-lg);
  transform: translateX(-106%);
  transition: transform var(--transition);
}

.app-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-stack {
  display: flex;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), #ffab45);
  box-shadow: 0 14px 24px rgba(239, 139, 29, 0.24);
}

.brand-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  margin: 4px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-copy {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
}

.drawer-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  margin-right: -6px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
  background-size: 180% 180%;
  background-position: 0% 50%;
  transition:
    color var(--transition),
    background var(--transition),
    background-position 0.34s ease,
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 4px;
  height: 0;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.68));
  transform: translateY(-50%);
  transition: height var(--transition), opacity var(--transition);
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(29, 92, 151, 0.34), rgba(239, 139, 29, 0.2));
  background-position: 100% 50%;
  box-shadow: 0 16px 26px rgba(3, 13, 27, 0.22);
  transform: translateX(4px);
}

.nav-link:hover::before,
.nav-link.is-active::before {
  height: 22px;
  opacity: 1;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.is-active .nav-icon {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  transform: scale(1.04);
}

.drawer-footer {
  flex-shrink: 0;
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(18, 66, 118, 0.48), rgba(255, 255, 255, 0.04));
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
}

.drawer-footer strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
}

.workspace.etiqueta-page {
  overflow: visible;
}

.etiqueta-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.98));
  box-shadow: var(--shadow-sm);
}

.etiqueta-header-simple h1 {
  margin: 0;
  font-size: 1.95rem;
}

.etiqueta-header-simple p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.etiqueta-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.etiqueta-board {
  display: grid;
  grid-template-columns: minmax(620px, 1.15fr) minmax(430px, 0.92fr);
  gap: 20px;
  align-items: start;
}

.etiqueta-column {
  display: grid;
  gap: 20px;
}

.etiqueta-table-wrapper {
  max-height: 360px;
}

.etiqueta-row-selected {
  background: rgba(46, 116, 181, 0.08);
}

.composicao-toolbar {
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
}

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

.composicao-search-field {
  min-width: 0;
}

.composicao-modal .selected-tags {
  min-height: 62px;
}

.etiqueta-auto-note {
  margin: 0;
}

.etiqueta-auto-fields input[readonly] {
  color: var(--text-soft);
  background: linear-gradient(180deg, #f5f8fc, #edf3f9);
  cursor: not-allowed;
}

.etiqueta-layout-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.etiqueta-editor-details {
  background: linear-gradient(180deg, #fcfdff, #f6faff);
}

.etiqueta-layout-details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--primary-900);
}

.etiqueta-layout-grid {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.etiqueta-adjust-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.etiqueta-adjust-card.is-active {
  border-color: rgba(239, 139, 29, 0.8);
  box-shadow: 0 0 0 3px rgba(239, 139, 29, 0.16);
  background: linear-gradient(180deg, #fffdf8, #ffffff);
}

.etiqueta-adjust-card.is-hidden {
  opacity: 0.82;
}

.etiqueta-adjust-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.etiqueta-adjust-head h3 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--primary-900);
}

.etiqueta-adjust-title-block {
  display: grid;
  gap: 5px;
}

.etiqueta-adjust-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(18, 66, 118, 0.08);
}

.etiqueta-adjust-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.icon-btn.small {
  min-width: 29px;
  height: 29px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.etiqueta-toggle-btn {
  padding: 7px 11px;
  font-size: 0.76rem;
}

.etiqueta-toggle-btn.is-hidden {
  background: rgba(239, 139, 29, 0.12);
  color: var(--accent-dark);
}

.etiqueta-adjust-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.etiqueta-mini-field {
  display: grid;
  gap: 6px;
}

.etiqueta-mini-field span {
  color: var(--text-soft);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.etiqueta-mini-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.84rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.etiqueta-mini-field input:focus {
  outline: none;
  border-color: rgba(239, 139, 29, 0.72);
  box-shadow: 0 0 0 3px rgba(239, 139, 29, 0.12);
}

.etiqueta-compact-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.etiqueta-preset-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfdff, #f5f9fd);
}

.etiqueta-preset-head {
  display: grid;
  gap: 4px;
}

.etiqueta-preset-head strong {
  color: var(--primary-900);
  font-size: 0.9rem;
}

.etiqueta-preset-head span {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.etiqueta-preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.etiqueta-preset-actions .btn {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  box-shadow: none;
}

.etiqueta-compact-actions .btn {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.1;
  box-shadow: none;
}

.etiqueta-compact-actions .btn.btn-primary {
  box-shadow: 0 10px 18px rgba(239, 139, 29, 0.18);
}

.etiqueta-preview-card .card-top {
  margin-bottom: 12px;
}

.etiqueta-preview-card {
  align-self: start;
}

.etiqueta-preview-card.etiqueta-preview-floating {
  z-index: 20;
}

.etiqueta-preview-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 251, 255, 0.96)),
    radial-gradient(circle at top right, rgba(46, 116, 181, 0.08), transparent 30%);
}

.etiqueta-preview-meta {
  align-self: flex-end;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.etiqueta-preview {
  position: relative;
  width: min(100%, 470px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #cfd9e4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(10, 35, 64, 0.08);
}

.etiqueta-preview-logo-area {
  position: absolute;
  inset: 0 0 auto 0;
  height: 68px;
  background: linear-gradient(180deg, #f8fbff, #eef5fc);
  border-bottom: 1px solid #dfe8f1;
}

.etiqueta-preview-logo {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #101820;
}

.etiqueta-preview-title,
.etiqueta-preview-label,
.etiqueta-preview-application,
.etiqueta-preview-barcode-text,
.etiqueta-preview-serial,
.etiqueta-preview-datetime {
  position: absolute;
  color: #141414;
  line-height: 1.15;
}

.etiqueta-preview-title {
  font-weight: 800;
  white-space: nowrap;
}

.etiqueta-preview-label {
  font-weight: 500;
}

.etiqueta-preview-application,
.etiqueta-preview-barcode-text,
.etiqueta-preview-datetime {
  max-width: 82%;
  font-family: "Courier New", monospace;
}

.etiqueta-preview-serial {
  font-weight: 700;
  white-space: nowrap;
}

.etiqueta-preview-divider {
  position: absolute;
  background: #232323;
}

.etiqueta-preview-barcode {
  position: absolute;
  display: flex;
  background:
    repeating-linear-gradient(
      90deg,
      #111 0,
      #111 var(--barcode-module, 4px),
      transparent var(--barcode-module, 4px),
      transparent calc(var(--barcode-module, 4px) + 2px)
    );
  background-size: 100% calc(100% - 20px);
  background-repeat: no-repeat;
  background-position: top center;
}

.etiqueta-preview-barcode-text {
  white-space: nowrap;
  letter-spacing: 0.08em;
}

.etiqueta-preview-element-active {
  outline: 2px solid rgba(239, 139, 29, 0.92);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(239, 139, 29, 0.14);
}

.etiqueta-preview-divider.etiqueta-preview-element-active,
.etiqueta-preview-barcode.etiqueta-preview-element-active {
  outline-offset: 2px;
}

.etiqueta-preview-divider.etiqueta-preview-element-active {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(239, 139, 29, 0.18);
}

.etiqueta-preview-barcode.etiqueta-preview-element-active {
  box-shadow: 0 0 0 3px rgba(239, 139, 29, 0.2);
}

.etiqueta-zpl-output {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  background: #f7fbff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.etiqueta-labelary-note {
  margin-top: 14px;
  margin-bottom: 0;
}

.pedido-detalhe-print-actions {
  justify-content: flex-end;
  padding-top: 12px;
}

.pedido-kits-switch {
  justify-content: flex-start;
  margin-top: 12px;
}

.pedido-kit-quantidade-input {
  width: 92px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(160, 182, 206, 0.78);
  border-radius: 10px;
  background: #ffffff;
  color: var(--primary-900);
  font: inherit;
}

.pedido-kit-quantidade-input:disabled {
  color: var(--text-soft);
  background: rgba(242, 246, 251, 0.92);
}

.pedido-print-diagnostic {
  margin-bottom: 16px;
  border: 1px solid rgba(19, 81, 138, 0.14);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.92);
  overflow: hidden;
}

.pedido-print-diagnostic[open] {
  box-shadow: var(--shadow-sm);
}

.pedido-print-diagnostic-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
}

.pedido-print-diagnostic-summary::-webkit-details-marker {
  display: none;
}

.pedido-print-diagnostic-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pedido-print-diagnostic-body {
  padding: 0 14px 14px;
}

.pedido-print-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pedido-print-diagnostic-item {
  border: 1px solid rgba(19, 81, 138, 0.1);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px 12px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pedido-print-diagnostic-item span,
.pedido-print-diagnostic-label {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pedido-print-diagnostic-item strong {
  color: var(--primary-900);
  font-size: 0.95rem;
}

.pedido-print-diagnostic-printers,
.pedido-print-diagnostic-error {
  margin-top: 12px;
}

.etiqueta-print-diagnostic-card {
  margin-bottom: 18px;
}

.etiqueta-print-diagnostic-body {
  display: grid;
  gap: 16px;
}

.etiqueta-print-diagnostic-summary {
  padding: 0;
}

.etiqueta-print-diagnostic-selector {
  display: grid;
  gap: 10px;
}

.etiqueta-print-diagnostic-selector .field {
  max-width: 420px;
}

.pedido-print-diagnostic-printers .selected-tags {
  margin-top: 8px;
}

.pedido-print-diagnostic-error .search-helper {
  margin-top: 8px;
}

.pedido-print-btn.is-printing,
#pedido-btn-imprimir-caixas.is-printing {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .etiqueta-board {
    grid-template-columns: 1fr;
  }

  .etiqueta-header-simple {
    flex-direction: column;
    align-items: flex-start;
  }

  .etiqueta-preview-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .etiqueta-preview {
    width: min(100%, 420px);
  }
}

/* Topo compacto com maior area util central. */
.workspace {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.sector-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.sector-menu {
  display: flex;
  justify-content: flex-end;
  position: static;
}

.sector-menu-card {
  position: relative;
  width: auto;
  max-width: 100%;
  padding: 0;
  overflow: visible;
  border-radius: 999px;
  box-shadow: none;
  background: transparent;
}

.sector-menu-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: fit-content;
  margin-left: auto;
  padding: 8px 10px 8px 12px;
  overflow: hidden;
  border: 1px solid var(--menu-border);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, var(--menu-surface), var(--menu-surface-soft));
  background-size: 180% 180%;
  background-position: 0% 50%;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background-position 0.34s ease;
}

.sector-menu-summary::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(29, 92, 151, 0.08), rgba(239, 139, 29, 0.1));
  pointer-events: none;
}

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

.sector-menu-summary:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 164, 191, 0.98);
  background-position: 100% 50%;
  box-shadow: var(--menu-glow);
}

.sector-menu-card[open] .sector-menu-summary {
  border-color: rgba(46, 116, 181, 0.32);
  box-shadow: 0 20px 32px rgba(10, 35, 64, 0.14);
}

.sector-menu-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sector-menu-heading strong {
  color: var(--primary-900);
  font-size: 0.9rem;
  font-weight: 700;
}

.sector-menu-trigger {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--primary-800);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  border: 1px solid rgba(18, 66, 118, 0.08);
  background: linear-gradient(135deg, rgba(18, 66, 118, 0.08), rgba(18, 66, 118, 0.14));
  background-size: 180% 180%;
  background-position: 0% 50%;
  transition: background var(--transition), background-position 0.34s ease, border-color var(--transition), color var(--transition), transform var(--transition);
}

.sector-menu-summary:hover .sector-menu-trigger {
  border-color: rgba(29, 92, 151, 0.14);
  background: linear-gradient(135deg, rgba(29, 92, 151, 0.14), rgba(239, 139, 29, 0.16));
  background-position: 100% 50%;
}

.sector-menu-card[open] .sector-menu-trigger {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--menu-hover-start), var(--menu-hover-end));
  transform: scale(1.04);
}

.sector-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--menu-border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 253, 0.98));
  box-shadow: 0 24px 40px rgba(10, 35, 64, 0.16);
}

.sector-menu-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 2px 6px;
}

.sector-menu-panel-head strong {
  color: var(--primary-900);
  font-size: 0.98rem;
}

.sector-menu-panel-head small {
  color: var(--text-soft);
  font-size: 0.83rem;
}

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

.sector-menu-list .btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--menu-border);
  border-radius: 18px;
  color: var(--primary-900);
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 251, 0.95));
  background-size: 180% 180%;
  background-position: 0% 50%;
  box-shadow: 0 10px 18px rgba(10, 35, 64, 0.06);
  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition),
    background-position 0.34s ease,
    box-shadow var(--transition),
    transform var(--transition);
}

.sector-menu-list .btn::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, var(--menu-hover-start), var(--menu-hover-end));
  transition: opacity var(--transition);
}

.sector-menu-list .btn > * {
  position: relative;
  z-index: 1;
}

.sector-menu-list .btn-primary,
.sector-menu-list .btn-secondary,
.sector-menu-list .btn-neutral,
.sector-menu-list .btn-ghost {
  color: var(--primary-900);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 251, 0.95));
  background-size: 180% 180%;
  background-position: 0% 50%;
  box-shadow: 0 10px 18px rgba(10, 35, 64, 0.06);
}

.sector-menu-list .btn:hover,
.sector-menu-list .btn:focus-visible {
  color: #ffffff;
  border-color: transparent;
  background-position: 100% 50%;
  box-shadow: var(--menu-glow);
  transform: translateX(4px) translateY(-1px);
}

.sector-menu-list .btn:hover::before,
.sector-menu-list .btn:focus-visible::before {
  opacity: 1;
}

.btn-label {
  flex: 1;
  text-align: left;
}

.btn-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 255, 255, 0.18);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.btn-neutral .btn-badge,
.btn-ghost .btn-badge {
  border-color: rgba(18, 66, 118, 0.12);
  color: var(--primary-900);
  background: rgba(18, 66, 118, 0.1);
}

.sector-menu-list .btn:hover .btn-badge,
.sector-menu-list .btn:focus-visible .btn-badge {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.sector-content {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 253, 0.9)),
    linear-gradient(135deg, rgba(29, 92, 151, 0.1), rgba(239, 139, 29, 0.06));
  box-shadow: var(--shadow-md);
}

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

.topbar > .topbar-actions {
  margin-left: auto;
}

.topbar-actions-session {
  flex-wrap: nowrap;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-copy p {
  margin: 0;
}

.page-kicker {
  color: var(--primary-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin-top: 6px;
  font-size: clamp(1.8rem, 2.5vw, 2.8rem);
  line-height: 1.04;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}

.session-indicator {
  order: 100;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(169, 215, 184, 0.72);
  border-radius: 999px;
  color: var(--primary-900);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.session-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2cb86f;
  box-shadow: 0 0 0 4px rgba(44, 184, 111, 0.14);
  flex-shrink: 0;
}

.session-indicator-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.session-indicator-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.session-indicator-name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.session-indicator-role {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.2;
}

.notification-widget {
  order: 99;
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.notification-widget-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(197, 207, 219, 0.9);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-900);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 34, 62, 0.08);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.notification-widget-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 116, 181, 0.3);
  box-shadow: 0 12px 24px rgba(17, 34, 62, 0.12);
}

.notification-widget-trigger:focus-visible,
.notification-widget-clear:focus-visible,
.notification-widget-item:focus-visible {
  outline: 2px solid rgba(46, 116, 181, 0.38);
  outline-offset: 2px;
}

.notification-widget-icon,
.notification-widget-icon svg {
  width: 19px;
  height: 19px;
}

.notification-widget-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(207, 111, 9, 0.3);
}

.notification-widget-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(220, 223, 228, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 40px rgba(17, 34, 62, 0.17);
}

.notification-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(221, 224, 229, 0.96);
}

.notification-widget-header strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

.notification-widget-header small {
  color: var(--text-soft);
  font-size: 0.74rem;
}

.notification-widget-clear {
  border: 0;
  background: transparent;
  color: var(--primary-700);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.notification-widget-clear:disabled {
  color: #a2a9b2;
  cursor: default;
}

.notification-widget-list {
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.notification-widget-empty {
  padding: 28px 16px;
  color: var(--text-soft);
  font-size: 0.86rem;
  text-align: center;
}

.notification-widget-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-widget-item:hover {
  background: rgba(19, 37, 56, 0.05);
}

.notification-widget-item.is-unread {
  background: rgba(46, 116, 181, 0.08);
}

.notification-widget-item-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #c4cad2;
}

.notification-widget-item.is-unread .notification-widget-item-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 111, 9, 0.13);
}

.notification-widget-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notification-widget-item-copy strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.notification-widget-item-copy span {
  color: #5e6b7b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.notification-widget-item-copy time {
  color: #98a1ad;
  font-size: 0.7rem;
  font-weight: 700;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
  color: var(--primary-900);
}

.summary-card span {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-card small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.summary-card .summary-code-list {
  font-size: 0.76rem;
  line-height: 1.35;
}

.summary-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.summary-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-card .summary-list-row span {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.summary-card .summary-list-row strong {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.content-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(217, 228, 239, 0.94);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.content-card.compact {
  padding: 18px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-top h2,
.card-top h3 {
  margin: 0;
  font-size: 1.24rem;
}

.card-top p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--primary-800);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--primary-100);
}

.section-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.toolbar-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
}

.toolbar-form.stock-toolbar {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

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

.field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px rgba(46, 116, 181, 0.14);
  transform: translateY(-1px);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field textarea.textarea-compact {
  min-height: 88px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 10px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(231, 241, 251, 0.72);
}

.mode-switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--primary-900);
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.mode-switch-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  box-shadow: var(--shadow-sm);
}

.mode-panel {
  padding: 18px;
  border: 1px solid rgba(190, 208, 225, 0.72);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(244, 249, 253, 0.92), rgba(255, 255, 255, 0.96));
}

.helper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.helper-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(190, 208, 225, 0.7);
  background: rgba(255, 255, 255, 0.88);
}

.helper-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helper-card strong {
  display: block;
  color: var(--primary-900);
  line-height: 1.45;
}

.helper-card p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.helper-card-full {
  grid-column: 1 / -1;
}

.reference-table {
  display: grid;
  gap: 6px;
  color: var(--primary-900);
  font-size: 0.88rem;
  font-weight: 700;
}

.supplier-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed rgba(18, 66, 118, 0.24);
  border-radius: var(--radius-md);
  background: rgba(245, 249, 253, 0.88);
}

.selected-tags.empty {
  color: var(--text-soft);
  font-weight: 600;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--primary-900);
  font-weight: 700;
  background: rgba(231, 241, 251, 0.94);
}

.selected-tag button {
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  background: var(--primary-700);
}

.selected-tag .tag-inline-action,
.selected-tag .tag-inline-action.is-neutral {
  width: auto;
  height: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-900);
  font-size: 0.78rem;
  font-weight: 700;
}

.pedido-relatorio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0;
  padding: 5px;
  border: 1px solid #dbe6f2;
  border-radius: 999px;
  background: #eef4fb;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.pedido-relatorio-tab {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #5f789a;
  background: transparent;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pedido-relatorio-tab.is-active {
  color: #ffffff;
  background: #103d75;
  box-shadow: 0 0 0 1px rgba(16, 61, 117, 0.18), 0 0 16px rgba(16, 61, 117, 0.24);
}

.pedido-relatorio-tab:not(.is-active):hover {
  color: #163a67;
}

.pedido-relatorio-panel {
  display: none;
}

.pedido-relatorio-panel.is-active {
  display: block;
}

.pedido-relatorio-table-wrapper {
  max-height: none !important;
  overflow-x: auto;
  overflow-y: visible;
}

.pedido-relatorio-table-wrapper table {
  min-width: 760px;
}

.tag-inline-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 139, 104, 0.12);
  color: #156a50;
  font-size: 0.78rem;
  font-weight: 700;
}

.compact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.checkbox-field {
  justify-content: flex-end;
}

.checkbox-field input {
  width: 22px;
  height: 22px;
  margin-top: 6px;
}

.conversion-card {
  min-height: 100%;
}

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

.view-card {
  padding: 16px;
  border: 1px solid rgba(190, 208, 225, 0.7);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
}

.view-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-card strong {
  display: block;
  color: var(--primary-900);
  line-height: 1.45;
}

.form-hint {
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

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

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.message.success {
  color: var(--success);
  background: rgba(30, 139, 104, 0.11);
  border: 1px solid rgba(30, 139, 104, 0.18);
}

.message.error {
  color: var(--danger);
  background: rgba(214, 69, 69, 0.11);
  border: 1px solid rgba(214, 69, 69, 0.18);
}

.message.warning {
  color: #8a5a09;
  background: rgba(239, 139, 29, 0.12);
  border: 1px solid rgba(239, 139, 29, 0.22);
}

/* Botoes compactos da interface. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background var(--transition);
}

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

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #ffad42);
  box-shadow: 0 14px 24px rgba(239, 139, 29, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dark), #e88e1f);
}

.btn-secondary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  box-shadow: 0 12px 22px rgba(29, 92, 151, 0.22);
}

.btn-neutral {
  color: var(--primary-900);
  background: rgba(18, 66, 118, 0.08);
}

.btn-success {
  color: #ffffff;
  background: linear-gradient(135deg, var(--success), #28a37a);
  box-shadow: 0 12px 22px rgba(30, 139, 104, 0.24);
}

.btn-success:hover {
  background: linear-gradient(135deg, #177a5b, #208c69);
}

.btn-danger {
  color: #ffffff;
  background: linear-gradient(135deg, var(--danger), #e85d5d);
  box-shadow: 0 12px 20px rgba(214, 69, 69, 0.18);
}

.btn-ghost {
  color: var(--primary-800);
  background: rgba(46, 116, 181, 0.08);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.table-print-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: var(--primary-900);
  background: rgba(18, 66, 118, 0.08);
  transition: background var(--transition), transform var(--transition);
}

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

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(18, 66, 118, 0.14);
}

.icon-btn.icon-btn-primary {
  color: var(--primary-800);
  background: rgba(46, 116, 181, 0.12);
}

.icon-btn.icon-btn-primary:hover {
  background: rgba(46, 116, 181, 0.2);
}

.icon-btn.icon-btn-success {
  color: #166e53;
  background: rgba(30, 139, 104, 0.15);
}

.icon-btn.icon-btn-success:hover {
  background: rgba(30, 139, 104, 0.24);
}

.icon-btn.icon-btn-danger {
  color: var(--danger-dark);
  background: rgba(214, 69, 69, 0.14);
}

.icon-btn.icon-btn-danger:hover {
  background: rgba(214, 69, 69, 0.22);
}

.icon-btn-menu {
  flex-direction: column;
  gap: 4px;
}

.icon-btn-menu span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

/* Tabelas compactas, sem excesso de colunas. */
.table-wrapper {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 254, 0.98));
}

.modal-dialog .table-wrapper {
  max-height: min(430px, 52vh);
}

.content-card > .table-wrapper {
  max-height: min(620px, 66vh);
}

.table-wrapper-compact {
  border-radius: 14px;
}

.table-wrapper-compact table {
  min-width: 980px;
}

.production-orders-table table {
  min-width: 1380px;
  table-layout: fixed;
}

.production-orders-table {
  contain: inline-size;
}

.production-orders-table th,
.production-orders-table td {
  padding: 12px 14px;
}

.production-orders-table th {
  white-space: nowrap;
}

.production-orders-table td:not(:nth-child(12)) {
  overflow: hidden;
}

.production-orders-table .status-chip {
  max-width: 100%;
  padding-inline: 10px;
  white-space: nowrap;
}

.production-orders-table th:nth-child(1),
.production-orders-table td:nth-child(1) {
  width: 118px;
}

.production-orders-table th:nth-child(2),
.production-orders-table td:nth-child(2) {
  width: 150px;
}

.production-orders-table th:nth-child(3),
.production-orders-table td:nth-child(3) {
  width: 210px;
}

.production-orders-table th:nth-child(4),
.production-orders-table td:nth-child(4),
.production-orders-table th:nth-child(5),
.production-orders-table td:nth-child(5),
.production-orders-table th:nth-child(6),
.production-orders-table td:nth-child(6),
.production-orders-table th:nth-child(7),
.production-orders-table td:nth-child(7),
.production-orders-table th:nth-child(8),
.production-orders-table td:nth-child(8) {
  width: 92px;
}

.production-orders-table th:nth-child(9),
.production-orders-table td:nth-child(9) {
  width: 170px;
}

.production-orders-table th:nth-child(10),
.production-orders-table td:nth-child(10) {
  width: 106px;
}

.production-orders-table th:nth-child(11),
.production-orders-table td:nth-child(11) {
  width: 138px;
}

.production-orders-table th:nth-child(12),
.production-orders-table td:nth-child(12) {
  position: sticky;
  right: 0;
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  text-align: right;
}

.production-orders-table th:nth-child(12) {
  z-index: 6;
  background: linear-gradient(180deg, #edf4fb, #e4eef8);
}

.production-orders-table td:nth-child(12) {
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -12px 0 18px rgba(10, 35, 64, 0.06);
}

.production-orders-table tbody tr:nth-child(even) td:nth-child(12) {
  background: rgba(238, 245, 252, 0.98);
}

.production-orders-table tbody tr:hover td:nth-child(12) {
  background: #e8f2fb;
}

.production-orders-table td:nth-child(12):has(.row-menu[open]) {
  z-index: 30;
}

.production-orders-table .table-description {
  overflow-wrap: anywhere;
}

.special-stock-table table {
  min-width: 1060px;
  table-layout: fixed;
}

.special-stock-table th:nth-child(1),
.special-stock-table td:nth-child(1) {
  width: 150px;
}

.special-stock-table th:nth-child(2),
.special-stock-table td:nth-child(2) {
  width: 110px;
}

.special-stock-table th:nth-child(3),
.special-stock-table td:nth-child(3) {
  width: 230px;
}

.special-stock-table th:nth-child(4),
.special-stock-table td:nth-child(4) {
  width: 260px;
}

.special-stock-table th:nth-child(5),
.special-stock-table td:nth-child(5) {
  width: 130px;
}

.special-stock-table th:nth-child(6),
.special-stock-table td:nth-child(6) {
  width: 96px;
}

.special-stock-table th:nth-child(7),
.special-stock-table td:nth-child(7) {
  position: sticky;
  right: 0;
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  text-align: right;
}

.special-stock-table th:nth-child(7) {
  z-index: 6;
  background: linear-gradient(180deg, #edf4fb, #e4eef8);
}

.special-stock-table td:nth-child(7) {
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -12px 0 18px rgba(10, 35, 64, 0.06);
}

.special-stock-table tbody tr:nth-child(even) td:nth-child(7) {
  background: rgba(238, 245, 252, 0.98);
}

.special-stock-table tbody tr:hover td:nth-child(7) {
  background: #e8f2fb;
}

.special-stock-table td:nth-child(7):has(.row-menu[open]) {
  z-index: 30;
}

.tv-workspace {
  width: min(1660px, calc(100% - 28px));
}

.consulta-stock-table table {
  min-width: 1400px;
  table-layout: fixed;
}

.consulta-stock-table th,
.consulta-stock-table td {
  padding: 11px 12px;
}

.consulta-stock-table th:nth-child(1),
.consulta-stock-table td:nth-child(1) {
  width: 104px;
}

.consulta-stock-table th:nth-child(2),
.consulta-stock-table td:nth-child(2) {
  width: 250px;
}

.consulta-stock-table th:nth-child(3),
.consulta-stock-table td:nth-child(3),
.consulta-stock-table th:nth-child(4),
.consulta-stock-table td:nth-child(4),
.consulta-stock-table th:nth-child(5),
.consulta-stock-table td:nth-child(5),
.consulta-stock-table th:nth-child(6),
.consulta-stock-table td:nth-child(6),
.consulta-stock-table th:nth-child(7),
.consulta-stock-table td:nth-child(7),
.consulta-stock-table th:nth-child(8),
.consulta-stock-table td:nth-child(8),
.consulta-stock-table th:nth-child(9),
.consulta-stock-table td:nth-child(9),
.consulta-stock-table th:nth-child(10),
.consulta-stock-table td:nth-child(10),
.consulta-stock-table th:nth-child(11),
.consulta-stock-table td:nth-child(11) {
  width: 88px;
  text-align: right;
}

.consulta-stock-table th:nth-child(12),
.consulta-stock-table td:nth-child(12) {
  width: 118px;
}

.consulta-stock-table th:nth-child(3),
.consulta-stock-table td:nth-child(3),
.consulta-stock-table th:nth-child(4),
.consulta-stock-table td:nth-child(4),
.consulta-stock-table th:nth-child(5),
.consulta-stock-table td:nth-child(5) {
  background: rgba(31, 122, 140, 0.055);
}

.consulta-stock-table th:nth-child(6),
.consulta-stock-table td:nth-child(6) {
  background: rgba(112, 92, 168, 0.065);
}

.consulta-stock-table th:nth-child(7),
.consulta-stock-table td:nth-child(7) {
  background: rgba(205, 151, 33, 0.075);
}

.consulta-stock-table th:nth-child(8),
.consulta-stock-table td:nth-child(8) {
  background: rgba(35, 105, 180, 0.06);
}

.consulta-stock-table th:nth-child(9),
.consulta-stock-table td:nth-child(9) {
  background: rgba(181, 88, 76, 0.065);
}

.consulta-stock-table th:nth-child(10),
.consulta-stock-table td:nth-child(10) {
  background: rgba(35, 105, 180, 0.045);
}

.table-row-critical {
  background: rgba(214, 69, 69, 0.08) !important;
}

.table-balance-negative {
  color: #b42318;
  font-weight: 800;
}

.table-balance-positive {
  color: #067647;
  font-weight: 800;
}

.table-coverage-cell .table-primary-line,
.table-coverage-cell .table-note {
  white-space: nowrap;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #edf4fb, #e4eef8);
}

.table-wrapper-compact th,
.table-wrapper-compact td {
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.28;
}

.table-wrapper-compact th {
  font-size: 0.72rem;
}

.dashboard-stock-table .table-description {
  max-width: 230px;
}

.dashboard-stock-table .table-compact-text {
  max-width: 190px;
}

.dashboard-stock-table .table-description,
.dashboard-stock-table .table-compact-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-observer-table {
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
}

.dashboard-observer-table th,
.dashboard-observer-table td {
  white-space: nowrap;
}

.dashboard-observer-table .table-description {
  min-width: 220px;
  white-space: normal;
}

.modal-dialog.dashboard-servo-modal-dialog {
  width: min(1240px, 100%);
}

.dashboard-servo-panel-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-servo-panel-head h3 {
  margin: 0 0 4px;
  color: var(--primary-900);
  font-size: 1.04rem;
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-chip {
  display: inline-flex;
  min-width: 96px;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(190, 208, 225, 0.76);
  border-radius: 12px;
  background: rgba(245, 249, 253, 0.92);
}

.summary-chip small {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.summary-chip strong {
  color: var(--primary-900);
  font-size: 0.95rem;
  line-height: 1.1;
}

.dashboard-servo-wrapper {
  max-height: min(560px, calc(100vh - 300px));
  border-radius: 14px;
}

.dashboard-servo-wrapper .servo-sheet-table {
  min-width: 980px;
}

.dashboard-detail-chip {
  display: inline-flex;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(226, 236, 247, 0.92);
  color: var(--primary-900);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: rgba(238, 245, 252, 0.4);
}

tbody tr:hover {
  background: rgba(225, 237, 248, 0.55);
}

.empty-state {
  padding: 30px 18px;
  text-align: center;
  color: var(--text-soft);
}

.table-code {
  font-weight: 800;
  color: var(--primary-900);
}

.table-link {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
  text-decoration: none;
}

.table-link:hover .table-code,
.table-link:focus-visible .table-code {
  text-decoration: underline;
}

.table-muted {
  color: var(--text-soft);
}

.table-subtext {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.table-description {
  color: var(--text);
}

.table-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-primary-line {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.table-secondary-line {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.table-actions-cell {
  width: 72px;
  text-align: right;
}

.expedicao-list-actions {
  width: auto;
  min-width: 200px;
  white-space: nowrap;
}

.expedicao-list-actions .btn {
  display: inline-flex;
  margin-left: 8px;
}

.expedicao-list-row-pendente {
  background: rgba(255, 246, 225, 0.88);
}

.table-quantity {
  font-weight: 800;
  color: var(--primary-900);
}

.table-note {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.remessa-codigos-text {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--primary-900);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(18, 66, 118, 0.08);
}

.status-chip.is-success {
  color: #166e53;
  background: rgba(30, 139, 104, 0.13);
}

.status-chip.is-warning {
  color: #8c6700;
  background: rgba(239, 189, 29, 0.16);
}

.status-chip.is-danger {
  color: #a13030;
  background: rgba(214, 69, 69, 0.13);
}

.category-geometry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--primary-900);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: rgba(18, 66, 118, 0.08);
}

.category-geometry-chip small {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.category-geometry-chip.is-trefilado {
  background: rgba(29, 92, 151, 0.1);
}

.category-geometry-chip.is-fundido {
  color: #5c3b00;
  background: rgba(239, 139, 29, 0.14);
}

.geometry-symbol {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: var(--primary-700);
}

.geometry-symbol.is-round {
  border-radius: 999px;
}

.geometry-symbol.is-square {
  border-radius: 3px;
}

.geometry-symbol.is-hex {
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
}

.geometry-symbol.is-strip {
  width: 18px;
  height: 10px;
  border-radius: 3px;
}

.geometry-symbol.is-generic {
  border-radius: 50% 50% 3px 3px;
}

.table-row-attention {
  background: rgba(239, 189, 29, 0.12) !important;
}

.table-row-attention:hover {
  background: rgba(239, 189, 29, 0.2) !important;
}

.history-table td,
.history-table th {
  white-space: nowrap;
}

.row-menu {
  position: relative;
  display: inline-block;
}

.row-menu summary {
  list-style: none;
}

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

.row-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(168, 189, 211, 0.7);
  border-radius: 12px;
  background: rgba(244, 248, 252, 0.96);
  color: var(--primary-900);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.row-menu-trigger:hover {
  background: rgba(230, 240, 249, 0.96);
  transform: translateY(-1px);
}

.row-menu[open] .row-menu-trigger {
  box-shadow: var(--shadow-sm);
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  z-index: 15;
  min-width: 176px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.row-menu.drop-up .row-menu-panel {
  top: auto;
  bottom: calc(100% + 8px);
}

.row-menu.is-fixed .row-menu-panel {
  position: fixed;
  top: var(--row-menu-top);
  left: var(--row-menu-left);
  right: auto;
  bottom: auto;
  z-index: 220;
  max-height: var(--row-menu-max-height, calc(100vh - 24px));
  overflow-y: auto;
}

.row-menu.is-fixed.drop-up .row-menu-panel {
  top: var(--row-menu-top);
  bottom: auto;
}

.row-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  color: var(--primary-900);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.row-menu-item:hover {
  background: rgba(231, 241, 251, 0.92);
}

.row-menu-item.danger {
  color: var(--danger);
}

.row-menu-item.is-muted {
  color: var(--text-soft);
  cursor: default;
}

.row-menu-item.is-muted:hover {
  background: transparent;
}

.subtle-divider {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(190, 208, 225, 0.7), transparent);
}

/* Modal de cadastro e edicao. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 24, 45, 0.46);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.98));
  box-shadow: var(--shadow-lg);
  animation: modal-enter 0.18s ease-out;
}

.modal-dialog.modal-small {
  width: min(620px, 100%);
}

.modal-dialog.modal-wide {
  width: min(1120px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.32rem;
}

.modal-header p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

.calc-mp-result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.calc-mp-result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.embedded-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.compact-top h3 {
  margin: 0;
}

.inline-note {
  padding: 13px 15px;
  border: 1px dashed rgba(18, 66, 118, 0.28);
  border-radius: 14px;
  background: rgba(233, 243, 253, 0.72);
  color: var(--primary-900);
  font-size: 0.92rem;
  line-height: 1.45;
}

.inline-note.is-warning {
  border: 1px solid rgba(176, 33, 33, 0.35);
  background: rgba(255, 232, 232, 0.95);
  color: #8d1616;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(176, 33, 33, 0.08);
}

.inline-note.is-success {
  border: 1px solid rgba(38, 105, 63, 0.24);
  background: rgba(232, 245, 236, 0.92);
  color: #255e3a;
}

.inline-note.is-info {
  border: 1px solid rgba(18, 66, 118, 0.22);
  background: rgba(233, 243, 253, 0.82);
  color: var(--primary-900);
}

.pedido-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(18, 66, 118, 0.14);
  border-radius: 14px;
  background: rgba(245, 249, 253, 0.88);
  color: var(--primary-900);
  font-weight: 600;
  line-height: 1.45;
}

.pedido-confirm-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Resumo da submontagem selecionada. */
.structure-highlight {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(29, 92, 151, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(237, 245, 252, 0.92), rgba(255, 255, 255, 0.98));
}

.structure-highlight h3 {
  margin: 6px 0 0;
  font-size: 1.12rem;
}

.structure-highlight p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.structure-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-chip {
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--primary-900);
  font-size: 0.84rem;
  font-weight: 700;
  background: rgba(18, 66, 118, 0.08);
}

/* Campo pesquisavel dos itens da submontagem. */
.autocomplete {
  position: relative;
}

.autocomplete-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.autocomplete-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 13px;
  cursor: pointer;
  transition: background var(--transition);
}

.autocomplete-option strong {
  display: block;
  color: var(--primary-900);
}

.autocomplete-option span {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.autocomplete-option:hover {
  background: rgba(231, 241, 251, 0.92);
}

.autocomplete-empty {
  padding: 12px 13px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.search-helper {
  color: var(--text-soft);
  font-size: 0.83rem;
}

@media (max-width: 960px) {
  .workspace {
    width: min(100%, calc(100% - 24px));
  }

  .sector-shell {
    grid-template-columns: 1fr;
  }

  .sector-menu {
    position: static;
  }

  .sector-menu-card {
    width: 100%;
    border-radius: 24px;
  }

  .sector-menu-panel {
    width: 100%;
    right: auto;
    left: 0;
  }

  .sector-menu-summary {
    width: 100%;
    margin-left: 0;
  }

  .sector-menu-heading {
    flex: 1;
    justify-content: space-between;
  }

  .sector-menu-list .btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .toolbar-form {
    grid-template-columns: 1fr;
  }

  .toolbar-form.stock-toolbar {
    grid-template-columns: 1fr;
  }

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

  .compact-grid,
  .supplier-picker,
  .helper-grid,
  .view-grid {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .workspace {
    width: min(100%, calc(100% - 18px));
    padding-top: 12px;
  }

  .topbar,
  .content-card,
  .summary-card,
  .modal-dialog {
    padding: 16px;
    border-radius: 18px;
  }

  .topbar,
  .card-top,
  .modal-header,
  .structure-highlight {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .modal-actions,
  .compact-actions,
  .actions-row {
    width: 100%;
  }

  .topbar-actions .btn,
  .modal-actions .btn,
  .actions-row .btn {
    width: 100%;
  }

  .inline-field {
    grid-template-columns: 1fr;
  }

  .selected-tags {
    padding: 12px;
  }

    th,
  td {
    padding: 12px;
  }

  .pedido-print-diagnostic-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .pedido-print-diagnostic-grid {
    grid-template-columns: 1fr;
  }
}

.portal-page {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(6, 15, 28, 0.62), rgba(8, 19, 34, 0.78)),
    url('/img/entrada/fundo-entrada.png') center center / cover no-repeat fixed,
    linear-gradient(180deg, #07111f 0%, #0a1830 100%);
  color: #f5f9ff;
}

.portal-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 24%, rgba(56, 140, 235, 0.14), transparent 28%),
    radial-gradient(circle at 78% 26%, rgba(255, 163, 54, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(5, 14, 27, 0.22), rgba(5, 14, 27, 0.42));
  pointer-events: none;
}

.portal-shell {
  width: min(1120px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.portal-session-actions {
  position: absolute;
  top: 18px;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.portal-session-actions .session-indicator {
  position: static;
  z-index: 2;
}

.portal-shell-hero {
  align-items: center;
  text-align: center;
}

.portal-stage {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 0 0;
}

.portal-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 220px;
}

.portal-hero-card,
.portal-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 20, 38, 0.18), rgba(7, 18, 34, 0.14));
  border: 1px solid rgba(214, 228, 245, 0.12);
  border-radius: 28px;
  box-shadow: 0 24px 52px rgba(3, 10, 20, 0.18);
  backdrop-filter: blur(16px) saturate(1.08);
}

.portal-hero-card {
  width: min(820px, 100%);
  padding: clamp(22px, 3vw, 30px) clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.portal-hero-card::before,
.portal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(247, 149, 29, 0.08), transparent 36%),
    linear-gradient(320deg, rgba(88, 152, 222, 0.12), transparent 42%);
  pointer-events: none;
}

.portal-hero-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(77, 151, 255, 0.1),
    0 0 18px rgba(90, 160, 255, 0.14),
    inset 0 0 26px rgba(72, 145, 255, 0.04);
  pointer-events: none;
}

.portal-kicker {
  margin: 0;
  color: rgba(226, 236, 247, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.portal-title {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.02;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 12px 30px rgba(2, 8, 18, 0.24);
}

.portal-subtitle {
  margin: 0;
  max-width: 620px;
  color: rgba(234, 242, 251, 0.88);
  font-size: clamp(0.92rem, 1.4vw, 1rem);
  line-height: 1.58;
  text-wrap: balance;
}

.portal-enter-btn {
  min-width: 168px;
  align-self: center;
  margin-top: 4px;
  position: relative;
  z-index: 1;
  padding: 12px 28px;
  font-size: 0.98rem;
  box-shadow:
    0 14px 24px rgba(238, 141, 24, 0.22),
    0 0 0 1px rgba(255, 197, 116, 0.1);
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease, filter 220ms ease;
  animation: portalButtonPulse 2.8s ease-in-out infinite;
}

.portal-enter-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 18px 30px rgba(238, 141, 24, 0.3),
    0 0 18px rgba(255, 177, 73, 0.2);
  filter: saturate(1.04);
}

.portal-page.portal-entering .portal-hero-card {
  transform: scale(0.985);
  opacity: 0.84;
  filter: blur(1px);
  transition: transform 280ms ease, opacity 280ms ease, filter 280ms ease;
}

.portal-page.portal-entering .portal-enter-btn {
  transform: scale(0.96);
  opacity: 0.78;
}

.portal-footer {
  width: min(100%, 420px);
  color: rgba(230, 238, 247, 0.86);
  align-self: center;
  text-align: center;
  line-height: 1.4;
  font-size: 0.78rem;
  padding: 10px 14px 12px;
  margin: clamp(72px, 13vh, 120px) auto 0;
  background: rgba(5, 14, 27, 0.22);
  border: 1px solid rgba(214, 228, 245, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  text-shadow: 0 10px 24px rgba(3, 11, 22, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.portal-footer-copy {
  display: block;
}

.portal-footer-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(243, 248, 255, 0.96);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.portal-footer-credit:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.portal-footer-credit-text {
  white-space: nowrap;
}

.portal-footer-credit img {
  display: block;
  width: 128px;
  max-width: 36vw;
  height: auto;
  object-fit: contain;
  filter: saturate(1.45) brightness(1.45) contrast(1.08) drop-shadow(0 0 12px rgba(58, 139, 255, 0.34));
  mix-blend-mode: screen;
}

.portal-footer-author {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}

.portal-footer-author-prefix {
  color: rgba(243, 248, 255, 0.96);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
}

.portal-footer-author-name {
  color: rgba(243, 248, 255, 0.96);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 0 14px rgba(58, 139, 255, 0.2);
}

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

.portal-grid-two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.portal-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 26px 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(27, 92, 158, 0.24);
  box-shadow: 0 24px 42px rgba(12, 41, 76, 0.14);
}

.portal-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.portal-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.portal-card-kicker {
  color: var(--accent-700);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-card-wide {
  grid-column: 1 / -1;
}

.portal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.portal-actions .btn-neutral {
  color: #f7fbff;
  background: linear-gradient(180deg, rgba(12, 31, 56, 0.88), rgba(8, 22, 42, 0.92));
  border: 1px solid rgba(180, 208, 240, 0.28);
  box-shadow: 0 14px 24px rgba(4, 12, 23, 0.18);
}

.portal-actions .btn-neutral:hover {
  background: linear-gradient(180deg, rgba(18, 43, 76, 0.94), rgba(10, 28, 52, 0.96));
  border-color: rgba(210, 228, 247, 0.36);
  box-shadow: 0 18px 28px rgba(4, 12, 23, 0.24);
}

@media (max-width: 860px) {
  .portal-session-actions {
    position: static;
    align-self: flex-end;
    margin-bottom: 8px;
  }

  .portal-header {
    padding-right: 0;
  }
}

.portal-auth-card {
  width: min(540px, 100%);
}

.portal-auth-form {
  width: 100%;
  margin-top: 6px;
}

.portal-auth-form .message {
  margin-bottom: 0;
}

.portal-auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.portal-auth-actions .btn {
  min-width: 140px;
}

.btn-small {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.88rem;
}

.pedido-prioridade-lista {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding-right: 4px;
}

.pedido-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.pedido-lane {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(208, 221, 236, 0.94);
  border-radius: 10px;
  background: rgba(246, 250, 254, 0.72);
}

.pedido-lane-today {
  background: rgba(239, 248, 243, 0.82);
  border-color: rgba(134, 196, 166, 0.72);
}

.pedido-lane-header h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.pedido-lane-header p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.pedido-prioridade-lista-compact {
  align-content: start;
}

.pedido-prioridade-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 8px;
  border: 2px solid rgba(53, 102, 150, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 8px rgba(10, 34, 61, 0.04);
  cursor: pointer;
}

.pedido-prioridade-card.is-dragging {
  opacity: 0.55;
  border-style: dashed;
  box-shadow: 0 10px 24px rgba(10, 34, 61, 0.12);
}

.pedido-prioridade-card.is-ready {
  border-color: rgba(30, 139, 104, 0.55);
}

.pedido-prioridade-card.is-pending {
  border-color: rgba(214, 69, 69, 0.52);
}

.pedido-prioridade-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  color: var(--text-soft);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
  user-select: none;
  cursor: grab;
}

.pedido-prioridade-card.is-dragging .pedido-prioridade-handle {
  cursor: grabbing;
}

.pedido-prioridade-main {
  display: grid;
  gap: 4px;
}

.pedido-prioridade-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pedido-prioridade-identidade {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pedido-prioridade-head h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.1;
}

.pedido-prioridade-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pedido-prioridade-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 8px;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.1;
}

.pedido-prioridade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pedido-prioridade-tags {
  gap: 4px;
  justify-content: flex-end;
}

.pedido-prioridade-tags .selected-tag,
.pedido-prioridade-identidade .section-pill {
  font-size: 0.62rem;
  padding: 3px 6px;
}

.pedido-prioridade-actions .btn-small {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 0.66rem;
  border-radius: 999px;
}

.status-ready {
  background: rgba(30, 139, 104, 0.13);
  color: #156a50;
}

.status-pending {
  background: rgba(214, 69, 69, 0.12);
  color: #b13a3a;
}

.status-warning {
  background: rgba(236, 171, 61, 0.18);
  color: #8f6110;
}

.status-neutral {
  background: rgba(53, 102, 150, 0.12);
  color: var(--primary-900);
}

.pedido-page .workspace {
  width: min(1660px, calc(100% - 20px));
  padding-top: 12px;
}

.pedido-page .topbar {
  margin-bottom: 12px;
  padding: 14px 16px;
}

.pedido-page .page-title {
  font-size: clamp(1.45rem, 1.8vw, 2rem);
}

.pedido-page .page-subtitle {
  font-size: 0.84rem;
  line-height: 1.35;
}

.pedido-page .summary-row {
  gap: 10px;
  margin-bottom: 12px;
}

.pedido-page .summary-card {
  padding: 12px 14px;
}

.pedido-page .summary-card strong {
  margin-top: 6px;
  font-size: 1.3rem;
}

.pedido-page .content-card {
  margin-bottom: 12px;
  padding: 14px;
}

.pedido-page .card-top {
  margin-bottom: 12px;
}

.pedido-page .toolbar-form {
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .pedido-board {
    grid-template-columns: 1fr;
  }

  .pedido-prioridade-lista {
    max-height: none;
  }
}

.pedido-item-cell {
  display: grid;
  gap: 8px;
}

.pedido-item-row-complete td {
  background: rgba(232, 245, 236, 0.92);
}

.pedido-item-cell span {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.pedido-item-serial-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.pedido-item-serial-list .selected-tag {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 2px 6px;
  font-size: 0.66rem;
  line-height: 1;
  border-radius: 999px;
}

.pedido-item-serial-list .tag-inline-action {
  padding-left: 4px;
  font-size: 0.66rem;
}

.pedido-item-serial-list .tag-inline-label,
.pedido-item-serial-list .pedido-serial-empty-tag {
  font-size: 0.66rem;
}

.tag-inline-action {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 0 0 6px;
  cursor: pointer;
  font: inherit;
}

.pedido-serial-row {
  cursor: pointer;
}

.pedido-serial-row.is-selected td {
  background: rgba(231, 241, 251, 0.72);
}

.pedido-item-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.pedido-item-checkbox input {
  width: 16px;
  height: 16px;
}

.pedido-print-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  color: #14528b;
  background: rgba(228, 239, 250, 0.92);
  border: 1px solid rgba(121, 158, 204, 0.36);
}

.pedido-print-btn:hover {
  background: rgba(213, 231, 249, 0.98);
  border-color: rgba(77, 128, 187, 0.48);
}

.pedido-print-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pedido-kit-imagem-dialog {
  width: min(1180px, 96vw);
}

.pedido-kit-imagem-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 560px;
  padding: 8px 4px 14px;
}

.pedido-kit-imagem-preview {
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(120, 150, 190, 0.25);
  background: #fff;
}

.numero-serie-register-grid {
  align-items: end;
}

.numero-serie-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(29, 92, 151, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 247, 236, 0.96), rgba(232, 243, 253, 0.96)),
    #ffffff;
}

.numero-serie-stage-main {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.numero-serie-stage-main span {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.numero-serie-stage-main strong {
  display: block;
  width: min(100%, 360px);
  padding: 10px 18px;
  border-radius: 18px;
  color: #ffffff;
  font-size: 2.25rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--primary-800), var(--accent));
  box-shadow: 0 18px 32px rgba(18, 66, 118, 0.2);
  overflow-wrap: anywhere;
}

.numero-serie-stage-main small {
  color: var(--primary-800);
  font-weight: 700;
}

.numero-serie-stage-actions,
.numero-serie-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.numero-serie-mode-row {
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px dashed rgba(18, 66, 118, 0.22);
  border-radius: 16px;
  background: rgba(245, 249, 253, 0.86);
}

.numero-serie-manual-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-900);
  font-weight: 800;
  cursor: pointer;
}

.numero-serie-manual-toggle input {
  width: 20px;
  height: 20px;
}

.numero-serie-manual-field {
  width: min(100%, 300px);
}

.numero-serie-register-grid .field input,
.numero-serie-register-grid .field select {
  padding-block: 10px;
  border-radius: 10px;
}

.numero-serie-modal-actions {
  align-items: center;
  justify-content: space-between;
}

.btn-serial-register {
  min-width: 180px;
  background: linear-gradient(135deg, #1e8b68, #ef8b1d);
  box-shadow: 0 16px 28px rgba(30, 139, 104, 0.2);
}

.btn-serial-register:hover {
  background: linear-gradient(135deg, #177a5b, #d97813);
}

@keyframes portalButtonPulse {
  0%,
  100% {
    box-shadow:
      0 14px 24px rgba(238, 141, 24, 0.22),
      0 0 0 1px rgba(255, 197, 116, 0.1);
  }
  50% {
    box-shadow:
      0 18px 28px rgba(238, 141, 24, 0.28),
      0 0 14px rgba(255, 177, 73, 0.18);
  }
}

@media (max-width: 720px) {
  .pedido-kit-imagem-dialog {
    width: min(96vw, 960px);
  }

  .pedido-kit-imagem-stage {
    min-height: 360px;
    padding-inline: 0;
  }

  .pedido-kit-imagem-preview {
    max-height: 68vh;
  }

  .numero-serie-stage {
    grid-template-columns: 1fr;
  }

  .numero-serie-stage-actions,
  .numero-serie-mode-row,
  .numero-serie-modal-actions {
    justify-content: stretch;
  }

  .numero-serie-stage-actions .btn,
  .numero-serie-modal-actions .btn,
  .numero-serie-manual-field {
    width: 100%;
  }

  .numero-serie-stage-main strong {
    font-size: 1.8rem;
  }

  .portal-shell {
    width: calc(100% - 20px);
    max-width: 100%;
    padding: 14px 0 20px;
  }

  .portal-stage {
    min-width: 0;
  }

  .portal-hero-card,
  .portal-card {
    border-radius: 22px;
    max-width: 100%;
  }

  .portal-hero-card {
    width: 100%;
    min-width: 0;
    padding: 28px 18px;
  }

  .portal-hero-card-button-only {
    width: auto;
    padding: 0;
  }

  .portal-card {
    min-height: auto;
  }

  .portal-title {
    max-width: 100%;
    font-size: 2rem;
    text-wrap: wrap;
    overflow-wrap: break-word;
  }

  .portal-subtitle {
    width: min(100%, 30ch);
    font-size: 0.98rem;
    text-wrap: wrap;
  }

  .portal-footer {
    align-self: center;
    width: min(100%, 360px);
    margin: clamp(66px, 12vh, 96px) auto 0;
    text-align: center;
    font-size: 0.76rem;
    padding: 10px 12px;
  }

  .portal-footer-credit {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .portal-footer-credit img {
    width: 118px;
    max-width: 42vw;
  }
}
