:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef3ee;
  --ink: #111b15;
  --soft: #5f6d64;
  --line: #d7dfd7;
  --brand: #1f6f4a;
  --brand-2: #164f36;
  --blue: #286a9a;
  --yellow: #9a671e;
  --red: #aa3a32;
  --shadow: 0 14px 36px rgba(30, 48, 36, .10);
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; max-width: 100%; }

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover { border-color: #9db5a5; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-2); }
button.ghost { background: transparent; }
button.danger { color: var(--red); border-color: #dfb9b5; }
.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
}
.button-link:hover { border-color: #9db5a5; }
.button-link.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.button-link.primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}
.btn-pin {
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #b7d7bc;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn-pin:hover { background: #22703a; border-color: #22703a; }
.btn-pin.pinned {
  background: #868e96;
  border-color: #868e96;
}
.btn-pin.pinned:hover { background: #6c757d; border-color: #6c757d; }
.guide-actions-cell {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.guide-sync-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}
.coordinate-map-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.coordinate-map-control input {
  min-width: 0;
}
.map-link {
  min-height: 38px;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.map-link:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  touch-action: manipulation;
}

textarea { min-height: 78px; resize: vertical; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 520px) 1fr;
  background:
    linear-gradient(120deg, #ffffff 0%, #ffffff 28%, rgba(232, 242, 236, .65) 100%);
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,250,.98));
  border-right: 1px solid var(--line);
  padding: clamp(24px, 5vw, 56px);
  display: grid;
  align-content: center;
  justify-items: stretch;
  box-shadow: 12px 0 32px rgba(30, 48, 36, .06);
  position: relative;
}

.login-brandmark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(31, 111, 74, .22);
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05;
}
.login-panel p { margin: 10px 0 28px; color: var(--soft); line-height: 1.5; font-size: 16px; }
.login-panel .field { margin-bottom: 14px; }
.login-panel input {
  min-height: 48px;
  border-color: #cbd8ce;
  background: #fbfcfb;
}
.login-panel input:focus {
  outline: 3px solid rgba(31, 111, 74, .16);
  border-color: var(--brand);
  background: #fff;
}
.login-panel button.primary {
  min-height: 48px;
  margin-top: 2px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(31, 111, 74, .18);
}
.login-switch {
  margin: 18px 0 0 !important;
  text-align: center;
  font-size: 13px !important;
}
.login-switch a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}
.login-switch a:hover { text-decoration: underline; }

.login-visual {
  padding: clamp(28px, 6vw, 72px);
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(244, 246, 243, .94), rgba(230, 239, 233, .88)),
    radial-gradient(circle at 74% 18%, rgba(40, 106, 154, .10), transparent 30%),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(31, 111, 74, .05) 38px 39px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(31, 111, 74, .05) 38px 39px);
}

.hero-board {
  max-width: 880px;
  display: grid;
  gap: 18px;
}

.hero-kicker {
  width: max-content;
  border: 1px solid #c5dbce;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: var(--brand-2);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.hero-board h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.02;
}
.hero-board p { color: var(--soft); max-width: 700px; line-height: 1.55; font-size: 18px; }

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

.preview-tile {
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 118px;
  box-shadow: 0 12px 28px rgba(30, 48, 36, .07);
}

.preview-tile b { display: block; font-size: 26px; margin-bottom: 8px; }
.preview-tile span { color: var(--soft); font-size: 14px; line-height: 1.35; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: #304137; font-weight: 700; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.mobile-menu-button,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.side {
  background: linear-gradient(180deg, #ffffff 0%, #f8fdf9 100%);
  border-right: 1px solid #d8e8dd;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 20px;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #c6dbc9 transparent;
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dce8df;
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-2, #1a6837) 0%, #2d9e57 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}
.brand span { display: block; margin-top: 5px; color: var(--soft, #5a6e61); font-size: 11px; font-weight: 500; }
.sidebar-toggle {
  flex: 0 0 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0f7f2;
  border: 1px solid #dce8df;
  color: var(--brand-2, #1a6837);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}



.sidebar-collapsed .side {
  padding-inline: 12px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .brand > div,
.sidebar-collapsed .nav button span,
.sidebar-collapsed .sync-card {
  display: none;
}

.sidebar-collapsed .nav button {
  display: grid;
  place-items: center;
  padding-inline: 0;
}

.sidebar-collapsed .nav button::before {
  display: none;
}

.nav { display: grid; gap: 4px; }

.nav button {
  text-align: left;
  background: transparent;
  border-color: transparent;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1a2e22);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: opacity 0.18s;
}

.nav button:hover {
  background: #f0f7f2;
  border-color: #dce8df;
  color: var(--brand-2, #1a6837);
}

.nav button:hover svg {
  opacity: 1;
}

.nav button.active {
  background: linear-gradient(135deg, #e0f0e6 0%, #d0ebd9 100%);
  border-color: #b8d9c4;
  color: var(--brand-2, #1a6837);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(26, 104, 55, 0.12);
}

.nav button.active svg {
  opacity: 1;
  stroke-width: 2.2;
}

.sync-card {
  display: grid;
  gap: 6px;
  background: linear-gradient(135deg, #f8fdf9 0%, #f2f9f4 100%);
  border: 1px solid #d0e8d8;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--soft, #5a6e61);
  font-size: 12px;
}

.sync-card b {
  font-size: 13px;
  color: var(--text, #1a2e22);
}

.sync-card .sync-error {
  overflow: hidden;
  color: var(--red);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-card button {
  margin-top: 4px;
  font-size: 12px;
  padding: 6px 12px;
  font-weight: 600;
}


.content {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--bg);
  padding: 16px 22px;
  margin: -22px -22px 0 -22px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topbar h2 { margin: 0; font-size: 25px; }
.topbar p { margin: 5px 0 0; color: var(--soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.execution-footer-actions { margin-top: 16px; }
.execution-footer-actions button { flex: 1 1 180px; min-height: 44px; font-weight: 700; font-size: 15px; }

.form-tab-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--soft);
  transition: all 0.15s ease;
}
.form-tab-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.form-tab-btn.active {
  background: var(--brand, #1f6f4a);
  border-color: var(--brand, #1f6f4a);
  color: #ffffff;
}
.form-layout-container.single-column {
  grid-template-columns: 1fr;
  max-width: 1050px;
  margin: 0 auto;
}

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

.metric, .panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.metric { padding: 16px; }
.metric b { display: block; font-size: 26px; }
.metric span { color: var(--soft); font-size: 13px; }

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid #bfd5c7;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5fbf7 0%, #fff 62%);
  box-shadow: 0 10px 30px rgba(31, 111, 74, .08);
}
.dashboard-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.dashboard-hero h2 {
  margin: 0;
  font-size: 30px;
}
.dashboard-hero p {
  margin: 6px 0 0;
  color: var(--soft);
}
.dashboard-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dashboard-scope-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.dashboard-scope-tabs::-webkit-scrollbar { display: none; }
.dashboard-scope-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
}
.dashboard-scope-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 800;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-metric {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.dashboard-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--brand);
}
.dashboard-metric.green::before { background: #2b8a3e; }
.dashboard-metric.blue::before { background: var(--blue); }
.dashboard-metric.red::before { background: var(--red); }
.dashboard-metric.orange::before { background: #f76707; }
.dashboard-metric.yellow::before { background: var(--yellow); }
.dashboard-metric span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.dashboard-metric b {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}
.dashboard-metric small {
  display: block;
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
}
.dashboard-metric-action {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-metric-action:hover {
  transform: translateY(-2px);
  border-color: #ef9a58;
  box-shadow: 0 10px 24px rgba(247, 103, 7, .12);
}
.dashboard-metric-action:focus-visible {
  outline: 3px solid rgba(247, 103, 7, .22);
  outline-offset: 2px;
}
.communication-critical-modal {
  width: min(720px, 100%);
  padding: 0;
  overflow: hidden;
}
.communication-critical-head {
  padding: 22px 24px;
  border-bottom: 1px solid #f0d5c1;
  background: linear-gradient(135deg, #fff7f0 0%, #fff 72%);
}
.communication-critical-head h3,
.communication-critical-head p {
  margin: 0;
}
.communication-critical-head h3 {
  margin-top: 4px;
  font-size: 25px;
}
.communication-critical-head p {
  margin-top: 6px;
  color: var(--soft);
}
.communication-critical-kicker {
  color: #c45100;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.communication-critical-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 20px 24px 12px;
  border: 1px solid #f2c9ab;
  border-radius: 10px;
  background: #fff8f2;
  padding: 16px 18px;
}
.communication-critical-total span {
  color: #7a3b12;
  font-weight: 800;
}
.communication-critical-total strong {
  color: #b94700;
  font-size: 34px;
  line-height: 1;
}
.communication-critical-list {
  max-height: min(55vh, 520px);
  display: grid;
  gap: 9px;
  overflow: auto;
  padding: 8px 24px 24px;
}
.communication-critical-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.4fr) 56px;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}
.communication-critical-row b,
.communication-critical-row span {
  display: block;
}
.communication-critical-row span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 11px;
}
.communication-critical-row > strong {
  color: #b94700;
  font-size: 20px;
  text-align: right;
}
.communication-critical-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e7dd;
}
.communication-critical-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f76707, #ff9b4a);
}
@media (max-width: 600px) {
  .communication-critical-head {
    padding: 18px;
  }
  .communication-critical-total {
    margin: 16px 18px 10px;
  }
  .communication-critical-list {
    padding: 8px 18px 18px;
  }
  .communication-critical-row {
    grid-template-columns: minmax(0, 1fr) 48px;
  }
  .communication-critical-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 14px;
}
.dashboard-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-progress {
  display: grid;
  gap: 12px;
}
.progress-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
}
.progress-row b,
.progress-row span {
  display: block;
}
.progress-row span {
  color: var(--soft);
  font-size: 12px;
}
.progress-row strong {
  text-align: right;
}
.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}
.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}
.progress-track.danger i { background: var(--red); }
.progress-track.warn i { background: var(--yellow); }
.dashboard-list {
  display: grid;
  gap: 8px;
}
.dashboard-list-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border-color: var(--line);
  background: #fff;
}
.dashboard-list-item:hover {
  border-color: #9db5a5;
  background: #f8fbf9;
}
.dashboard-list-item.static {
  cursor: default;
}
.dashboard-list-item.alert {
  border-color: #dfb7b2;
  background: #fff8f7;
}
.dashboard-list-item span,
.dashboard-list-item small,
.dashboard-list-item strong,
.dashboard-list-item b {
  display: block;
}
.dashboard-list-item b {
  font-size: 15px;
}
.dashboard-list-item small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
}
.dashboard-list-item > span:last-child {
  text-align: right;
}
.inventory-panel {
  border-top: 4px solid var(--brand);
}
.inventory-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.inventory-summary-grid.admin {
  margin-bottom: 12px;
}
.inventory-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}
.inventory-summary-card.red {
  border-color: #dfb7b2;
  background: #fff8f7;
}
.inventory-summary-card.warn {
  border-color: #ecd4a6;
  background: #fffaf0;
}
.inventory-summary-card span {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.inventory-summary-card b {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}
.inventory-summary-card small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  line-height: 1.35;
}
.inventory-order-box {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid #bed5e7;
  border-radius: 8px;
  background: #edf6fc;
  color: #1e4f73;
  padding: 11px 12px;
}
.inventory-order-box.critico {
  border-color: #dfb7b2;
  background: #fff0ee;
  color: var(--red);
}
.inventory-order-box.atencao {
  border-color: #ecd4a6;
  background: #fff7e8;
  color: var(--yellow);
}
.inventory-order-box span,
.inventory-order-box small {
  color: inherit;
}
.battery-type-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.battery-type-chip {
  flex: 1 1 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.battery-type-chip.critico {
  border-color: #dfb7b2;
  background: #fff8f7;
}
.battery-type-chip.atencao {
  border-color: #ecd4a6;
  background: #fffaf0;
}
.battery-type-chip b,
.battery-type-chip span {
  display: block;
}
.battery-type-chip span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
}
.team-day-view {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.team-day-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.team-day-avatar,
.team-member-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e8f2ec;
  color: var(--brand-2);
}
.team-day-avatar {
  width: 58px;
  height: 58px;
}
.team-day-avatar svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.team-day-heading h2,
.team-day-heading p,
.team-member-item h4 {
  margin: 0;
}
.team-day-heading p {
  margin-top: 5px;
  color: var(--soft);
}
.team-day-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.team-day-stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.team-day-stat span {
  display: block;
  color: var(--soft);
}
.team-day-stat .label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.team-day-stat strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 26px;
}
.team-member-list {
  display: grid;
  gap: 10px;
}
.team-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.team-member-avatar {
  width: 38px;
  height: 38px;
}
.team-member-avatar svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.team-member-item small {
  display: block;
  margin-top: 3px;
  color: var(--soft);
}
.team-day-change {
  width: 100%;
  margin-top: 16px;
}
@media (max-width: 640px) {
  .team-day-stats {
    grid-template-columns: 1fr;
  }
}
.psvt-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.psvt-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.psvt-summary-card span {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.psvt-summary-card b {
  display: block;
  margin-top: 7px;
  font-size: 26px;
}
.psvt-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) minmax(120px, 180px) auto;
  align-items: end;
}
.psvt-equipment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.psvt-equipment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #c5dbce;
  border-radius: 999px;
  background: #e8f2ec;
  color: #164f36;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.psvt-equipment-badge.warning {
  border-color: #ecd4a6;
  background: #fff7e8;
  color: #9a671e;
}
.psvt-load-more {
  padding: 16px 0 0;
  text-align: center;
}
.psvt-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.psvt-detail-field,
.psvt-address {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 11px 12px;
}
.psvt-detail-field span,
.psvt-address span {
  display: block;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.psvt-detail-field b,
.psvt-address b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.psvt-address {
  margin-top: 10px;
}
.psvt-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.psvt-equipment-card {
  min-width: 0;
  border: 1px solid #c5dbce;
  border-radius: 8px;
  background: #f8fcfa;
  padding: 12px;
}
.psvt-equipment-card.missing {
  border-color: #ecd4a6;
  background: #fffaf0;
}
.psvt-equipment-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.psvt-equipment-card span,
.psvt-equipment-card h4,
.psvt-equipment-card p,
.psvt-equipment-card small {
  margin: 0;
}
.psvt-equipment-card h4 {
  font-size: 18px;
}
.psvt-equipment-card > .badge {
  margin-top: 8px;
}
.psvt-equipment-card p,
.psvt-equipment-card small {
  display: block;
  margin-top: 7px;
  color: var(--soft);
}
.psvt-planning-panel {
  border-top: 4px solid var(--blue);
  background: linear-gradient(180deg, #f7fbfe 0%, #fff 120px);
}
.psvt-planning-panel .panel-title,
.psvt-release-panel .panel-title {
  align-items: flex-start;
}
.psvt-planning-panel .panel-title h3,
.psvt-planning-panel .panel-title p,
.psvt-release-panel .panel-title h3,
.psvt-equipment-action-card .psvt-equipment-nsve span,
.psvt-equipment-action-card .psvt-equipment-nsve b {
  margin: 0;
}
.psvt-planning-panel .panel-title p {
  margin-top: 4px;
  color: var(--soft);
}
.psvt-release-panel {
  border-left: 4px solid var(--blue);
}
.psvt-release-panel.released {
  border-left-color: var(--brand);
}
.psvt-release-message {
  margin: 12px 0 0;
  border-radius: 6px;
  background: #edf6fc;
  color: #1e4f73;
  padding: 10px 12px;
}
.psvt-nsve-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.psvt-nsve-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.psvt-nsve-row > div:first-child strong,
.psvt-nsve-row > div:first-child span {
  display: block;
}
.psvt-nsve-row > div:first-child span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
}
.psvt-nsve-row .field {
  margin: 0;
}
.psvt-service-note {
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #f6fbf8, #fff 70%);
}
.psvt-note-grid {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) minmax(0, 1.55fr);
  gap: 10px;
}
.psvt-note-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.psvt-note-grid span,
.psvt-equipment-nsve span {
  display: block;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.psvt-note-grid b,
.psvt-equipment-nsve b {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.psvt-service-note > p {
  margin: 12px 0 0;
  line-height: 1.55;
}
.psvt-equipment-action-card {
  display: grid;
  align-content: start;
}
.psvt-equipment-nsve {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.psvt-equipment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.psvt-equipment-actions button {
  flex: 1 1 150px;
  font-weight: 700;
}
.psvt-equipment-context p {
  margin: 8px 0 0;
  line-height: 1.5;
}
.psvt-single-inspection {
  min-width: 0;
}
.psvt-single-inspection .psvt-inspection-card {
  width: min(980px, 100%);
  margin: 0 auto;
}
.psvt-equipment-save {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
}
.psvt-equipment-save button {
  min-width: 240px;
  min-height: 44px;
  font-weight: 700;
}
.psvt-workflow-panel {
  scroll-margin-top: 16px;
  border-top: 4px solid var(--brand);
  padding: 0;
  overflow: hidden;
}
.psvt-workflow-title {
  align-items: flex-start;
  margin: 0;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #f0f8f3 0%, #fff 68%);
  border-bottom: 1px solid var(--line);
}
.psvt-workflow-title h3,
.psvt-workflow-title p,
.psvt-step-heading h4,
.psvt-step-heading p {
  margin: 0;
}
.psvt-workflow-title h3 {
  font-size: 21px;
}
.psvt-workflow-title p,
.psvt-step-heading p {
  margin-top: 4px;
  color: var(--soft);
  line-height: 1.35;
}
.psvt-workflow-step {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.psvt-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.psvt-step-heading > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.psvt-step-heading h4 {
  font-size: 18px;
}
.psvt-due-date {
  width: fit-content;
  margin: 2px 0 0;
  border: 1px solid #bed5e7;
  border-radius: 6px;
  background: #edf6fc;
  color: #1e4f73;
  padding: 8px 10px;
}
.psvt-voltage-grid {
  margin-top: 14px;
}
.psvt-inspection-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(30, 48, 36, .05);
}
.psvt-inspection-card > div:first-child {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.psvt-inspection-card .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.psvt-inspection-card .field {
  min-width: 0;
  margin-bottom: 0;
}
.psvt-piece-fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 12px;
}
.psvt-piece-fieldset legend {
  padding: 0 6px;
  color: var(--brand-2);
  font-weight: 800;
}
.psvt-confirmation {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 10px 12px;
  line-height: 1.35;
}
.psvt-confirmation input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
}
.psvt-workflow-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
}
.psvt-workflow-actions button {
  min-width: 180px;
  min-height: 44px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .psvt-summary-grid,
  .psvt-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .psvt-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .psvt-inspection-card .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .psvt-note-grid,
  .psvt-nsve-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .psvt-summary-grid,
  .psvt-detail-grid,
  .psvt-toolbar {
    grid-template-columns: 1fr;
  }
  .psvt-workflow-title,
  .psvt-workflow-step {
    padding: 14px 12px;
  }
  .psvt-inspection-card .form-grid {
    grid-template-columns: 1fr;
  }
  .psvt-workflow-actions {
    position: static;
    padding: 12px;
  }
  .psvt-workflow-actions button {
    width: 100%;
  }
  .psvt-equipment-save {
    position: static;
  }
  .psvt-equipment-save button {
    width: 100%;
    min-width: 0;
  }
}
.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  color: var(--soft);
}
.empty-state b {
  color: var(--ink);
}

.panel { padding: 16px; }
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title h3 { margin: 0; font-size: 17px; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 170px 190px auto;
  gap: 10px;
  align-items: end;
}

.top20-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.top20-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-color: var(--line);
  background: #fff;
  white-space: nowrap;
}
.top20-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.top20-tabs span {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--surface-2);
  color: var(--soft);
  font-size: 12px;
  text-align: center;
}
.top20-tabs button.active span {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.top20-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.top20-filters button {
  flex: 0 0 auto;
  min-height: 38px;
  border-color: var(--line);
  background: #fff;
  white-space: nowrap;
}
.top20-filters button.active {
  background: #e5f0e9;
  border-color: #c6dbcf;
  color: var(--brand-2);
  font-weight: 700;
}
.guide-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.guide-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
}
.guide-summary-card span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}
.guide-summary-card b {
  font-size: 28px;
  line-height: 1;
}
.guide-summary-card small {
  color: var(--soft);
  font-weight: 700;
}
.guide-summary-card.danger {
  background: #fff7f6;
  border-color: #dfb7b2;
  color: var(--red);
}
.guide-summary-card.success {
  background: #f0f8f3;
  border-color: #b7d7c2;
  color: var(--brand-2);
}
.guide-summary-card.warning {
  background: #fff9ed;
  border-color: #e8d5a8;
  color: #c67a12;
}
.quick-filter-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfb);
  padding: 12px;
}
.quick-filter-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.quick-filter-title strong {
  font-size: 13px;
  color: #304137;
}
.quick-filter-title span,
.quick-filter-hint {
  color: var(--soft);
  font-size: 13px;
}
.quick-filter-hint {
  margin: 0;
}
.quick-filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.quick-filter-row span {
  flex: 0 0 82px;
  color: #304137;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.quick-filter-row button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border-color: var(--line);
  background: #fff;
  white-space: nowrap;
}
.quick-filter-row button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.service-instruction-panel {
  border-top: 4px solid var(--brand);
  background: linear-gradient(180deg, #f7fbf8 0%, #fff 72%);
}
.service-instruction-panel.empty {
  border-top-color: #d8c18a;
}
.service-instruction-panel.compact {
  margin-bottom: 14px;
}
.service-instruction-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.service-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.service-instruction-head h3 {
  margin: 0;
  font-size: 24px;
}
.service-instruction-head p {
  margin: 4px 0 0;
  color: var(--soft);
}
.service-instruction-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.service-instruction-meta div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
}
.service-instruction-meta span {
  display: block;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.service-instruction-meta b {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.service-instruction-body {
  border: 1px solid #c8d9ce;
  border-radius: 8px;
  background: #f8fbf9;
  padding: 10px;
  font-size: 15px;
  line-height: 1.45;
}
.observation-events {
  display: grid;
  gap: 10px;
}
.observation-event {
  display: grid;
  gap: 7px;
  margin: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.observation-event.dated {
  border-left-color: var(--blue);
}
.observation-event-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.observation-event-head strong {
  color: var(--brand-2);
  font-size: 12px;
  text-transform: uppercase;
}
.observation-event p {
  margin: 0;
  overflow-wrap: anywhere;
}
.device-note-button {
  min-height: 30px;
  padding: 4px 9px;
  border-color: #bed5e7;
  background: #edf6fc;
  color: var(--blue);
  font-weight: 700;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 27, 21, .42);
}
.modal-panel {
  width: min(860px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.modal-head h3 {
  margin: 8px 0 4px;
  font-size: 22px;
}
.modal-head p {
  margin: 0;
}
.modal-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.modal-meta div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 10px;
}
.modal-meta span {
  display: block;
  color: var(--soft);
  font-size: 12px;
  margin-bottom: 4px;
}
.modal-meta b {
  display: block;
  overflow-wrap: anywhere;
}
.observation-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ── Crew / Equipe Modal ───────────────────────────────── */
.crew-modal {
  width: min(640px, 100%);
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
}

/* Header com faixa colorida */
.crew-modal-head {
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  padding: 22px 24px 20px;
  border-bottom: none;
  margin-bottom: 0;
}

.crew-modal-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.crew-modal-head p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.72);
}

/* Corpo do modal */
.crew-modal-body {
  padding: 20px 24px 0;
}

.crew-modal .field {
  margin-top: 0;
  margin-bottom: 16px;
}

.crew-modal .field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--soft);
  margin-bottom: 7px;
}

.crew-modal select,
.crew-modal input[type="text"] {
  min-height: 44px;
  border-radius: 10px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color .15s;
}

.crew-modal select:focus,
.crew-modal input[type="text"]:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31,111,74,.12);
}

/* Linha com label + botão "Novo Veículo" */
.crew-vehicle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.crew-vehicle-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--soft);
  margin: 0 !important;
}

.crew-modal #btnShowAddVehicle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  min-height: unset;
  border: 1.5px solid var(--brand) !important;
  background: transparent !important;
  color: var(--brand) !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.crew-modal #btnShowAddVehicle:hover {
  background: var(--brand) !important;
  color: #fff !important;
}

/* Card cadastro de novo veículo */
.crew-modal #newVehicleFormContainer {
  border: 1.5px dashed #a8ccb8 !important;
  border-radius: 12px !important;
  background: #f4faf7 !important;
  padding: 16px !important;
  margin-bottom: 16px !important;
}

.crew-modal #newVehicleFormContainer h4 {
  margin: 0 0 14px !important;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand-2);
}

.crew-modal #newVehicleFormContainer .field {
  margin-bottom: 10px;
}

/* Seção de membros */
.crew-members-section {
  margin-bottom: 0;
}

.crew-members-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--soft);
  margin-bottom: 10px;
}

.crew-count-badge {
  text-transform: none;
  font-weight: 700;
  font-size: 12px;
  color: var(--brand-2);
  background: #e8f7ef;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0;
}

.crew-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 30px;
}

.crew-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8f7ef;
  border: 1px solid #b7dcc4;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px 4px 10px;
  border-radius: 20px;
}

.crew-chip small {
  font-weight: 400;
  opacity: .65;
}

.crew-chip.current-user {
  background: #f0f5f1;
  border-color: var(--line);
  color: var(--ink);
}

.crew-chip-remove {
  border: none;
  background: rgba(0,0,0,.06);
  color: var(--brand-2);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crew-chip-remove:hover {
  background: rgba(0,0,0,.12);
}

.crew-chips-empty {
  font-size: 13px;
  color: var(--soft);
  font-style: italic;
}

.crew-member-search {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 14px;
  padding: 0 12px;
  margin-bottom: 10px;
  background: #fff;
}

.crew-member-search:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31,111,74,.12);
}

.crew-member-empty,
.crew-member-more {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--soft);
  padding: 12px 0;
  margin: 0;
}

.crew-member-more {
  font-weight: 600;
}

.crew-member-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px !important;
  max-height: min(260px, 38vh);
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #f6faf7;
  padding: 10px !important;
  scrollbar-width: thin;
  scrollbar-color: #c5ddd0 transparent;
}

.crew-member-card {
  width: 100%;
  display: flex !important;
  flex-direction: row;
  align-items: center !important;
  gap: 10px !important;
  margin: 0;
  border: 1.5px solid #d8e8df;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px !important;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.crew-member-card:hover {
  border-color: var(--brand);
  background: #f0faf4;
  box-shadow: 0 2px 6px rgba(31,111,74,.1);
}

.crew-member-card.selected {
  border-color: var(--brand);
  background: #e8f7ef;
  box-shadow: 0 0 0 3px rgba(31,111,74,.1);
}

.crew-member-card.current-user {
  cursor: default;
  border-color: var(--brand);
  background: #e8f7ef;
}

.crew-member-card input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--brand);
}

.crew-member-card span {
  min-width: 0;
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Rodapé sticky */
.crew-modal .modal-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table { width: 100%; min-width: 1080px; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; overflow-wrap: anywhere; }
th { background: var(--surface-2); color: #26382e; }
tbody tr:hover td { background: #fbfcfb; }
td:last-child { white-space: nowrap; width: 1%; }
td:last-child button { white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c5dbce;
  background: #e8f2ec;
  color: var(--brand-2);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.warn { border-color: #ecd4a6; background: #fff7e8; color: var(--yellow); }
.badge.red { border-color: #dfb7b2; background: #fff0ee; color: var(--red); }
.badge.blue { border-color: #bed5e7; background: #edf6fc; color: var(--blue); }
.badge.purple { border-color: #ddd6fe; background: #f3e8ff; color: #7c3aed; }
.badge.magenta { border-color: #f5d0fe; background: #fdf4ff; color: #c026d3; }
.badge.cyan { border-color: #a5f3fc; background: #ecfeff; color: #0891b2; }
.badge.ok { border-color: #a7f3d0; background: #ecfdf5; color: #059669; }
.badge.secondary { border-color: #cbd5e1; background: #f1f5f9; color: #475569; }
.execution-owner {
  display: inline-block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.muted { color: var(--soft); }
.situation {
  display: grid;
  gap: 4px;
  min-width: 150px;
}
.situation strong {
  color: var(--red);
  font-size: 13px;
}
.attention-panel {
  border-color: #d99f9a;
  box-shadow: inset 4px 0 0 var(--red);
}
.attention-panel .panel-title h3 {
  color: var(--red);
}
.portal-warning {
  display: grid;
  gap: 4px;
  border: 1px solid #dfb7b2;
  border-radius: 6px;
  background: #fff0ee;
  color: #6f2d28;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}
.portal-warning b {
  color: var(--red);
}

.equipment-standard-list {
  display: grid;
  gap: 14px;
}
.equipment-standard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

tr.unavailable-row {
  border-left: 3px solid var(--red);
}
tr.unavailable-row td {
  background: #fff5f4;
}
tr.unavailable-row:hover td {
  background: #ffebe9;
}
tr.inconsistent-row {
  border-left: 3px solid #d9480f;
}
tr.inconsistent-row td {
  background: #fffaf6;
}
tr.inconsistent-row:hover td {
  background: #fff3e8;
}
.guide-issue-badge {
  display: inline-flex;
  margin-top: 4px;
  font-size: 10px;
  padding: 1px 5px;
}
.guide-device-value {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #9fc4ac;
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  background: #edf7f1;
  color: var(--brand-2);
  padding: 3px 8px 3px 7px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  line-height: 1.2;
  white-space: nowrap;
}

.guide-tipo-detail {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  line-height: 1.2;
}

.guide-psvt-impact-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  line-height: 1.2;
}

.guide-psvt-impact-btn:hover {
  background: #bfdbfe;
  color: #1e3a8a;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.wide { grid-column: span 4; }
.half { grid-column: span 2; }

.checklist { display: grid; gap: 10px; }
.check-row {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.check-row strong { display: block; margin-bottom: 8px; line-height: 1.35; }
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.segmented button { border: 0; border-right: 1px solid var(--line); border-radius: 0; min-height: 34px; padding: 6px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--brand); color: #fff; }

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

.psvt-field-section-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.drop-zone {
  display: grid;
  gap: 10px;
  border: 1px dashed #9eb5a8;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
}
/* Premium Toast System (Top Centered) */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(540px, calc(100vw - 32px));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(16, 26, 22, 0.94);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: toastSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success {
  border-left: 4px solid #22c55e;
  background: linear-gradient(135deg, rgba(16, 36, 26, 0.95), rgba(15, 26, 22, 0.94));
}

.toast-error {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(38, 18, 20, 0.95), rgba(24, 15, 17, 0.94));
}

.toast-warning {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(36, 28, 16, 0.95), rgba(24, 20, 15, 0.94));
}

.toast-info {
  border-left: 4px solid #06b6d4;
  background: linear-gradient(135deg, rgba(16, 30, 36, 0.95), rgba(15, 22, 26, 0.94));
}

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  margin-left: 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.toast-dismissing {
  opacity: 0;
  transform: translateY(-16px) scale(0.95);
  pointer-events: none;
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Fallback & Loading Button Styles */
.btn.is-loading,
button.is-loading {
  position: relative;
  pointer-events: none !important;
  opacity: 0.78 !important;
  cursor: wait !important;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sge-btn-spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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


/* Duas colunas para Ficha de Execução */
.form-layout-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
  align-items: start;
}

.form-layout-container.execution-only {
  grid-template-columns: minmax(0, 820px);
  justify-content: start;
}

.form-layout-container.execution-only .reference-column {
  display: none;
}

.form-layout-container.execution-only .execution-column {
  position: static;
}

.reference-column {
  display: grid;
  gap: 16px;
}

.execution-column {
  position: sticky;
  top: 16px;
}

.execution-sticky-panel {
  border-top: 4px solid var(--brand);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual {
    display: block;
    min-height: auto;
    padding: 22px;
  }
  .hero-board h2 { font-size: 30px; }
  .hero-board p { font-size: 15px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-tile { min-height: auto; }
  .shell { grid-template-columns: 1fr; }
  .shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 12px;
    left: 12px;
    z-index: 25;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    margin: 10px 0 -2px 12px;
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px rgba(22, 79, 54, .18);
    cursor: pointer;
  }
  .mobile-menu-button:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
  }
  .mobile-menu-button svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 320px);
    height: 100dvh;
    transform: translateX(-104%);
    transition: transform .22s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 16px;
    overflow: auto;
    box-shadow: 18px 0 42px rgba(17, 27, 21, .18);
  }
  .side.open {
    transform: translateX(0);
  }
  .side.open + .content {
    pointer-events: none;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(17, 27, 21, .42);
  }
  .side.open + .sidebar-backdrop {
    display: block;
  }
  .sidebar-close {
    display: block;
    width: 100%;
    margin-top: -6px;
  }
  .brand {
    display: block;
  }
  .sidebar-collapsed .brand > div,
  .sidebar-collapsed .nav button span,
  .sidebar-collapsed .sync-card {
    display: block;
  }
  .sidebar-collapsed .nav button::before {
    content: none;
  }
  .brand h1 { font-size: 16px; }
  .brand span { margin-top: 4px; text-align: left; }
  .nav {
    display: grid;
    gap: 8px;
    overflow: visible;
  }
  .nav button {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border-color: var(--line);
    background: #fff;
  }
  .sync-card {
    grid-template-columns: 1fr;
  }
  .sync-card button { min-height: 42px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid,
  .dashboard-grid.compact {
    grid-template-columns: 1fr;
  }
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-hero-actions {
    justify-content: flex-start;
  }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide, .half { grid-column: span 2; }
  .check-row { grid-template-columns: 1fr; }
  .form-layout-container { grid-template-columns: 1fr; }
  .form-layout-container.execution-only { grid-template-columns: 1fr; }
  .execution-column { position: static; }
  .execution-sticky-panel { border-top-width: 3px; }
}

@media (max-width: 760px) {
  .content {
    max-width: 100vw;
  }

  .top20-filters,
  .top20-tabs,
  .dashboard-scope-tabs,
  .quick-filter-row {
    margin-left: -2px;
    margin-right: -2px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .top20-tabs {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    padding-bottom: 0;
  }

  .top20-tabs button {
    width: 100%;
    justify-content: space-between;
    white-space: normal;
    text-align: left;
  }

  .top20-filters {
    flex-wrap: wrap;
    overflow: visible;
  }

  .top20-filters button {
    flex: 1 1 calc(50% - 8px);
    white-space: normal;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  tr.unavailable-row {
    border-color: #dfb7b2;
    border-left: 3px solid var(--red);
  }

  tr.inconsistent-row {
    border-color: #f4c49d;
    border-left: 3px solid #d9480f;
  }

  th,
  td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    font-size: 14px;
  }

  td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  td button {
    width: 100%;
  }

  tbody tr:hover td,
  tr.unavailable-row td,
  tr.unavailable-row:hover td {
    background: transparent;
  }

  .situation {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  button, input, select {
    min-height: 44px;
  }

  textarea {
    min-height: 96px;
  }

  .login-panel {
    min-height: auto;
    padding: 22px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-panel h1 { font-size: 24px; }
  .login-brandmark {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
  }

  .content {
    padding: 10px 12px 12px;
    gap: 12px;
  }

  .side {
    padding: 10px;
  }

  .brand {
    display: grid;
    gap: 2px;
    align-items: start;
  }

  .brand span {
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sync-card {
    grid-template-columns: 1fr;
    font-size: 12px;
  }

  .sync-card button {
    grid-column: span 2;
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
    margin: -10px -12px 0 -12px;
    padding: 12px;
  }

  .topbar h2 {
    font-size: 22px;
    line-height: 1.15;
  }

  .actions,
  .topbar > button {
    width: 100%;
  }

  .actions button,
  .topbar > button {
    flex: 1 1 160px;
  }

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

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

  .top20-filters button {
    flex-basis: 100%;
  }

  .badge {
    max-width: 100%;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .dashboard-metrics,
  .dashboard-grid,
  .dashboard-grid.compact,
  .inventory-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .dashboard-hero h2 {
    font-size: 24px;
  }

  .dashboard-hero-actions,
  .dashboard-hero-actions button {
    width: 100%;
  }

  .progress-row,
  .dashboard-list-item {
    grid-template-columns: 1fr;
  }

  .progress-row strong,
  .dashboard-list-item > span:last-child {
    text-align: left;
  }

  .wide, .half { grid-column: span 1; }

  .metric,
  .panel {
    border-radius: 6px;
  }

  .metric {
    padding: 12px;
  }

  .metric b {
    font-size: 22px;
  }

  .panel {
    padding: 12px;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel-title button {
    width: 100%;
  }

  .check-row {
    padding: 10px;
  }

  .check-row strong {
    font-size: 15px;
  }

  .segmented button {
    min-height: 42px;
    font-size: 15px;
  }

  .drop-zone {
    padding: 12px;
  }

  .toast-container {
    top: 12px;
    width: calc(100vw - 24px);
  }

  td {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  td::before {
    font-size: 11px;
    text-transform: uppercase;
  }

  .quick-filter-panel {
    margin-top: -2px;
    padding: 8px;
  }

  .quick-filter-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .quick-filter-row {
    align-items: stretch;
  }

  .quick-filter-row span {
    flex-basis: 68px;
    align-self: center;
  }

  .quick-filter-row button {
    min-height: 40px;
  }

  .service-instruction-head {
    flex-direction: column;
    gap: 10px;
  }

  .service-instruction-head h3 {
    font-size: 21px;
  }

  .service-instruction-meta {
    grid-template-columns: 1fr 1fr;
  }

  .service-instruction-body {
    font-size: 15px;
  }

  .modal-backdrop {
    padding: 8px;
    place-items: end center;
  }

  .modal-panel {
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
    padding: 12px;
  }

  .modal-head,
  .modal-actions {
    flex-direction: column;
  }

  .modal-head button,
  .modal-actions button {
    width: 100%;
  }

  .modal-meta {
    grid-template-columns: 1fr 1fr;
  }

  .content div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .content div[style*="grid-template-columns: 1fr 2fr"],
  .content div[style*="grid-template-columns: 1fr 1fr 1fr"],
  .content div[style*="grid-template-columns: repeat(auto-fill"] {
    grid-template-columns: 1fr !important;
  }
}

/* Print Styles for PDF Generation */
.metric.compact {
  min-height: 76px;
  padding: 16px;
}

.basic-data-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.suggestion-form {
  display: grid;
  gap: 14px;
}

.suggestion-title-field input {
  min-height: 44px;
  font-size: 16px;
}

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

.suggestion-list {
  display: grid;
  gap: 12px;
}

.suggestion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.suggestion-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.suggestion-card h3 {
  margin: 6px 0 2px;
  font-size: 20px;
}

.suggestion-category,
.suggestion-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.suggestion-category {
  background: #edf6fc;
  color: #286a9a;
  border-color: #bed5e7;
}

.suggestion-status.neutral {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.suggestion-status.warning {
  background: #fff7e8;
  color: #9a671e;
  border-color: #ecd4a6;
}

.suggestion-status.success {
  background: #e8f2ec;
  color: #164f36;
  border-color: #c5dbce;
}

.suggestion-status.danger {
  background: #fff0ee;
  color: #aa3a32;
  border-color: #dfb7b2;
}

.suggestion-date {
  color: var(--soft);
  margin: 0;
}

.suggestion-description {
  margin: 14px 0 0;
  white-space: normal;
  line-height: 1.55;
}

.suggestion-decision {
  margin-top: 14px;
  padding: 12px;
  background: var(--surface-2);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
}

.suggestion-decision p {
  margin: 6px 0 0;
}

.suggestion-review {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.badge.success {
  background: #e8f2ec;
  border-color: #c5dbce;
  color: #164f36;
}

.badge.danger {
  background: #fff0ee;
  border-color: #dfb7b2;
  color: #aa3a32;
}

.badge.warning {
  background: #fff7e8;
  border-color: #ecd4a6;
  color: #9a671e;
}

.badge.neutral {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

@media (max-width: 900px) {
  .suggestion-form-grid,
  .suggestion-review {
    grid-template-columns: 1fr;
  }

  .suggestion-card-head {
    display: grid;
  }
}

@media print {
  /* Hide navigation, top bars, buttons, dropzones, and floating elements */
  .side, 
  .topbar, 
  .actions,
  .drop-zone,
  .portal-warning,
  button, 
  .btn,
  #sync, 
  #geo, 
  #logout,
  datalist,
  .basic-data-card {
    display: none !important;
  }

  /* Reset layout structure to occupy full printable area */
  html, body, #app, .shell, .content {
    background: #fff !important;
    color: #000 !important;
    font-size: 9.5pt !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .content, .shell, #app {
    display: block !important;
  }

  .content {
    padding: 6mm !important;
  }

  /* Form and columns layout optimization */
  .form-layout-container {
    display: block !important;
    width: 100% !important;
  }

  .reference-column {
    display: block !important;
    width: 100% !important;
  }

  .execution-column {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin-top: 8px !important;
  }

  /* Compact Service Instruction */
  .service-instruction-panel {
    padding: 5px !important;
    margin-bottom: 6px !important;
  }
  .service-instruction-panel .service-instruction-head,
  .service-instruction-panel .service-instruction-meta {
    display: none !important;
  }
  .service-instruction-panel .service-instruction-body {
    font-size: 8.5pt !important;
    line-height: 1.15 !important;
    margin: 0 !important;
  }

  /* Clean panel boundaries for printing */
  .panel {
    border: 1px solid #ddd !important;
    background: #fff !important;
    box-shadow: none !important;
    margin-bottom: 8px !important;
    padding: 5px !important;
    page-break-inside: auto !important;
  }

  .panel-title {
    border-bottom: 1.5px solid #333 !important;
    padding-bottom: 2px !important;
    margin-bottom: 5px !important;
    page-break-inside: avoid !important;
  }

  .panel-title h3 {
    color: #000 !important;
    font-size: 10pt !important;
    margin: 0 !important;
  }

  /* Form grids formatted as inline-blocks to avoid CSS Grid print bugs */
  .form-grid {
    display: block !important;
    width: 100% !important;
  }

  .form-grid .field {
    display: inline-block !important;
    width: 48% !important;
    margin-right: 1% !important;
    vertical-align: top !important;
    border-bottom: 1px dashed #eee !important;
    padding: 1px 0 !important;
    page-break-inside: avoid !important;
  }

  .form-grid .field.wide,
  .form-grid .field[style*="grid-column: span 2"] {
    width: 98% !important;
    margin-right: 0 !important;
  }

  /* Field details */
  .field label {
    font-weight: bold !important;
    font-size: 8pt !important;
    color: #333 !important;
    margin-bottom: 1px !important;
  }

  .field input, 
  .field textarea,
  .field select {
    border: none !important;
    background: transparent !important;
    font-size: 9pt !important;
    padding: 0 !important;
    color: #000 !important;
    width: 100% !important;
    box-shadow: none !important;
  }

  /* Checkbox styling */
  input[type="checkbox"] {
    width: 11px !important;
    height: 11px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid #000 !important;
    background: #fff !important;
    position: relative !important;
    display: inline-block !important;
  }

  input[type="checkbox"]:checked::after {
    content: 'X' !important;
    font-size: 7.5px !important;
    font-weight: bold !important;
    color: #000 !important;
    position: absolute !important;
    top: -2.5px !important;
    left: 1px !important;
  }

  /* Tables styling */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 5px !important;
    page-break-inside: avoid !important;
  }

  th, td {
    border: 1px solid #ccc !important;
    padding: 3px !important;
    font-size: 8pt !important;
    text-align: left !important;
  }

  th {
    background-color: #f2f2f2 !important;
    color: #000 !important;
    font-weight: bold !important;
  }

  /* Badges formatting */
  .badge {
    border: 1px solid #999 !important;
    background: transparent !important;
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    font-size: 7.5px !important;
    padding: 1px 3px !important;
    border-radius: 2px !important;
  }

  .badge.red {
    border: 1px solid #d32f2f !important;
    color: #d32f2f !important;
  }

  /* Checklist print styles using stable blocks instead of flexbox */
  .checklist {
    display: block !important;
    width: 100% !important;
  }

  .check-row {
    display: block !important;
    width: 100% !important;
    border-bottom: 1px solid #eee !important;
    padding: 2px 0 !important;
    page-break-inside: avoid !important;
    background: transparent !important;
  }

  .check-row textarea {
    border: 1px solid #ccc !important;
    width: 100% !important;
    margin-top: 2px !important;
    padding: 1px 2px !important;
    font-size: 8pt !important;
    background: #fafafa !important;
  }

  /* Checklist buttons */
  .segmented {
    display: inline-flex !important;
    border: 1px solid #777 !important;
    border-radius: 3px !important;
  }

  .segmented button {
    display: none !important;
    border: none !important;
    background: transparent !important;
    padding: 1px 3px !important;
    font-size: 7.5pt !important;
    font-weight: bold !important;
    color: #333 !important;
  }

  .segmented button.active {
    display: inline-block !important;
    background: #ddd !important;
  }

  /* Photo print formatting using stable inline-blocks */
  .photo-grid-print {
    display: block !important;
    width: 100% !important;
  }

  .photo-card {
    display: inline-block !important;
    width: 15% !important;
    margin-right: 1% !important;
    vertical-align: top !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    padding: 2px !important;
  }

  .photo-card img {
    width: 100% !important;
    height: 55px !important;
    object-fit: cover !important;
  }

  /* Page break rules */
  .page-break {
    page-break-before: always !important;
  }
}

/* ── Admin danger button ─────────────────────────────────────────────── */
.danger-btn {
  color: #c0392b !important;
  border-color: #e8c0bc !important;
}

.danger-btn:hover {
  background: #fff0ee !important;
  border-color: #dfb7b2 !important;
}

/* Collapsible adjustments section */
.adjustment-files-disclosure {
  padding: 0 !important;
  overflow: hidden;
}

.adjustment-files-disclosure summary {
  padding: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
}

.adjustment-files-disclosure summary::-webkit-details-marker {
  display: none;
}

.adjustment-files-disclosure summary:hover {
  background: var(--surface-2);
}

.adjustment-files-disclosure summary > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adjustment-files-disclosure summary > span:first-child small {
  color: var(--soft);
  font-weight: normal;
}

.adjustment-summary-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.disclosure-chevron {
  font-size: 14px;
  font-weight: bold;
  color: var(--soft);
  transition: transform 0.2s ease;
  display: inline-block;
}

.adjustment-files-disclosure[open] .disclosure-chevron {
  transform: rotate(180deg);
}

.adjustment-disclosure-content {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.adjustment-file-list {
  display: grid;
  gap: 10px;
}

.adjustment-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  gap: 16px;
}

.adjustment-file-item b {
  display: block;
  font-size: 14px;
}

.adjustment-file-item small {
  color: var(--soft);
  font-size: 12px;
}

.adjustment-file-item .actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .adjustment-file-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .adjustment-file-item .actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* User Area Premium Styles */
.ua-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .ua-tabs {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
  }
}

.ua-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ua-tab:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.ua-tab.active {
  background: var(--brand-soft, #e8f5ed);
  border-color: var(--brand, #2e7d32);
  color: var(--brand-dark, #1b5e20);
  font-weight: 600;
}

.ua-tab-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.ua-tab-count {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ua-tab-label {
  opacity: 0.85;
}

.ua-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.ua-search-bar {
  margin-bottom: 18px;
}

.ua-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--background, #fafafa);
}

.ua-search-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}

.ua-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

.ua-table th {
  background: var(--background, #f8f9fa);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted, #555);
  border-bottom: 1px solid var(--border);
}

.ua-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.ua-table tbody tr:hover td {
  background: var(--background, #fafafa);
}

.ua-cell-mono {
  font-family: monospace;
  font-size: 13px;
  color: var(--brand-dark, #1b5e20);
}

.ua-cell-date {
  white-space: nowrap;
  font-size: 13px;
  color: var(--soft);
}

.ua-table-count {
  font-size: 13px;
  color: var(--soft);
  margin: 8px 0 0 0;
}

/* User Area Download Banner */
.ua-download-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f0fdf4 0%, #e8f5ed 100%);
  border: 1px solid #c5dbce;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ua-download-banner-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #164f36;
}

.ua-download-banner-info p {
  margin: 0;
  font-size: 13px;
  color: #2b5c43;
}

.ua-download-btn {
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

@media (max-width: 600px) {
  .ua-download-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .ua-download-btn {
    width: 100%;
  }
}

/* ── Loading indicator ── */
@keyframes sge-spin {
  to { transform: rotate(360deg); }
}

@keyframes sge-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: sge-spin .7s linear infinite;
}

.loading-indicator p {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  animation: sge-pulse 1.6s ease-in-out infinite;
}

.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 600px;
}

.loading-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: sge-shimmer 1.4s ease-in-out infinite;
}

.loading-skeleton-line:nth-child(2) { width: 75%; }
.loading-skeleton-line:nth-child(3) { width: 50%; }

@keyframes sge-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Standardized RT Report styling */
.rt-print-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.rt-print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.rt-print-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.rt-print-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--soft);
}

.rt-print-meta-table {
  width: 100%;
  margin-bottom: 16px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.rt-print-meta-table td {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--line) !important;
}

.rt-print-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.rt-print-data-table th, 
.rt-print-data-table td {
  border: 1px solid var(--line) !important;
  padding: 8px 12px !important;
  font-size: 13px;
  color: var(--ink);
}

.rt-print-data-table th {
  background-color: var(--surface-2) !important;
  font-weight: bold;
  text-align: center;
}

.rt-print-data-table td:first-child {
  font-weight: bold;
  background-color: var(--surface-2);
  width: 30%;
}

.rt-print-data-table td:not(:first-child) {
  text-align: center;
  width: 23.33%;
}

.rt-print-data-table tr.section-row td {
  background-color: var(--surface-2) !important;
  text-align: left !important;
  font-weight: bold;
  font-size: 12px;
  color: var(--brand) !important;
  padding: 8px 12px !important;
}

@media print {
  .rt-print-container {
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    color: #000 !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  
  .rt-print-header {
    border-bottom: 2px solid #000 !important;
  }
  
  .rt-print-header h2 {
    color: #000 !important;
    font-size: 13pt !important;
  }
  
  .rt-print-header p {
    color: #555 !important;
  }
  
  .rt-print-meta-table,
  .rt-print-meta-table td,
  .rt-print-data-table,
  .rt-print-data-table th,
  .rt-print-data-table td {
    border: 1px solid #000 !important;
  }
  
  .rt-print-meta-table td,
  .rt-print-data-table th,
  .rt-print-data-table td {
    padding: 4px 6px !important;
    font-size: 8.5pt !important;
    color: #000 !important;
  }
  
  .rt-print-data-table th {
    background-color: #f2f2f2 !important;
  }
  
  .rt-print-data-table td:first-child {
    background-color: #fcfcfc !important;
  }
  
  .rt-print-data-table tr.section-row td {
    background-color: #e2ede2 !important;
    color: #1a6837 !important;
    font-size: 9pt !important;
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .execution-sticky-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-panel {
    max-height: calc(92vh + env(safe-area-inset-bottom));
  }
}

/* Ficha de inspeção de regulador — leitura e preenchimento em campo */
.psvt-field-screen {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.psvt-field-topbar {
  align-items: center;
  padding: 2px 2px 4px;
}

.psvt-form-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.psvt-field-context {
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #f3faf6 0%, #fff 72%);
}

.psvt-field-context .panel-title {
  align-items: flex-start;
}

.psvt-field-context .panel-title h3 {
  margin-top: 0;
}

.psvt-field-context-grid {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) minmax(0, 1.55fr);
  gap: 10px;
}

.psvt-field-context-grid > div,
.psvt-field-observation {
  min-width: 0;
  border: 1px solid #d7e5db;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  padding: 11px 12px;
}

.psvt-field-context-grid span,
.psvt-field-observation > span {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.psvt-field-context-grid strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.psvt-field-observation {
  margin-top: 10px;
  border-color: #ead5aa;
  background: #fffaf0;
}

.psvt-field-observation p {
  margin: 0;
  color: #604b24;
  line-height: 1.5;
}

.psvt-field-screen .psvt-single-inspection .psvt-inspection-card {
  width: min(1120px, 100%);
}

.psvt-rt-form {
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: #bfd6c7;
  background: #f5f8f6;
  box-shadow: 0 12px 30px rgba(30, 48, 36, .08);
}

.psvt-rt-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #cfe0d4;
  background: linear-gradient(135deg, #eaf5ee 0%, #f8fcfa 70%);
}

.psvt-rt-form-header h3,
.psvt-rt-form-header p {
  margin: 0;
}

.psvt-rt-form-header h3 {
  font-size: 23px;
  letter-spacing: -.02em;
}

.psvt-rt-form-header p {
  max-width: 62ch;
  margin-top: 5px;
  color: var(--soft);
  line-height: 1.45;
}

.psvt-form-section {
  margin: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}

.psvt-form-section-primary {
  border-color: #c6dbcf;
  background: #fbfefc;
}

.psvt-form-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.psvt-form-section-heading span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.psvt-form-section-heading small {
  color: var(--soft);
  text-align: right;
}

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

.psvt-rt-form .psvt-form-section-primary .form-grid,
.psvt-rt-form .psvt-form-finalization .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.psvt-rt-form .field {
  gap: 7px;
}

.psvt-rt-form .field label {
  color: #34483b;
  font-size: 12px;
}

.psvt-rt-form input,
.psvt-rt-form select,
.psvt-rt-form textarea {
  min-height: 46px;
  border-color: #cbd8ce;
  background: #fff;
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.psvt-rt-form textarea {
  min-height: 108px;
}

.psvt-rt-form input:focus,
.psvt-rt-form select:focus,
.psvt-rt-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 74, .14);
}

.psvt-rt-form input:disabled,
.psvt-rt-form select:disabled,
.psvt-rt-form textarea:disabled {
  background: #f0f3f1;
  color: #536159;
  opacity: 1;
}

.psvt-rt-form .psvt-piece-fieldset {
  margin: 18px 16px;
  overflow: hidden;
  border-color: #b8d2c1;
  border-radius: 12px;
  background: #fff;
  padding: 0;
  box-shadow: 0 5px 16px rgba(30, 48, 36, .05);
}

.psvt-rt-form .psvt-piece-fieldset legend {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #cfe0d4;
  background: #eaf5ee;
  padding: 13px 16px;
}

.psvt-rt-form .psvt-piece-fieldset legend span {
  color: var(--brand-2);
  font-size: 17px;
  font-weight: 900;
}

.psvt-rt-form .psvt-piece-fieldset legend small {
  color: #476555;
  font-size: 12px;
  font-weight: 700;
}

.psvt-piece-status {
  display: grid;
  grid-template-columns: minmax(210px, .6fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-bottom: 1px solid #d6e3da;
  background: #f8fcfa;
}

.psvt-piece-status > .field {
  margin: 0;
}

.psvt-piece-status select[data-psvt-piece-situation] {
  border-color: #9fc4ac;
  color: var(--brand-2);
  font-weight: 800;
}

.psvt-bypass-fields {
  display: none;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, .5fr);
  gap: 12px;
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  background: #fff8e9;
  padding: 12px;
}

.psvt-piece-status:has(select[data-psvt-piece-situation] option[value="Bypassado"]:checked) {
  background: #fffaf0;
}

.psvt-piece-status:has(select[data-psvt-piece-situation] option[value="Bypassado"]:checked) .psvt-bypass-fields {
  display: grid;
}

.psvt-bypass-fields .field {
  margin: 0;
}

.psvt-bypass-fields textarea {
  min-height: 76px;
}

.psvt-piece-section {
  padding: 16px;
  border-bottom: 1px solid #e2e8e3;
}

.psvt-piece-section:last-of-type {
  border-bottom: 0;
}

.psvt-piece-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.psvt-piece-section-title span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 50%;
  background: #dcece2;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 900;
}

.psvt-piece-section-title strong {
  font-size: 14px;
}

.psvt-piece-measurements {
  background: #f4f9fc;
}

.psvt-piece-measurements .psvt-piece-section-title span {
  background: #dcecf7;
  color: #1e5f8c;
}

.psvt-piece-measurements input {
  border-color: #bfd5e4;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.psvt-add-piece,
.psvt-remove-piece {
  min-height: 44px;
  font-weight: 700;
}

.psvt-add-piece {
  margin: 0 16px 16px;
  border-color: #a9c9b4;
  color: var(--brand-2);
}

.psvt-remove-piece {
  margin: 0 16px 16px;
  color: var(--red);
}

.psvt-form-finalization {
  border-color: #a9c9b4;
  background: #f8fcfa;
}

.psvt-rt-form .psvt-confirmation {
  min-height: 52px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.psvt-rt-form .psvt-confirmation input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--brand);
}

.psvt-confirmation-final {
  border-color: #9bc4aa;
  background: #eaf5ee;
  color: var(--brand-2);
}

.psvt-field-screen .psvt-equipment-save {
  margin-top: 0;
  border-color: #c7d8cc;
  box-shadow: 0 -8px 24px rgba(30, 48, 36, .08);
}

.psvt-field-screen .psvt-equipment-save button {
  min-height: 50px;
  font-size: 15px;
}

@media (max-width: 820px) {
  .psvt-field-context-grid,
  .psvt-rt-form .form-grid,
  .psvt-rt-form .psvt-form-section-primary .form-grid,
  .psvt-rt-form .psvt-form-finalization .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .psvt-field-screen {
    gap: 10px;
  }

  .psvt-field-topbar {
    align-items: stretch;
  }

  .psvt-field-topbar > button {
    min-height: 48px;
  }

  .psvt-field-context {
    padding: 14px;
  }

  .psvt-field-context-grid,
  .psvt-rt-form .form-grid,
  .psvt-rt-form .psvt-form-section-primary .form-grid,
  .psvt-rt-form .psvt-form-finalization .form-grid {
    grid-template-columns: 1fr;
  }

  .psvt-field-context-grid {
    gap: 8px;
  }

  .psvt-rt-form {
    border-radius: 8px;
  }

  .psvt-rt-form-header {
    display: grid;
    padding: 17px 14px;
  }

  .psvt-rt-form-header h3 {
    font-size: 21px;
  }

  .psvt-rt-form-header .badge {
    width: fit-content;
  }

  .psvt-form-section {
    margin: 12px 10px;
    padding: 14px 12px;
  }

  .psvt-form-section-heading {
    display: grid;
    gap: 4px;
  }

  .psvt-form-section-heading small {
    text-align: left;
    line-height: 1.4;
  }

  .psvt-rt-form .psvt-piece-fieldset {
    margin: 14px 10px;
  }

  .psvt-rt-form .psvt-piece-fieldset legend {
    padding: 13px 12px;
  }

  .psvt-piece-status,
  .psvt-bypass-fields {
    grid-template-columns: 1fr;
  }

  .psvt-piece-status {
    padding: 14px 12px;
  }

  .psvt-bypass-fields {
    border-left-width: 0;
    border-top: 3px solid var(--yellow);
  }

  .psvt-piece-section {
    padding: 14px 12px;
  }

  .psvt-rt-form input,
  .psvt-rt-form select {
    min-height: 50px;
    font-size: 16px;
  }

  .psvt-rt-form textarea {
    min-height: 120px;
    font-size: 16px;
  }

  .psvt-add-piece,
  .psvt-remove-piece {
    width: calc(100% - 20px);
    min-height: 48px;
    margin: 0 10px 14px;
  }

  .psvt-field-screen .psvt-equipment-save {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 0 -12px -12px;
    border-radius: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .psvt-field-screen .psvt-equipment-save button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
  }
}

@media (min-width: 360px) and (max-width: 760px) {
  .guide-list tbody {
    gap: 14px;
  }

  .guide-list tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #b9d1c1;
    border-top: 4px solid var(--brand);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(30, 48, 36, .08);
  }

  .guide-list td {
    grid-template-columns: 1fr;
    gap: 4px;
    align-content: start;
    align-items: start;
    min-width: 0;
    padding: 10px 12px;
  }

  .guide-list td:nth-child(even):not(:last-child) {
    border-right: 1px solid var(--line);
  }

  .guide-list td:first-child,
  .guide-list td:last-child {
    grid-column: 1 / -1;
  }

  .guide-list td:first-child {
    background: #f1f8f3;
    color: var(--brand-2);
    font-size: 16px;
    font-weight: 800;
  }

  .guide-list td:last-child {
    width: auto;
    padding: 12px;
    background: #f7fbf8;
    white-space: normal;
  }
}

@media (max-width: 359px) {
  .guide-list tbody {
    gap: 14px;
  }

  .guide-list tr {
    border-color: #b9d1c1;
    border-top: 4px solid var(--brand);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(30, 48, 36, .08);
  }

  .guide-list td:first-child {
    background: #f1f8f3;
    color: var(--brand-2);
    font-size: 16px;
    font-weight: 800;
  }

  .guide-list td:last-child {
    width: auto;
    padding: 12px;
    background: #f7fbf8;
    white-space: normal;
  }
}

.guide-open-button {
  min-height: 46px;
  border-color: var(--brand);
  font-weight: 800;
}

.guide-solicitacao-value {
  font-weight: 700;
  color: #111b15;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.guide-device-value {
  font-weight: 700;
  color: #0f172a;
}

/* Posicionamento do botão flutuante Preparar Offline para evitar sobreposição no mobile */
.sge-offline-button {
  position: fixed !important;
  left: 16px !important;
  right: auto !important;
  bottom: 16px !important;
  z-index: 1100 !important;
}

@media (max-width: 600px) {
  .sge-offline-button {
    position: fixed !important;
    left: 12px !important;
    right: auto !important;
    bottom: 75px !important;
  }
}

/* ==========================================================================
   Central de Downloads & Biblioteca Técnica - Modern UI Styles
   ========================================================================== */

.downloads-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 0 32px 0;
}

.downloads-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.downloads-header-title h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.downloads-header-title p {
  color: #64748b;
  font-size: 0.92rem;
  margin: 0;
}

.downloads-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 20px;
  border: 1px solid #bae6fd;
}

/* Controls / Filter Card */
.downloads-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.category-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-pill-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.category-pill-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.filter-inputs-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .filter-inputs-row {
    grid-template-columns: 1fr;
  }
}

.search-input-box {
  position: relative;
  width: 100%;
}

.search-input-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  padding-left: 38px !important;
}

/* Downloads Grid & Cards */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 20px;
}

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

.dl-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.dl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dl-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dl-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dl-tag.category-software { background: #e0f2fe; color: #0369a1; }
.dl-tag.category-driver { background: #f3e8ff; color: #7e22ce; }
.dl-tag.category-ajuste_padrao { background: #dcfce7; color: #15803d; }
.dl-tag.category-manual { background: #ffedd5; color: #c2410c; }
.dl-tag.category-outros { background: #f1f5f9; color: #475569; }

.dl-tag.equipment-tag {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.dl-version-pill {
  padding: 3px 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.dl-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.dl-card-title svg {
  color: #0284c7;
  flex-shrink: 0;
  margin-top: 2px;
}

.dl-card-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.dl-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #64748b;
  flex-wrap: wrap;
}

.dl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.dl-meta-item strong {
  color: #0f172a;
}

/* Interactive File Tree */
.tree-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}

.tree-box-header {
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tree-box-body {
  padding: 10px 12px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.tree-folder {
  margin-bottom: 4px;
}

.tree-folder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  transition: background 0.15s ease;
  list-style: none;
}

.tree-folder-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tree-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-folder-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.tree-folder-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.tree-folder summary::-webkit-details-marker {
  display: none;
}

.tree-folder summary:hover {
  background: #e2e8f0;
}

.tree-folder summary .folder-arrow {
  transition: transform 0.2s ease;
  color: #64748b;
}

.tree-folder[open] > summary .folder-arrow {
  transform: rotate(90deg);
}

.tree-folder-icon {
  color: #d97706;
}

.tree-children {
  padding-left: 18px;
  border-left: 1px dashed #cbd5e1;
  margin-left: 14px;
  margin-top: 2px;
}

.tree-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.84rem;
  transition: background 0.15s ease;
}

.tree-file-row:hover {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.tree-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tree-file-icon {
  flex-shrink: 0;
}

.tree-file-icon.pdf { color: #dc2626; }
.tree-file-icon.csv, .tree-file-icon.xlsx { color: #16a34a; }
.tree-file-icon.docx, .tree-file-icon.doc { color: #0284c7; }
.tree-file-icon.txt, .tree-file-icon.cfg { color: #475569; }
.tree-file-icon.zip, .tree-file-icon.rar { color: #d97706; }
.tree-file-icon.default { color: #64748b; }

.tree-file-name {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-file-size {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

.tree-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tree-file-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Card Main Download Button */
.dl-main-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0284c7;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.dl-main-btn:hover {
  background: #0369a1;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   PSVT Execution Wizard Redesign (4-Step Flow)
   ========================================================================== */
.psvt-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,0.03));
  overflow-x: auto;
}

.psvt-wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 140px;
}

.psvt-wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line, #e2e8f0);
  color: var(--soft, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.psvt-wizard-step.active .psvt-wizard-step-num {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
}

.psvt-wizard-step.completed .psvt-wizard-step-num {
  background: #10b981;
  color: #ffffff;
}

.psvt-wizard-step-info {
  display: flex;
  flex-direction: column;
}

.psvt-wizard-step-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink, #0f172a);
}

.psvt-wizard-step-sub {
  font-size: 0.72rem;
  color: var(--soft, #64748b);
}

.psvt-wizard-divider {
  height: 2px;
  flex: 0 0 20px;
  background: var(--line, #e2e8f0);
}

/* Custom segmented buttons for Checklist */
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #f1f5f9);
  transition: background 0.15s ease;
}

.check-row:hover {
  background: rgba(248, 250, 252, 0.8);
}

.segmented {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
}

.segmented button.active[data-val="Sim"] {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.segmented button.active[data-val="Não"] {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.segmented button.active[data-val="N/A"] {
  background: #64748b !important;
  color: #ffffff !important;
}

/* Voltage Badges & Inputs */
.psvt-voltage-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.psvt-voltage-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.psvt-phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.psvt-phase-badge.phase-a { background: #dcfce7; color: #166534; }
.psvt-phase-badge.phase-b { background: #fef9c3; color: #854d0e; }
.psvt-phase-badge.phase-c { background: #e0f2fe; color: #075985; }
.psvt-phase-badge.phase-comp { background: #f3e8ff; color: #6b21a8; }

/* =========================================================
   CREW DISPATCH WIZARD MODAL (Step-by-Step)
   ========================================================= */
.crew-wizard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.crew-wizard-panel {
  width: 100%;
  max-width: 800px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.22s ease-out;
}

.crew-wizard-header {
  background: #0f172a;
  padding: 22px 26px 18px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crew-wizard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.crew-wizard-title-row h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.crew-wizard-title-row p {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 0;
}

.crew-wizard-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.crew-wizard-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.crew-stepper-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.crew-step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s;
}

.crew-step-tab.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

.crew-step-tab.completed {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
}

.crew-step-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.crew-step-tab.active .crew-step-num {
  background: #10b981;
  color: #ffffff;
}

.crew-step-tab.completed .crew-step-num {
  background: #059669;
  color: #ffffff;
}

.crew-step-texts {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crew-step-sub {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
}

.crew-step-title {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.crew-wizard-body {
  padding: 20px 24px;
  max-height: 480px;
  min-height: 380px;
  overflow-y: auto;
  background: #f8fafc;
}

.crew-step-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: fadeInPane 0.2s ease;
}

.crew-step-pane.active {
  display: flex;
}

.crew-step-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.crew-step-intro h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.crew-step-intro p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}

.crew-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #334155;
}

.crew-vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.crew-vehicle-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s;
}

.crew-vehicle-card:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.crew-vehicle-card.selected {
  border-color: #10b981;
  background: #ecfdf5;
}

.crew-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.crew-member-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.crew-member-card:hover {
  border-color: #94a3b8;
}

.crew-member-card.selected {
  border-color: #10b981;
  background: #ecfdf5;
}

.crew-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crew-member-card.selected .crew-avatar {
  background: #10b981;
  color: #ffffff;
}

.crew-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 42px;
  align-items: center;
}

.crew-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.crew-chip.current-user {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.crew-chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
}

.crew-chip-remove:hover {
  color: #ef4444;
}

.crew-orders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.crew-order-row {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.crew-order-row:hover {
  border-color: #94a3b8;
}

.crew-order-row.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.crew-order-row .check-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.crew-order-row.selected .check-box {
  background: #2563eb;
  border-color: #2563eb;
}

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

.crew-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crew-summary-card-head {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.crew-wizard-footer {
  background: #ffffff;
  padding: 14px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Leaflet Map Essential Core Reset (prevents tile vertical stacking/misalignment)
   ========================================================================== */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute !important;
  left: 0;
  top: 0;
}

.leaflet-container {
  overflow: hidden !important;
  position: relative !important;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  width: 256px !important;
  height: 256px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
}

.leaflet-tile {
  filter: inherit;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}


