/* ==========================================================================
   NOCTALIA HIGH-DENSITY OPERATIONAL WORKSPACE (FULL VERTICAL DRAWER)
   ========================================================================== */
 
:root {
  --ink: #233c4c;
  --muted: #607583;
  --line: #e1e8ed;
  --shell: #1d303d;
  --bg: #f3f4f6;
  --pond: #214a63;
  --papaya: #f7a287;
}
 
* {
  box-sizing: border-box;
}
 
body {
  margin: 0;
  background: var(--bg);
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
 
main {
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: 100% !important; /* Replaces 1840px limit */
  width: 100vw;
  margin: 0;
  padding: 0 8px 4px 8px; /* Tighter edge breathing room */
  overflow: hidden;
}
 
/* ==========================================================================
   TASKBAR & GAVETA INTEGRADA (SLIDE DIRETAMENTE DA BARRA)
   ========================================================================== */
.app-header.taskbar {
  position: relative !important;
  width: fit-content;
  min-width: min(580px, calc(100vw - 24px));
  max-width: calc(100% - 20px);
  height: 38px;
  min-height: 38px;
  margin: 0 auto 6px auto !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 2px 10px;
  gap: 12px;
  border: 0;
  border-radius: 0 0 14px 14px;
  background: var(--shell);
  color: #eaf1f5;
  box-shadow: 0 4px 14px rgba(23, 45, 60, 0.15);
  z-index: 1250 !important;
  flex-shrink: 0;
  transition: border-radius 0.2s ease;
}
 
.taskbar.drawer-open {
  border-radius: 0 0 0 0 !important;
}
 
.taskbar .taskbar-brand {
  display: flex;
  padding: 0 6px;
  align-items: center;
}
 
.taskbar .logo {
  color: #f1f5f7;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
 
.taskbar .logo span {
  color: var(--papaya);
}
 
.taskbar .taskbar-center {
  gap: 8px;
  display: flex;
  align-items: center;
}
 
.taskbar .workspace-nav > div {
  gap: 3px;
  display: flex;
}
 
.taskbar .workspace-nav button {
  color: #c1cfd7;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
 
.taskbar .workspace-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}
 
.taskbar .workspace-nav button.selected {
  background: #344c5c;
  color: #fff;
  font-weight: 600;
}
 
.taskbar .workspace-nav button span {
  background: rgba(255, 255, 255, 0.12);
  color: #b9cbd6;
  border-radius: 4px;
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 3px;
}
 
.taskbar .workspace-nav button.selected span {
  background: #96bbd0;
  color: #193747;
}
 
.taskbar-divider {
  background: rgba(255, 255, 255, 0.14);
  height: 16px;
  width: 1px;
}
 
.taskbar .header-new-btn {
  height: 28px;
  min-height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8f0f5;
  border-radius: 7px;
  padding: 0 8px 0 4px;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}
 
.taskbar .header-new-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
 
.taskbar.drawer-open .header-new-btn,
.taskbar .header-new-btn[aria-expanded="true"] {
  background: #2a4456;
  border-color: var(--papaya);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(247, 162, 135, 0.3);
}
 
.taskbar .header-new-btn .btn-icon {
  background: var(--papaya);
  border-radius: 5px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d303d;
  font-size: 13px;
  flex-shrink: 0;
}
 
.taskbar .header-new-btn .minibar-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 1px;
}
 
.taskbar .header-new-btn .drawer-chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  color: rgba(255, 255, 255, 0.75);
}
 
.taskbar.drawer-open .header-new-btn .drawer-chevron,
.taskbar .header-new-btn[aria-expanded="true"] .drawer-chevron {
  transform: rotate(180deg);
  color: var(--papaya);
}
 
/* ==========================================================================
   GAVETA EMBUTIDA (DESLIZA DA TASKBAR COM MESMA LARGURA)
   ========================================================================== */
.new-occurrence-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  z-index: 1200;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease,
              visibility 0.22s;
}
 
.taskbar.drawer-open .new-occurrence-drawer,
.new-occurrence-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
 
.new-occurrence-drawer .drawer-surface {
  width: 100%;
  background: #ffffff;
  border: 1px solid #c9d8e2;
  border-top: 2px solid var(--papaya);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 20px 45px rgba(15, 34, 48, 0.26);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 58px);
  overflow: hidden;
}
 
.new-occurrence-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 48, 0.18);
  z-index: 1150;
  transition: opacity 0.2s ease;
}
 
.new-occurrence-backdrop[hidden] {
  display: none !important;
}
 
.new-drawer-head {
  padding: 12px 18px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
 
.new-drawer-eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
  color: var(--papaya);
  text-transform: uppercase;
  display: block;
  line-height: 1;
  margin-bottom: 3px;
}
 
.new-drawer-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--pond);
  margin: 0;
  line-height: 1.2;
}
 
.new-drawer-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
  line-height: 1.3;
}
 
.new-occurrence-form {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 10px;
  overflow-y: auto;
}
 
.new-drawer-card {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
 
.new-drawer-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
 
@media (max-width: 520px) {
  .new-drawer-grid-2 {
    grid-template-columns: 1fr;
  }
}
 
.new-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
}
 
.new-drawer-field.full {
  grid-column: 1 / -1;
  width: 100%;
}
 
.new-drawer-field > span {
  font-size: 10.5px;
  font-weight: 650;
  color: var(--pond);
}
 
.new-drawer-field input,
.new-drawer-field textarea {
  font-size: 12px;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  transition: border-color 0.15s, background-color 0.15s;
}
 
.new-drawer-field input:focus,
.new-drawer-field textarea:focus {
  border-color: var(--pond);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(33, 74, 99, 0.12);
  outline: none;
}
 
.new-drawer-field textarea {
  resize: vertical;
  min-height: 52px;
  font-family: inherit;
  line-height: 1.4;
}
 
.new-drawer-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--pond);
  margin-bottom: 2px;
}
 
.new-drawer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
 
.new-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.new-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Estado normal (desmarcado) */
.new-chip span {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  transition: all 0.12s ease;
}

.new-chip:hover span {
  background: #e2e8f0;
  color: #1e293b;
}

/* Apenas o input checado recebe a cor ativa - impossibilita múltiplos botões acesos */
.new-chip:has(input:checked) span {
  background: var(--pond, #214a63) !important;
  color: #ffffff !important;
  border-color: var(--pond, #214a63) !important;
  box-shadow: 0 1px 3px rgba(33, 74, 99, 0.25);
}

.new-chip.soon:has(input:checked) span {
  background: #c2410c !important;
  border-color: #c2410c !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(194, 65, 12, 0.25);
}

.new-chip.urgent:has(input:checked) span {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}
 
.new-extra {
  border-top: 1px dashed #e2e8f0;
  padding-top: 6px;
  margin-top: 4px;
}
 
.new-extra summary {
  font-size: 11px;
  font-weight: 600;
  color: #526b7b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  list-style: none;
}
 
.new-extra summary::-webkit-details-marker {
  display: none;
}
 
.new-extra summary::before {
  content: '▸';
  font-size: 11px;
  transition: transform 0.15s ease;
  display: inline-block;
  color: var(--papaya);
}
 
.new-extra[open] summary::before {
  transform: rotate(90deg);
}
 
.new-extra summary span {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 400;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}
 
.new-extra .new-drawer-field {
  margin-top: 8px;
}
 
.new-drawer-media-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
 
.new-drawer-media-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--pond);
}
 
#new-media-count {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
 
.new-attach-btn {
  font-size: 11px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px dashed #93b2c6;
  background: #f0f6fa;
  color: var(--pond);
  cursor: pointer;
  transition: all 0.15s ease;
}
 
.new-attach-btn:hover {
  background: var(--pond);
  color: #ffffff;
  border-style: solid;
}
 
.new-media-previews {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
}
 
.new-media-thumb-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #1e293b;
}
 
.new-media-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
 
.new-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 2px;
}
 
.new-btn-cancel {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s;
}
 
.new-btn-cancel:hover {
  background: #f1f5f9;
  color: #1e293b;
}
 
.new-btn-submit {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--pond);
  background: var(--pond);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(33, 74, 99, 0.25);
  transition: background 0.12s;
}
 
.new-btn-submit:hover {
  background: #17374b;
  border-color: #17374b;
}
 
/* ==========================================================================
   DROPDOWNS E TOAST (Z-INDEX 2000+)
   ========================================================================== */
.custom-select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 3px;
  box-sizing: border-box;
  overflow: auto;
  border: 1px solid #dce5eb;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  box-shadow: 0 12px 35px rgba(25, 55, 71, 0.15);
  font: 11px/1.4 Inter, 'Segoe UI', Arial, sans-serif;
  z-index: 2000 !important;
}
 
.custom-select-menu [role="option"] {
  padding: 5px 7px;
  border-radius: 4px;
  cursor: pointer;
}
 
.custom-select-menu [role="option"]:hover,
.custom-select-menu [role="option"].is-active {
  background: #edf3f7;
}
 
.custom-select-menu [aria-selected="true"] {
  color: var(--pond);
  font-weight: 600;
  background: #e4eef4;
}
 
#toast {
  z-index: 3000 !important;
}
 
/* ==========================================================================
   ESTRUTURA DO WORKSPACE (SPLIT 2 COLUNAS FULL-HEIGHT)
   ========================================================================== */
.workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  position: relative;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: hidden;
  margin: 0 !important;
}
 
.workspace-left {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}
 
/* Quando o Drawer abre no Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .workspace.drawer-open {
    display: grid !important;
    grid-template-columns: minmax(460px, 1fr) minmax(520px, 1.15fr) !important;
    grid-template-rows: 100% !important;
    gap: 12px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
 
  .workspace.drawer-open .workspace-left {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
 
  .workspace.drawer-open #detail {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    border: 1px solid #dce5eb !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    background: #ffffff !important;
    z-index: 10 !important;
    overflow: hidden !important;
  }
 
  .workspace.drawer-open .list-columns-bar {
    display: none !important;
  }
 
/* Linha da fila no modo compacto (Drawer aberto) */
  .workspace.drawer-open .queue-row {
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    gap: 4px 10px !important;
    padding: 8px 12px !important;
    align-items: start !important;
  }
 
  /* Linha 1, Esquerda: Apartamento e Tags na mesma linha */
  .workspace.drawer-open .col-asset {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }
 
  .workspace.drawer-open .asset-unit-row,
  .workspace.drawer-open .asset-status-row {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
 
  /* Linha 1, Direita: Prioridade (P1 Crítico), Status e Chevron */
  .workspace.drawer-open .col-action {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }
 
  .workspace.drawer-open .status-priority-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
  }
 
  /* Linha 2, Esquerda: Título, Descrição e Observação compacta */
  .workspace.drawer-open .col-task {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
 
  .workspace.drawer-open .highlight-chip {
    font-size: 10px !important;
    max-width: 100% !important;
  }
 
  /* Linha 2, Direita: "Sem equipe" e "Atrasado" abaixo do P1 Crítico */
  .workspace.drawer-open .col-schedule {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    border-top: none !important;
    padding-top: 0 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
 
  .workspace.drawer-open .assignee-wrap,
  .workspace.drawer-open .schedule-time-line {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
  }
 
  .workspace.drawer-open .col-asset {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
 
  .workspace.drawer-open .col-action {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
 
  .workspace.drawer-open .col-task {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}
 
/* ==========================================================================
   ELEMENTOS DO PAINEL ESQUERDO (HEADING, BANNER E CONTROLES)
   ========================================================================== */
.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 2px 4px;
  flex-shrink: 0;
}
 
.workspace-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #708591;
  text-transform: uppercase;
}
 
.workspace-heading h1 {
  font-size: 18px;
  letter-spacing: -0.4px;
  font-weight: 700;
  margin: 1px 0 0 0;
  color: #1e293b;
  line-height: 1.2;
}
 
.workspace-demo {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #708591;
  font-size: 11px;
}
 
.workspace-demo i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7a287;
}
 
#suggestion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #fff4e5;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 11px;
  color: #9a3412;
  margin-bottom: 6px;
  flex-shrink: 0;
}
 
#suggestion-banner button {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}
 
.control-deck {
  background: #ffffff;
  border: 1px solid #e2e9ee;
  border-radius: 10px;
  padding: 0 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
 
#attention {
  padding: 4px 0;
  gap: 4px;
  border-bottom: 1px solid #edf1f4;
  display: flex;
  overflow-x: auto;
}
 
#attention button {
  background: transparent;
  color: #617786;
  border: 0;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
 
#attention button strong {
  background: #edf2f5;
  color: #5a7383;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 4px;
}
 
#attention button.selected {
  background: #e8f0f5;
  color: #214a63;
  font-weight: 600;
}
 
#attention button.selected strong {
  background: #214a63;
  color: #fff;
}
 
.toolbar {
  padding: 5px 0;
  gap: 6px;
  display: flex;
  align-items: center;
  position: relative;
}
 
.toolbar > #search {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  flex: 1 1 160px;
  min-width: 120px;
  height: 30px;
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 8px;
}
 
.filter-menu {
  position: relative;
  flex-shrink: 0;
}
 
.filter-menu > summary {
  border: 1px solid #cbd5e1;
  font-size: 11px;
  color: #334155;
  height: 30px;
  border-radius: 6px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  cursor: pointer;
  list-style: none;
}
 
.filter-menu > summary::-webkit-details-marker {
  display: none;
}
 
.filter-panel {
  position: absolute;
  top: 36px;
  left: 0;
  width: 280px;
  padding: 10px;
  border: 1px solid #dbe4ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 15px 40px rgba(24, 56, 76, 0.18);
  z-index: 120;
  display: flex;
  flex-direction: column;
}
 
.filter-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
 
.filter-panel #clear {
  padding: 2px 4px;
  font-size: 10px;
  border: 0;
  color: var(--pond);
  background: transparent;
  cursor: pointer;
}
 
.filter-field {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  font-size: 10px;
  color: #526976;
}
 
.filter-panel select {
  width: 100%;
  height: 30px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-size: 11px;
}
 
.toolbar #group {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 6px;
  color: #334155;
  height: 30px;
  font-size: 11px;
}
 
.toolbar .group-select {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
 
/* ==========================================================================
   LISTA DE ORDENS (ESQUERDA)
   ========================================================================== */
.work-list {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
 
.list-header {
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
 
.list-header #list-count {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
 
.list-header #queue-summary {
  font-size: 11px;
  margin-left: auto;
  color: #64748b;
}
 
.list-columns-bar {
  display: grid;
  grid-template-columns: 180px minmax(320px, 1fr) 175px 145px;
  gap: 16px;
  padding: 6px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}
 
#list {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1 1 0%;
  min-height: 0;
  background: #f8fafc;
}
 
.queue-row {
  display: grid;
  grid-template-columns: 180px minmax(320px, 1fr) 175px 145px;
  gap: 12px;
  padding: 9px 12px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #94a3b8;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
 
.queue-row:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}
 
.queue-row.current {
  border-color: var(--pond) !important;
  border-left-color: var(--papaya) !important;
  background: #edf4f8 !important;
}
 
.queue-row.in-drawer {
  border-left-color: #3b82f6 !important;
}
 
.queue-row.indicator-overdue {
  border-left-color: #dc2626 !important;
  background: #fff8f8;
  border-color: #fecaca;
}
 
.queue-row.indicator-urgent { border-left-color: #ef4444 !important; }
.queue-row.indicator-attention { border-left-color: #f59e0b !important; }
.queue-row.indicator-ready { border-left-color: #10b981 !important; }
.queue-row.indicator-unassigned { border-left-color: #94a3b8 !important; }
 
.col-asset {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
 
.asset-unit-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
 
.apt-pill {
  display: inline-flex;
  align-items: center;
  background: #eaf1f6;
  color: #1a425a;
  border: 1px solid #c7d8e2;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
 
.building-hint {
  font-size: 9px;
  color: #526b7b;
  background: #eef3f6;
  padding: 1px 4px;
  border-radius: 3px;
}
 
.asset-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
 
.micro-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
}
 
.occupied-tag { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; }
.vacant-tag { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; font-weight: 700; }
.entry-tag { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.entry-tag.urgent-checkin { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; }
 
.col-task {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
 
.task-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
 
.occurrence-name {
  font-size: 12px;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.3;
}
 
.queue-row:hover .occurrence-name {
  color: var(--pond);
}
 
.origin-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}
 
.queue-excerpt {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #334155;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
 
.task-highlights-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  max-width: 100%;
  overflow: hidden;
}
 
.highlight-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
 
.highlight-chip.chip-obs {
  color: #854d0e;
}
 
.highlight-chip.chip-access {
  color: #475569;
}
 
.col-schedule {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
 
.assignee-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
 
.tech-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 8px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff;
  margin-right: -3px;
}
 
.tech-avatar.avatar-c { background: #2563eb; }
.tech-avatar.avatar-j { background: #0d9488; }
.tech-avatar.avatar-m { background: #7c3aed; }
 
.assignee-names {
  font-size: 11px;
  font-weight: 650;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  white-space: nowrap;
}
 
.schedule-badge.is-scheduled { color: #334155; font-weight: 500; }
.schedule-badge.is-overdue { color: #b91c1c; font-weight: 700; }
.schedule-badge.is-empty { color: #94a3b8; }
 
.col-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
 
.status-priority-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.priority-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 750;
  padding: 1px 5px;
  border-radius: 3px;
}
 
.priority-badge.p1-critical { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.priority-badge.p2-high { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.priority-badge.p3-normal { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
 
.state-chip {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}
 
.state-chip.chip-overdue { background: #dc2626; color: #ffffff; }
.state-chip.chip-partial,
.state-chip.chip-waiting { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.state-chip.chip-ready { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.state-chip.chip-triage { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.state-chip.chip-unassigned { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
 
.row-chevron {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
}
 
.list-footer {
  height: 24px;
  min-height: 24px;
  font-size: 9px;
  color: #8a9ba6;
  border-top: 1px solid #e5e7eb;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
}
 
/* ==========================================================================
   PAINEL EXPANDIDO DA OS (#detail) — ALTURA TOTAL
   ========================================================================== */
#detail {
  display: none;
  background: #ffffff;
  overflow: hidden;
}
 
#detail.is-open {
  display: flex;
  flex-direction: column;
}
 
#form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}
 
@media (min-width: 1024px) {
  #drawer-backdrop {
    display: none !important;
  }
}
 
@media (max-width: 1023px) {
  #detail {
    position: fixed !important;
    top: 6px !important;
    right: 6px !important;
    bottom: 6px !important;
    width: min(95vw, 620px) !important;
    border: 1px solid #dce5eb !important;
    border-radius: 12px !important;
    z-index: 101 !important;
    box-shadow: 0 20px 80px rgba(32, 59, 81, 0.35) !important;
  }
 
  #drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 34, 48, 0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
  }
 
  #drawer-backdrop:not([hidden]) {
    display: block;
  }
}
 
/* Abas de Tickets no topo do Drawer */
.drawer-ticket-tabs {
  display: flex;
  align-items: center;
  background: #f1f5f8;
  border-bottom: 1px solid #dce5eb;
  padding: 3px 10px;
  gap: 5px;
  min-height: 32px;
  flex-shrink: 0;
}
 
.ticket-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
 
.ticket-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2eaf0;
  color: #476577;
  border: 1px solid #cbd8e2;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 220px;
  user-select: none;
}
 
.ticket-tab:hover { background: #d6e3ec; color: #1a384c; }
.ticket-tab.selected { background: #ffffff; color: var(--pond); border-color: #8bb0c7; font-weight: 700; }
.ticket-tab.dirty::after { content: '●'; color: #ea580c; font-size: 8px; margin-left: -2px; }
 
.ticket-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.ticket-tab-close {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #708695;
  font-size: 10px;
  cursor: pointer;
}
 
.ticket-tab-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #dc2626;
}
 
.ticket-tab-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed #a5bccb;
  border-radius: 5px;
  color: var(--pond);
  font-size: 10px;
  font-weight: 650;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
 
.ticket-tab-add:hover {
  background: #e4eef4;
  border-color: var(--pond);
}
 
.drawer-head {
  padding: 8px 16px 6px;
  background: #f8fafb;
  border-bottom: 1px solid #e5ebf0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
 
.drawer-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--pond);
  margin: 1px 0 0;
}
 
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #718796;
}
 
#detail-tabs {
  background: #f8fafb;
  border-bottom: 1px solid #e5ebf0;
  padding: 0 16px;
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}
 
#detail-tabs button {
  border-radius: 0;
  font-size: 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 7px 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
 
#detail-tabs button.selected {
  border-color: var(--pond);
  color: var(--pond);
  font-weight: 700;
}
 
/* ÁREA DE CONTEÚDO EXPANDIDA COM MÁXIMO ESPAÇO VERTICAL */
.drawer-body {
  background: #fff;
  padding: 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 0%;
  min-height: 0;
}
 
.drawer-footer {
  background: #f8fafb;
  border-top: 1px solid #e5ebf0;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
 
.drawer-footer span {
  margin-right: auto;
  font-size: 11px;
  color: var(--muted);
}
 
.drawer-footer button {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
}
 
/* ==========================================================================
   MINI-TIMELINE DO ROTEIRO DO TÉCNICO & ATALHOS DE HORÁRIO
   ========================================================================== */
.technician-run-container {
  background: #f8fafc;
  border: 1px solid #dce5eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 6px 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  grid-column: 1 / -1 !important;
}
 
.run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
 
.run-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--pond);
  display: flex;
  align-items: center;
  gap: 4px;
}
 
.run-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
 
.run-timeline-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 4px;
  font-size: 10px;
  color: #334155;
  cursor: pointer;
}
 
.run-timeline-slot.is-current {
  background: #edf5fa;
  border-color: #9ac2da;
  border-left-color: var(--papaya) !important;
  font-weight: 650;
  color: var(--pond);
}
 
.run-timeline-slot.is-bundled {
  background: #fffdf5;
  border-color: #fce79f;
  border-left-color: #d97706 !important;
}
 
.run-slot-time {
  font-weight: 750;
  color: #1e293b;
  font-size: 9px;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
 
.run-timeline-slot.is-current .run-slot-time {
  background: var(--pond);
  color: #ffffff;
}
 
.run-slot-desc {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.run-tag {
  font-size: 8px;
  font-weight: 750;
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
}
 
.run-tag.tag-current { background: #fee2e2; color: #991b1b; }
.run-tag.tag-bundled { background: #fef3c7; color: #92400e; }
 
.schedule-field {
  grid-column: 1 / -1 !important;
  width: 100%;
}
 
.schedule-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}
 
.batch-time-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
 
.btn-time-shortcut {
  font-size: 9px;
  font-weight: 650;
  color: var(--pond);
  background: #eaf1f6;
  border: 1px solid #c0d3e0;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
}
 
.btn-time-shortcut:hover {
  background: var(--pond);
  color: #ffffff;
}
 
/* Oportunidades de Rota */
.route-opportunities-card {
  grid-column: 1 / -1 !important;
  width: 100%;
  margin-top: 8px;
}
 
.route-opportunities-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
.bundle-section {
  border-radius: 6px;
  padding: 8px 10px;
}
 
.bundle-section.tier-1-unit {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #16a34a;
}
 
.bundle-section.tier-2-building {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #3b82f6;
}
 
.bundle-tag {
  display: inline-block;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-bottom: 2px;
}
 
.bundle-tag.tag-unit { background: #dcfce7; color: #15803d; }
.bundle-tag.tag-building { background: #dbeafe; color: #1d4ed8; }
 
.bundle-header h4 {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  margin: 1px 0 0;
}
 
.bundle-header p {
  font-size: 10px;
  color: #64748b;
  margin: 1px 0 0;
}
 
.bundle-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
}
 
.bundle-task-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #dcfce7;
  border-radius: 4px;
  padding: 5px 6px;
  cursor: pointer;
}
 
.bundle-task-info {
  flex: 1;
  min-width: 0;
}
 
.bundle-task-title-line strong {
  font-size: 10px;
  color: #1e293b;
}
 
.bundle-task-meta {
  display: block;
  font-size: 9px;
  color: #64748b;
  margin-top: 1px;
}
 
.bundle-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #dcfce7;
}
 
.btn-bundle-action {
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
 
.btn-quick-alloc {
  font-size: 9px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
}
 
.cluster-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 5px 6px;
  margin-top: 3px;
}
 
.btn-add-to-route {
  font-size: 9px;
  font-weight: 650;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
 
/* ==========================================================================
   FORMULÁRIOS & CAMPOS
   ========================================================================== */
.case-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
 
.summary-problem p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink);
}
 
.field {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: var(--pond);
  gap: 2px;
}
 
.field-label {
  font-size: 10px;
  color: var(--pond);
  font-weight: 600;
}
 
.field input,
.field select,
.field textarea {
  font-size: 11px;
  padding: 5px 7px;
  border: 1px solid #879dad;
  background: #fff;
  border-radius: 4px;
}
 
.field textarea {
  min-height: 50px;
}
 
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
 
.field.full {
  grid-column: 1 / -1;
}
 
.tech-selector {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}
 
.tech-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid #cbd6dd;
  background: #fff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
 
.tech-pill.selected {
  background: var(--pond);
  border-color: var(--pond);
  color: #fff;
}
 
.custom-select-native {
  display: none !important;
}
 
.custom-select {
  display: inline-flex;
  min-width: 0;
  vertical-align: middle;
}
 
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
 
.custom-select-trigger > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
main > footer {
  height: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 9px;
  color: #93a3ac;
  flex-shrink: 0;
}
 
main > footer button {
  font-size: 9px !important;
}
 
.queue-row,
.queue-row:focus,
.queue-row:focus-visible,
.queue-row:active {
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
 
/* ==========================================================================
   REFATORAÇÃO DA ABA PLANEJAMENTO: DESIGN LIMPO & COERENTE
   ========================================================================== */
 
/* Cartão 1: Resumo da Ocorrência */
.case-summary {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
 
.summary-top-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}
 
.summary-problem .field-label,
.summary-obs .field-label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
 
.summary-problem p {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}
 
.queue-obs {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 12px;
}
 
.obs-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 9px;
  font-weight: 750;
  padding: 1px 5px;
  border-radius: 3px;
}
 
.obs-text {
  font-size: 12px;
  color: #92400e;
  line-height: 1.4;
}
 
/* Detalhes expansíveis de edição */
details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
 
details summary {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
 
/* Cartão 2: Planejamento da Visita */
.planning {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
 
.planning .section-line h3 {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
 
.schedule-occupancy-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
 
.plan-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}
 
.plan-status-pill.is-vacant {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
 
.plan-status-pill.is-occupied {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
 
.plan-status-pill.is-urgent-checkin {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 700;
}
 
.plan-status-pill.is-checkin {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
}
 
/* Mini-timeline do Roteiro do Técnico */
.technician-run-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 4px;
}
 
.run-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}
 
.run-empty-notice {
  font-size: 11px;
  color: #64748b;
  margin: 6px 0 0;
}
 
/* Cartão 3: Sinergias e Oportunidades de Rota */
.opportunities-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
 
.opportunities-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
 
.opp-icon {
  font-size: 16px;
  color: #eab308;
}
 
.opportunities-section-header h4 {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
 
.opportunities-section-header p {
  font-size: 11px;
  color: #64748b;
  margin: 1px 0 0;
}
 
.opp-tier-card {
  border-radius: 7px;
  padding: 10px 12px;
  background: #ffffff;
}
 
.opp-tier-card.tier-unit {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}
 
.opp-tier-card.tier-building {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
 
.tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
 
.tier-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
 
.tier-chip.chip-unit { background: #dcfce7; color: #15803d; }
.tier-chip.chip-building { background: #e0f2fe; color: #0369a1; }
 
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
.tier-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
}
 
.tier-item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
 
.tier-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #1e293b;
}
 
.tier-item-sub {
  font-size: 10px;
  color: #64748b;
}
 
.tier-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
 
.btn-primary-action {
  background: #15803d;
  color: #ffffff;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}
 
.btn-primary-action:hover {
  background: #166534;
}
 
.btn-sub-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  padding: 4px 8px;
  cursor: pointer;
}
 
.btn-add-route {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
 
.btn-add-route:hover {
  background: #dbeafe;
}
 
.badge-nearby {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}
 
.quiet-link {
  font-size: 10px;
  color: #64748b;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.quiet-link:hover { color: #0f172a; }
 
/* ==========================================================================
   DISPARADOR DO SELETOR DE DATA & HORA MODULAR
   ========================================================================== */
.datetime-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  color: #1e293b;
  font-size: 12px;
  transition: all 0.15s ease;
}
 
.datetime-picker-trigger:hover {
  border-color: #214a63;
  background: #f8fafc;
}
 
.datetime-picker-trigger .dp-cal-icon {
  display: flex;
  align-items: center;
  color: #214a63;
  margin-right: 8px;
}
 
.datetime-picker-trigger .dp-text {
  font-weight: 650;
  flex: 1;
  text-align: left;
}
 
.datetime-picker-trigger .dp-chevron {
  color: #94a3b8;
}
 
/* Espaçamento dos editores ricos */
jestor-editor {
  margin-top: 4px;
}
 
/* ==========================================================================
   SEÇÕES DA ABA PLANEJAMENTO & HIERARQUIA VISUAL
   ========================================================================== */
 
/* Cards modulares */
.plan-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
 
/* 1. Descrição do Problema legível */
.summary-problem {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 4px 0 6px 0;
}
 
.summary-problem .field-label {
  font-size: 11px;
  font-weight: 750;
  color: #214a63;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
 
.summary-problem-text {
  font-size: 13.5px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}
 
/* 2. Informações Relevantes / OBS compacta e sem destaque excessivo */
.summary-obs.compact {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 4px 0 8px 0;
}
 
.obs-inline-tag {
  font-size: 9px;
  font-weight: 750;
  color: #475569;
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
 
.obs-inline-text {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.4;
}
 
/* 3. Fase e Data na Mesma Linha */
.planning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
 
.planning-grid .field {
  grid-column: auto;
}
 
.planning-grid .schedule-field {
  grid-column: auto !important;
  width: 100%;
}
 
.planning-grid .field.full,
.planning-grid .schedule-occupancy-hint.full {
  grid-column: 1 / -1 !important;
}
 
/* 4. Sugestões Operacionais no Final */
.context-suggestions-card,
#context-suggestions {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}
/* ==========================================================================
   MÍDIAS ANEXADAS: vídeos com primeiro quadro e botão "Adicionar" ao lado
   ========================================================================== */
#detail .media-thumbnails {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
 
#detail .media-thumb-card video,
.new-media-thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: #142834;
}
 
#detail .media-thumbnails .media-add-tile {
  width: 104px;
  height: 70px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  flex-direction: column;
  gap: 4px;
  border: 1.5px dashed #c5d2dc;
  border-radius: 8px;
  background: #f6f9fc;
  color: #5b7180;
}
 
#detail .media-thumbnails .media-add-tile .dz-icon {
  width: 20px;
  height: 20px;
  color: #6b7a86;
}
 
#detail .media-thumbnails .media-add-tile .dz-browse {
  height: auto;
  padding: 0;
  background: none;
  color: #4d6270;
  font-size: 12px;
  font-weight: 600;
}
 
/* Miniaturas de vídeo na lista de ordens: primeiro quadro via <video preload="metadata"> */
.row-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: #142834;
}
 
/* Cards de Comprovante de Compra */
.receipt-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 6px 4px;
  text-align: center;
  cursor: default;
}
 
.receipt-file-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #475569;
}
 
.receipt-file-badge span {
  font-size: 8px;
  font-weight: 750;
  color: var(--pond);
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
}
 
.receipt-file-name {
  font-size: 8.5px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  margin-top: 3px;
}
 
/* Dropzone compacto alinhado ao campo de valor */
.receipt-dropzone-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
 
.receipt-dropzone-compact:hover {
  background: #edf5fa;
  border-color: var(--pond);
}
 
.receipt-dropzone-compact .dz-icon {
  color: var(--pond);
  flex-shrink: 0;
}
 
.receipt-dropzone-compact .dz-text-compact {
  font-size: 11px;
  color: #475569;
}
 
.receipt-dropzone-compact .dz-text-compact strong {
  color: var(--pond);
}
 
/* Miniaturas compactas em linha */
.receipt-thumbnails-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
 
.receipt-thumb-compact {
  width: 44px;
  height: 32px;
  min-width: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
 
.receipt-thumb-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
 
.receipt-add-compact {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 4px;
  border: 1px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}
 
.receipt-add-compact:hover {
  border-color: var(--pond);
  color: var(--pond);
  background: #edf5fa;
}
 
/* 1. Espaçamento entre o bloco de tempo gasto e materiais utilizados */
.materials-block {
  margin-top: 20px;
}
 
/* 2. Espaçamento entre o select de materiais e os blocos de estoque / compras */
#stock-section,
#purchase-section {
  margin-top: 18px;
}
 
/* 3. Correção do botão de comprovante: alinhamento em linha e trava de dimensões */
#receipt-dropzone,
.receipt-dropzone-compact {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  border: 1px dashed #93b2c6 !important;
  border-radius: 5px !important;
  background: #f8fafc !important;
  overflow: hidden !important;
  cursor: pointer !important;
  user-select: none !important;
}
 
#receipt-dropzone:hover,
.receipt-dropzone-compact:hover {
  background: #edf5fa !important;
  border-color: var(--pond) !important;
}
 
/* Trava para o ícone SVG não herdar alturas grandes globais */
#receipt-dropzone svg,
.receipt-dropzone-compact svg,
.receipt-dropzone-compact .dz-icon {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  color: var(--pond) !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
 
/* Trava para o texto ficar em linha única e centralizado */
.receipt-dropzone-compact .dz-text-compact {
  font-size: 11px !important;
  line-height: 1 !important;
  color: #475569 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
 
.receipt-dropzone-compact .dz-text-compact strong {
  color: var(--pond) !important;
  font-weight: 600 !important;
}
 
/* ==========================================================================
   SEÇÃO COBRANÇA & COMPOSIÇÃO DE CUSTOS
   ========================================================================== */
.billing-breakdown-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
 
.billing-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
 
@media (max-width: 600px) {
  .billing-breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
 
.billing-breakdown-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
 
.billing-breakdown-item .item-label {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}
 
.billing-breakdown-item strong {
  font-size: 12.5px;
  color: #1e293b;
  font-weight: 700;
}
 
.billing-breakdown-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}
 
.billing-breakdown-total-line strong {
  font-size: 14px;
  color: var(--pond);
  font-weight: 800;
}
 
/* ==========================================================================
   TIMELINE (ALINHAMENTO PRECISO DA LINHA E MARCADOR)
   ========================================================================== */
ol.timeline {
  list-style: none !important;
  margin: 6px 0 0 0 !important;
  padding: 0 !important;
  border: none !important;
  border-left: none !important;
  display: flex;
  flex-direction: column;
}
 
ol.timeline li {
  position: relative !important;
  padding-left: 24px !important;
  padding-bottom: 16px !important;
  margin: 0 !important;
  border: none !important;
  border-left: none !important;
  list-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
ol.timeline li:last-child {
  padding-bottom: 4px !important;
}
 
/* Guia vertical contínua centrada exatamente no eixo da bolinha */
ol.timeline li::after {
  content: '' !important;
  position: absolute !important;
  left: 5px !important; /* Centro matemático do marcador de 12px */
  top: 14px !important;
  bottom: -4px !important;
  width: 2px !important;
  background: #cbd5e1 !important;
  z-index: 1 !important;
  display: block !important;
}
 
/* Remove a ponta da linha após o último evento */
ol.timeline li:last-child::after {
  display: none !important;
}
 
/* Marcador circular concêntrico */
ol.timeline li::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 2px !important;
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 3px solid var(--pond) !important;
  box-shadow: 0 0 0 2px rgba(33, 74, 99, 0.12) !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}
 
.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.2;
}
 
.timeline-head strong {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}
 
.timeline-head small {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
 
ol.timeline li p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
 
/* Feedback visual de arrastar abas */
.ticket-tab {
  max-width: 260px !important;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
 
.ticket-tab:active {
  cursor: grabbing;
}
 
.ticket-tab.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
 
.ticket-tab.drag-over {
  border-color: var(--papaya) !important;
  background: #edf5fa !important;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(33, 74, 99, 0.12);
}
 
/* Fixa o cabeçalho superior e impede vazamento de subpixel */
.list-header {
  position: relative;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}
 
/* Remove o padding-top para o sticky encostar perfeitamente na barra superior */
#list {
  padding: 0 10px 10px 10px !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1 1 0%;
  min-height: 0;
  background: #f8fafc;
}
 
/* Barra de agrupamento (Vencido, Pronto, etc.) 100% opaca e de ponta a ponta */
.list-group {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: #eef3f7 !important; /* Cor opaca para bloquear os cards que rolam atrás */
  margin: 0 -10px 4px -10px !important; /* Estende 10px em cada lado cobrindo o padding de #list */
  padding: 6px 14px !important;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
 
/* Espaçamento quando houver múltiplos grupos na lista */
.list-group:not(:first-child) {
  margin-top: 8px !important;
}
 
/* Espaço superior quando a listagem não estiver agrupada */
#list > .queue-row:first-child {
  margin-top: 8px;
}
 
/* ==========================================================================
   PAINEL COM TRANSIÇÃO SUAVE (ESTADO RECOLHIDO 38px ↔ EXPANDIDO)
   ========================================================================== */
@media (min-width: 1024px) {
  .workspace {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
 
  .workspace-left {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    transition: flex 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
 
  /* Painel lateral com transição suave de largura */
  #detail {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    border: 1px solid #dce5eb !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.2s ease,
                box-shadow 0.28s ease,
                background-color 0.2s ease !important;
  }
 
  /* ESTADO 1: RECOLHIDO (Barra de 38px) */
  #detail.is-collapsed {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    background: #f8fafc !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }
 
  #detail.is-collapsed:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
  }
 
  /* ESTADO 2: EXPANDIDO */
  #detail.is-expanded {
    width: clamp(520px, 46vw, 680px) !important;
    min-width: 480px !important;
    max-width: 50vw !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
    cursor: default !important;
  }
 
  .workspace.drawer-expanded .list-columns-bar {
    display: none !important;
  }
 
  .workspace.drawer-collapsed .list-columns-bar {
    display: grid !important;
  }
}
 
/* ==========================================================================
   CONTEÚDO INTERNO: TRANSIÇÃO SEM DEFORMAÇÃO DE TEXTO
   ========================================================================== */
 
/* Barra vertical quando recolhido */
.drawer-collapsed-bar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
  padding-top: 6px !important;
  user-select: none !important;
  z-index: 5 !important;
  background: #f8fafc !important;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
}
 
#detail.is-expanded .drawer-collapsed-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
 
/* Formulário da OS quando expandido */
#detail #form,
#detail #panel-empty {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 480px !important; /* Trava a largura interna para os campos não dobrarem durante a animação */
  opacity: 1;
  transition: opacity 0.24s ease 0.05s !important;
}
 
#detail.is-collapsed #form,
#detail.is-collapsed #panel-empty {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
 
/* ==========================================================================
   SUPORTE MOBILE & TABLET (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  #detail {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: min(94vw, 580px) !important;
    border-radius: 12px !important;
    z-index: 1000 !important;
    box-shadow: 0 20px 80px rgba(32, 59, 81, 0.35) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
  }
 
  #detail.is-collapsed {
    transform: translateX(calc(100% + 16px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
 
  #detail.is-expanded {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
/* ==========================================================================
   CORREÇÃO: painel expandido da OS
   - O atributo [hidden] era anulado por "display: flex !important" em
     #panel-empty e #form, então o aviso "Selecione uma ordem" aparecia
     empilhado acima do formulário.
   - A barra vertical "Painel de OS" não deve aparecer quando expandido.
   ========================================================================== */
#detail #form[hidden],
#detail #panel-empty[hidden] {
  display: none !important;
}
 
@media (min-width: 1024px) {
  #detail.is-expanded .drawer-collapsed-bar {
    display: none !important;
  }
}
 
/* ==========================================================================
   ANIMAÇÃO DO PAINEL (DESKTOP): um único modelo flex, sem trocar grid/flex.
   A largura do #detail anima entre 38px (recolhido) e a largura expandida;
   a lista ocupa o espaço restante.
   ========================================================================== */
@media (min-width: 1024px) {
  .workspace.drawer-open {
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 10px !important;
  }
 
  .workspace.drawer-open .workspace-left {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
  }
 
  .workspace.drawer-open #detail.is-expanded {
    flex: 0 0 auto !important;
    width: clamp(520px, 46vw, 680px) !important;
    min-width: 480px !important;
    max-width: 50vw !important;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
 
  .workspace #detail.is-collapsed {
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}
 
/* ==========================================================================
   AJUSTES DO PAINEL (DESKTOP)
   - Largura expandida volta à proporção original (~53% da área, como o grid
     anterior minmax(460px,1fr) / minmax(520px,1.15fr)).
   - Texto da barra recolhida na vertical, sem quebrar palavras.
   ========================================================================== */
@media (min-width: 1024px) {
  .workspace.drawer-open #detail.is-expanded {
    width: calc((100% - 10px) * 0.535) !important;
    min-width: 520px !important;
    max-width: none !important;
  }
 
  .drawer-collapsed-bar .rail-label {
    writing-mode: vertical-rl;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 12px;
  }
}
 
/* ==========================================================================
   RECOLHER: animação e estado vazio
   - max-width "none" não anima; "100%" anima até 38px no recolher.
   - Estado vazio com barra superior contendo o botão Recolher.
   ========================================================================== */
@media (min-width: 1024px) {
  .workspace.drawer-open #detail.is-expanded {
    max-width: 100% !important;
  }
}
 
#detail #panel-empty {
  flex-direction: column !important;
}
 
#detail .panel-empty-bar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  flex-shrink: 0;
}
 
#detail .panel-empty-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #4d6270);
  font-size: 13px;
}
 
/* ==========================================================================
   BARRA RECOLHIDA: espaçamento do botão de expandir até as bordas
   ========================================================================== */
@media (min-width: 1024px) {
  .drawer-collapsed-bar {
    padding: 8px 0 0 !important;
  }
 
  .drawer-collapsed-bar .btn-rail-toggle {
    width: 28px !important;
    height: 28px !important;
    margin: 0 auto !important;
    flex-shrink: 0;
  }
}
 
/* ==========================================================================
   FILTROS INLINE (após a busca) e GRUPOS RECOLHÍVEIS
   ========================================================================== */
.toolbar .toolbar-select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d7e0e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink, #18384c);
  font-size: 12px;
  min-width: 0;
  max-width: 150px;
}
 
.toolbar .toolbar-clear {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
 
button.list-group {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
 
button.list-group:hover {
  color: var(--pond, #214a63);
}
 
.list-group-chev {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s ease;
}
 
.list-group.is-collapsed .list-group-chev {
  transform: rotate(-90deg);
}
 
/* ==========================================================================
   AJUSTES DE LISTA E FILTROS (v3)
   ========================================================================== */
 
/* Cabeçalho de grupo: sem width fixo, para esticar até a borda da lista */
button.list-group {
  width: auto !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  cursor: pointer;
  text-align: left;
  gap: 8px !important;
  justify-content: space-between !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
 
button.list-group:hover {
  background: #e4ecf2 !important;
  color: var(--pond, #214a63) !important;
}
 
button.list-group:focus-visible {
  outline: 2px solid var(--pond, #214a63);
  outline-offset: -2px;
}
 
/* Seta em SVG que gira ao recolher */
.list-group-chev {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
 
button.list-group.is-collapsed .list-group-chev {
  transform: rotate(-90deg);
}
 
/* Corpo do grupo: a altura anima de 1fr para 0fr (recolhe) e volta (expande) */
.list-group-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              visibility 0s linear 0s;
}
 
.list-group-body.is-collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease,
              visibility 0s linear 0.32s;
}
 
.list-group-body > .list-group-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
/* Contador "N ordens" centralizado no cabeçalho */
.list-header {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
 
.list-header #list-count {
  grid-column: 2;
  justify-self: center;
}
 
.list-header #queue-summary {
  grid-column: 3;
  justify-self: end;
  margin-left: 0 !important;
}
 
.list-header #history-phase {
  grid-column: 1;
  justify-self: start;
}
 
/* Selects da barra: aparência própria com seta e foco visível */
.toolbar #group,
.toolbar .toolbar-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px 11px;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
 
.toolbar #group:hover,
.toolbar .toolbar-select:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}
 
.toolbar #group:focus,
.toolbar .toolbar-select:focus {
  outline: none;
  border-color: var(--pond, #214a63);
  box-shadow: 0 0 0 3px rgba(33, 74, 99, 0.16);
}
 
.toolbar #group:focus-visible,
.toolbar .toolbar-select:focus-visible {
  outline: 2px solid var(--pond, #214a63);
  outline-offset: 1px;
}
 
.toolbar .toolbar-clear {
  height: 30px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
 
/* ==========================================================================
   CHEVRON DOS SELECTS PERSONALIZADOS (gerado por dropdowns.js)
   - fill: none evita a seta preenchida (triângulo sólido) herdada.
   - Centralizado no botão e girando ao abrir o menu.
   ========================================================================== */
.custom-select-trigger .select-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  line-height: 0;
  color: #64748b;
}
 
.custom-select-trigger .select-chevron svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: none !important;
  stroke: currentColor;
  transform: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
 
.custom-select-trigger[aria-expanded="true"] .select-chevron svg {
  transform: rotate(180deg);
}
 
.custom-select-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
 
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--pond, #214a63);
  box-shadow: 0 0 0 3px rgba(33, 74, 99, 0.16);
}
 
.toolbar .custom-select-trigger {
  height: 30px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
 
/* ==========================================================================
   BOTÃO DE EXPANDIR (barra recolhida)
   Sem regras anteriores: define aparência e zera transformações herdadas.
   ========================================================================== */
.btn-rail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #dce5eb;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transform: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
 
.btn-rail-toggle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
 
.btn-rail-toggle svg {
  display: block;
  width: 14px;
  height: 14px;
  transform: none;
  fill: none;
  stroke: currentColor;
}
/* ==========================================================================
   AJUSTES v4: botão Recolher, aba Atividade, seletor do Histórico
   ========================================================================== */
 
/* Botão Recolher (cabeçalho e painel vazio): ícone SVG com tamanho fixo */
.btn-toggle-collapse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  cursor: pointer;
}
 
.btn-toggle-collapse svg {
  display: block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  transform: none;
}
 
/* Aba Atividade: espaçamento entre formulário, linha do tempo e itens */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
 
.activity-post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
 
.activity-post-actions {
  display: flex;
  justify-content: flex-start;
}
 
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
 
ol.timeline {
  gap: 0 !important;
  margin: 0 !important;
}
 
ol.timeline li {
  gap: 4px !important;
  padding-bottom: 14px !important;
}
 
ol.timeline li:last-child {
  padding-bottom: 0 !important;
}
 
ol.timeline li p {
  margin: 0 !important;
}
 
.timeline-head {
  align-items: center !important;
}
 
/* Histórico: seletor "Todas as fases" no lugar certo da barra da lista */
.custom-select[hidden] {
  display: none !important;
}
 
.list-header .custom-select {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  width: auto;
  min-width: 150px;
}
 
/* ==========================================================================
   AJUSTES v5: filtro de fase no Histórico, linha da taskbar, contador vazio
   ========================================================================== */
 
/* Barra da lista em flex: o filtro de fase fica à esquerda, o contador centralizado */
.list-header {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
 
.list-header .custom-select {
  order: -1;
  flex: 0 0 auto;
  width: auto;
  min-width: 150px;
  grid-column: auto !important;
  grid-row: auto !important;
  justify-self: auto !important;
}
 
.list-header #list-count {
  order: 0;
  flex: 1 1 auto;
  text-align: center;
  grid-column: auto !important;
  justify-self: auto !important;
}
 
.list-header #queue-summary {
  order: 1;
  flex: 0 0 auto;
  margin-left: 0 !important;
  grid-column: auto !important;
  justify-self: auto !important;
}
 
/* Taskbar: remove a linha branca sob a navegação */
.taskbar .workspace-nav,
.taskbar .workspace-nav > div,
.taskbar .workspace-nav button {
  border-bottom: 0 !important;
  box-shadow: none !important;
  outline: none;
}
 
.taskbar .workspace-nav::before,
.taskbar .workspace-nav::after,
.taskbar .workspace-nav > div::before,
.taskbar .workspace-nav > div::after,
.taskbar .workspace-nav button::before,
.taskbar .workspace-nav button::after {
  content: none !important;
  display: none !important;
}
 
/* Taskbar: contadores vazios (ex.: Planejamento do dia) não aparecem como caixa solta */
.taskbar .workspace-nav button {
  white-space: nowrap;
}
 
.taskbar .workspace-nav button span:empty {
  display: none !important;
}
 
/* ==========================================================================
   AJUSTES v6: campos e botão de anexo da "Nova ocorrência" no padrão do dashboard
   ========================================================================== */
 
.new-drawer-field > span {
  font-size: 10px;
  font-weight: 600;
  color: var(--pond);
}
 
.new-drawer-field input,
.new-drawer-field textarea {
  font-size: 11px;
  padding: 5px 7px;
  border: 1px solid #879dad;
  background: #fff;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 400;
  transition: none;
}
 
.new-drawer-field input:focus,
.new-drawer-field textarea:focus {
  border-color: var(--pond);
  background: #fff;
  box-shadow: none;
  outline: none;
}
 
.new-drawer-field textarea {
  min-height: 50px;
}
 
.new-attach-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid #879dad;
  border-radius: 4px;
  background: #fff;
  color: var(--pond);
  transition: none;
}
 
.new-attach-btn:hover {
  background: #f1f5f9;
  color: var(--pond);
  border-style: solid;
  border-color: #879dad;
}
 
/* ==========================================================================
   AJUSTES v7: Nova ocorrência com o mesmo estilo dos campos do workspace
   (seletores com id e !important para vencer as regras anteriores)
   ========================================================================== */
 
#new-occurrence-form .new-drawer-field input {
  height: 30px !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-weight: 400 !important;
}
 
#new-occurrence-form .new-drawer-field textarea {
  font-size: 12px !important;
  padding: 6px 8px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-weight: 400 !important;
  min-height: 52px !important;
  line-height: 1.4 !important;
}
 
#new-occurrence-form .new-drawer-field input:focus,
#new-occurrence-form .new-drawer-field textarea:focus {
  border-color: var(--pond) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(33, 74, 99, 0.16) !important;
  outline: none !important;
}
 
#new-occurrence-drawer #new-attach-btn {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #334155 !important;
}
 
#new-occurrence-drawer #new-attach-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #334155 !important;
}
 
/* ==========================================================================
   AJUSTES v8: Nova ocorrência copia os campos e a área de mídia do painel de OS
   Valores de #detail .field (planning.css) e #detail .dropzone.is-compact
   ========================================================================== */
 
#new-occurrence-drawer .new-drawer-field > span {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #63798a !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
 
#new-occurrence-drawer .new-drawer-field input,
#new-occurrence-drawer .new-drawer-field textarea {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  border: 1px solid #d3dde5 !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #1d3645 !important;
  background: #fff !important;
  box-shadow: none !important;
}
 
#new-occurrence-drawer .new-drawer-field textarea {
  min-height: 72px !important;
  resize: vertical !important;
}
 
#new-occurrence-drawer .new-drawer-field input:focus,
#new-occurrence-drawer .new-drawer-field textarea:focus {
  outline: 2px solid rgba(33, 74, 99, 0.25) !important;
  outline-offset: 0 !important;
  border-color: #214a63 !important;
  background: #fff !important;
  box-shadow: none !important;
}
 
/* Mídia: mesma área tracejada do painel de OS */
#new-occurrence-drawer .new-drawer-card:has(#new-attach-btn) {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  border: 1.5px dashed #c5d2dc !important;
  border-radius: 12px !important;
  background: #f6f9fc !important;
}
 
#new-occurrence-drawer .new-drawer-media-title {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #1d3645 !important;
}
 
#new-occurrence-drawer #new-media-count {
  font-size: 11px !important;
  color: #63798a !important;
}
 
#new-occurrence-drawer #new-attach-btn {
  height: 34px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: #214a63 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
 
#new-occurrence-drawer #new-attach-btn:hover {
  background: #1a3d52 !important;
  color: #fff !important;
}
 
/* ==========================================================================
   AJUSTES v9: área de mídia da gaveta igual à do painel de OS (dropzone)
   ========================================================================== */
#new-occurrence-drawer .new-drawer-card:has(#new-attach-zone) {
  display: block !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
 
#new-occurrence-drawer #new-attach-zone {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 16px !important;
  border: 1.5px dashed #c5d2dc !important;
  border-radius: 12px !important;
  background: #f6f9fc !important;
  color: #5b7180 !important;
}
 
#new-occurrence-drawer #new-attach-zone .dz-icon {
  width: 30px !important;
  height: 30px !important;
  flex-shrink: 0 !important;
  color: #6b7a86 !important;
}
 
#new-occurrence-drawer #new-attach-zone .dz-text {
  flex: 1 !important;
  min-width: 0 !important;
}
 
#new-occurrence-drawer #new-attach-zone .dz-title {
  margin: 0 !important;
  font-size: 13px !important;
  color: #4d6270 !important;
}
 
#new-occurrence-drawer #new-attach-zone .dz-or {
  display: block !important;
  font-size: 12px !important;
  color: #7a8a96 !important;
}
 
#new-occurrence-drawer #new-attach-zone .dz-browse {
  height: 34px !important;
  padding: 0 16px !important;
  border-radius: 6px !important;
  background: #214a63 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border: 0 !important;
  margin-left: auto !important;
  cursor: pointer !important;
}
 
#new-occurrence-drawer .new-media-previews {
  margin-top: 8px !important;
}
 
/* ==========================================================================
   AJUSTES v10: dropdowns (apartamento) com o mesmo visual dos campos do painel
   ========================================================================== */
#new-occurrence-drawer .custom-select,
#detail .custom-select {
  display: flex !important;
  width: 100% !important;
}
 
#new-occurrence-drawer .custom-select-trigger,
#detail .custom-select-trigger {
  width: 100% !important;
  min-height: 36px !important;
  height: auto !important;
  padding: 8px 10px !important;
  border: 1px solid #d3dde5 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #1d3645 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}
 
#new-occurrence-drawer .custom-select-trigger:hover,
#detail .custom-select-trigger:hover {
  background: #fff !important;
  border-color: #b8c7d1 !important;
}
 
#new-occurrence-drawer .custom-select-trigger[aria-expanded="true"],
#new-occurrence-drawer .custom-select-trigger:focus-visible,
#detail .custom-select-trigger[aria-expanded="true"],
#detail .custom-select-trigger:focus-visible {
  border-color: #214a63 !important;
  box-shadow: none !important;
  outline: 2px solid rgba(33, 74, 99, 0.25) !important;
  outline-offset: 0 !important;
}
 
/* Wrappers ocultos continuam ocultos (o display flex acima não pode vencer o [hidden]) */
.custom-select[hidden],
#new-occurrence-drawer .custom-select[hidden],
#detail .custom-select[hidden] {
  display: none !important;
}
 
/* ==========================================================================
   AJUSTES v11: taskbar em #214A63 com acentos azuis, logo.png e animação
   da gaveta igual à dos agrupamentos (grid 0fr <-> 1fr)
   ========================================================================== */
 
/* Taskbar: fundo #214A63 */
.app-header.taskbar {
  background: #214a63 !important;
  box-shadow: 0 4px 14px rgba(20, 50, 70, 0.25) !important;
}
 
.taskbar.drawer-open {
  background: #214a63 !important;
}
 
/* Logo: espaço para logo.png */
.taskbar .taskbar-logo {
  display: block;
  height: 26px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}
 
/* Acentos: azuis claros em vez do pêssego */
.taskbar .workspace-nav button.selected {
  background: #2e5f7b;
  color: #fff;
}
 
.taskbar.drawer-open .header-new-btn,
.taskbar .header-new-btn[aria-expanded="true"] {
  background: #2e5f7b !important;
  border-color: #8fb8cf !important;
  box-shadow: 0 0 0 2px rgba(143, 184, 207, 0.35) !important;
}
 
.taskbar .header-new-btn .btn-icon {
  background: #8fb8cf;
  color: #214a63;
}
 
.taskbar.drawer-open .header-new-btn .drawer-chevron,
.taskbar .header-new-btn[aria-expanded="true"] .drawer-chevron {
  color: #8fb8cf;
}
 
.new-occurrence-drawer .drawer-surface {
  border-top: 2px solid #8fb8cf;
}
 
.new-drawer-eyebrow {
  color: #3d7391;
}
 
.new-extra summary::before {
  color: #3d7391;
}
 
/* Animação da gaveta: mesma técnica dos grupos (grid-template-rows 0fr <-> 1fr) */
.new-occurrence-drawer {
  display: grid !important;
  grid-template-rows: 0fr;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              visibility 0s linear 0.32s !important;
}
 
.new-occurrence-drawer > .drawer-surface {
  min-height: 0;
  overflow: hidden;
}
 
.taskbar.drawer-open .new-occurrence-drawer,
.new-occurrence-drawer.is-open {
  grid-template-rows: 1fr;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto;
  transform: none !important;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              visibility 0s linear 0s !important;
}
 
/* ==========================================================================
   AJUSTES v12: gaveta fechada no carregamento (estado recolhido com
   visibility hidden e overflow contido no contêiner)
   ========================================================================== */
.new-occurrence-drawer {
  overflow: hidden !important;
  visibility: hidden !important;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              visibility 0s linear 0.32s !important;
}
 
.new-occurrence-drawer > .drawer-surface {
  height: auto;
  min-height: 0;
  overflow: hidden;
}
 
.taskbar.drawer-open .new-occurrence-drawer,
.new-occurrence-drawer.is-open {
  visibility: visible !important;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              visibility 0s linear 0s !important;
}
/* ==========================================================================
   AJUSTE: taskbar e gaveta com a mesma curva, sem remendos
   ========================================================================== */
 
/* Taskbar: sempre arredondada, mesma forma e sombra em todos os estados */
.app-header.taskbar,
.taskbar.drawer-open {
  border-radius: 0 0 14px 14px !important;
  box-shadow: 0 4px 14px rgba(20, 50, 70, 0.25) !important;
  transition: none !important;
}
 
/* Gaveta: cantos superiores com o mesmo raio da taskbar; sem linha de topo;
   sombra desenhada pelo contêiner (não é recortada pelo overflow). */
.new-occurrence-drawer .drawer-surface {
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: none !important;
}
 
.new-occurrence-drawer {
  filter: drop-shadow(0 18px 22px rgba(15, 34, 48, 0.22));
}
 /* ==========================================================================
   GAVETA ATRÁS DA TASKBAR (REMOVE GAP DOS CANTOS ARREDONDADOS)
   ========================================================================== */

/* 1. Remove o fundo direto da barra para permitir elementos atrás dele */
.app-header.taskbar,
.taskbar.drawer-open {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 0 14px 14px !important;
}

/* 2. Fundo e sombra aplicados via pseudo-elemento na camada intermediária (z-index 1) */
.app-header.taskbar::before {
  content: '' !important;
  display: block !important;
  position: absolute;
  inset: 0;
  background: #214a63;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 4px 14px rgba(20, 50, 70, 0.25);
  z-index: 1;
  pointer-events: none;
}

/* 3. Logo, abas e botões da taskbar acima do fundo (z-index 2) */
.app-header.taskbar > .taskbar-brand,
.app-header.taskbar > .taskbar-center {
  position: relative;
  z-index: 2;
}

/* 4. Gaveta entra em z-index 0 e sobe 14px (iniciando em y = 24px, antes do início da curva) */
.new-occurrence-drawer {
  top: calc(100% - 14px) !important;
  z-index: 0 !important;
  filter: drop-shadow(0 18px 22px rgba(15, 34, 48, 0.22));
}

.new-occurrence-drawer .drawer-surface {
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: none !important;
}

/* 5. Compensa os 14px sobrepostos para manter o espaçamento visual do texto intacto (12px + 14px) */
.new-drawer-head {
  padding-top: 26px !important;
}

/* ==========================================================================
   PADRONIZAÇÃO TIPOGRÁFICA: DROPDOWNS E CAMPOS EDITÁVEIS (13px)
   ========================================================================== */

/* 1. Menus suspensos de opções (Dropdowns abertos) */
.custom-select-menu {
  font: 13px/1.45 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  padding: 4px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 12px 30px rgba(15, 34, 48, 0.16) !important;
}

.custom-select-menu [role="option"] {
  font-size: 13px !important;
  padding: 7px 11px !important;
  border-radius: 5px !important;
  line-height: 1.4 !important;
}

/* 2. Triggers fechados de dropdowns e botões de data/hora */
.custom-select-trigger,
.datetime-picker-trigger {
  font-size: 13px !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 10px !important;
  line-height: 1.4 !important;
  color: #1e293b !important;
  border-radius: 6px !important;
}

/* Mantém os selects da barra de ferramentas proporcionais à barra de 30px */
.toolbar .custom-select-trigger,
.toolbar .toolbar-select,
.toolbar > #search {
  font-size: 12.5px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 9px !important;
}

/* 3. Inputs de texto, números, textareas e selects nativos em todos os painéis */
#detail .field input,
#detail .field select,
#detail .field textarea,
#new-occurrence-drawer .new-drawer-field input,
#new-occurrence-drawer .new-drawer-field textarea,
.summary-edit input,
.summary-edit select,
.summary-edit textarea {
  font-size: 13px !important;
  font-family: inherit !important;
  color: #1e293b !important;
  line-height: 1.45 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
}

/* Altura uniforme para inputs de linha única */
#detail .field input:not([type="checkbox"]):not([type="radio"]),
#new-occurrence-drawer .new-drawer-field input {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
}

#detail .field textarea,
#new-occurrence-drawer .new-drawer-field textarea {
  padding: 8px 10px !important;
}

/* 4. Labels dos campos: sobe de 10px para 11px sem poluição visual */
.field-label,
.field > span,
.new-drawer-field > span,
.new-drawer-section-label,
#new-occurrence-drawer .new-drawer-field > span {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.4px !important;
  color: #214a63 !important;
  text-transform: uppercase !important;
  margin-bottom: 2px !important;
}

/* 5. Chips de escolha rápida (Urgência, Origem e Técnicos) */
.new-chip span {
  font-size: 12px !important;
  padding: 5px 11px !important;
}

.tech-pill {
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  height: 28px !important;
}

.ticket-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.ticket-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
  color: var(--muted, #758894);
  cursor: pointer;
  flex-shrink: 0;
}

.ticket-tab-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #c92a2a;
}

/* ==========================================================================
   ALINHAMENTO: FASE DA MANUTENÇÃO & DATA E HORÁRIO DO SERVIÇO
   ========================================================================== */

/* 1. Grid em 2 colunas com alinhamento pelo topo */
.planning-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  align-items: start !important;
}

/* Suporte às colunas virtuais .plan-col se divididas via JS */
.plan-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

/* 2. Containers dos campos com mesmo espaçamento interno */
.planning-grid .field,
.plan-col .field {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
}

/* 3. Nivelamento dos rótulos (Labels) */
.planning-grid .field-label,
.plan-col .field-label,
.planning-grid .schedule-label-row {
  min-height: 18px !important;
  height: 18px !important;
  margin: 0 0 2px 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.planning-grid .schedule-label-row .field-label {
  margin: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

/* 4. Padronização dos gatilhos (Select e Date Picker) com 36px exatos */
#detail .planning-grid .custom-select-trigger,
#detail .planning-grid .datetime-picker-trigger,
#detail .plan-col .custom-select-trigger,
#detail .plan-col .datetime-picker-trigger {
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

/* 5. Atalhos de horário posicionados abaixo do seletor de data */
.schedule-field .batch-time-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 6px !important;
}

/* ==========================================================================
   BANNER DE ALERTA E UNIFICAÇÃO DE DEMANDAS NO FORMULÁRIO DE NOVA OS
   ========================================================================== */
.new-conflict-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: bannerFade 0.2s ease;
}

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

.ncb-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ncb-icon {
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.ncb-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #92400e;
  line-height: 1.2;
}

.ncb-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #b45309;
  line-height: 1.35;
}

.ncb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.ncb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 10px;
}

.ncb-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ncb-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ncb-item-badge {
  font-size: 9px;
  font-weight: 750;
  color: #1e3a8a;
  background: #dbeafe;
  padding: 1px 5px;
  border-radius: 3px;
}

.ncb-item-title {
  font-size: 11px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ncb-item-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

.ncb-btn-merge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #214a63;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.ncb-btn-merge:hover {
  background: #17374b;
}

/* Estado de demandas unificadas ativo */
.ncb-merged-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: #1e40af;
}

.ncb-merged-notice strong {
  color: #1e3a8a;
}

.ncb-btn-undo {
  background: transparent;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
}

.ncb-btn-undo:hover {
  background: #dbeafe;
}

/* ==========================================================================
   BANNER DE SUGESTÃO E UNIFICAÇÃO (PALETA NOCTALIA / CLEAN)
   ========================================================================== */
#new-occurrence-conflict-banner {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}

#new-occurrence-conflict-banner[hidden] {
  display: none !important;
}

/* Card 1: Sugestões de OSs em aberto encontradas */
.ncb-suggestion-card {
  background: #f8fafc;
  border: 1px solid #dce5eb;
  border-left: 3px solid var(--pond, #214a63);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ncb-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ncb-icon {
  color: var(--pond, #214a63);
  flex-shrink: 0;
  margin-top: 1px;
}

.ncb-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}

.ncb-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.ncb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.ncb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ncb-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ncb-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ncb-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ncb-item-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--pond, #214a63);
  background: #eaf1f6;
  border: 1px solid #c7d8e2;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.ncb-item-title {
  font-size: 11px;
  font-weight: 650;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ncb-item-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.ncb-btn-merge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: var(--pond, #214a63);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ncb-btn-merge svg {
  color: var(--pond, #214a63);
  transition: transform 0.15s ease;
}

.ncb-btn-merge:hover {
  background: var(--pond, #214a63);
  color: #ffffff;
  border-color: var(--pond, #214a63);
}

.ncb-btn-merge:hover svg {
  color: #ffffff;
  transform: translateX(1px);
}

/* Card 2: Modo de unificação ativado (sem aninhamento) */
.ncb-merged-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f0f7fb;
  border: 1px solid #c9dbe7;
  border-left: 3px solid var(--pond, #214a63);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ncb-merged-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #1e3a5f;
  min-width: 0;
}

.ncb-merged-left svg {
  color: var(--pond, #214a63);
  flex-shrink: 0;
}

.ncb-merged-text {
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ncb-merged-text strong {
  color: var(--pond, #214a63);
}

.ncb-btn-undo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

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

/* ==========================================================================
   CAMPO DE APARTAMENTO (SEM SVG, NAVEGAÇÃO POR SETAS E ENTER)
   ========================================================================== */
.new-apt-field {
  position: relative;
}

.apt-search-custom {
  position: relative;
  width: 100%;
}

.apt-search-trigger {
  width: 100%;
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apt-search-trigger:hover {
  border-color: var(--pond, #214a63);
}

.apt-search-trigger[aria-expanded="true"],
.apt-search-trigger:focus-visible {
  outline: none;
  border-color: var(--pond, #214a63);
  box-shadow: 0 0 0 2px rgba(33, 74, 99, 0.15);
}

.apt-trigger-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apt-search-trigger.has-value .apt-trigger-text {
  color: #0f172a;
  font-weight: 600;
}

.apt-trigger-arrow {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apt-search-trigger[aria-expanded="true"] .apt-trigger-arrow {
  transform: rotate(180deg);
}

.apt-search-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.14), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 1050;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.apt-search-menu[hidden] {
  display: none !important;
}

.apt-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.apt-search-input {
  width: 100%;
  height: 28px !important;
  min-height: 28px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  font-size: 12px !important;
  padding: 4px 26px 4px 8px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.apt-search-input:focus {
  border-color: var(--pond, #214a63) !important;
  box-shadow: 0 0 0 2px rgba(33, 74, 99, 0.15) !important;
}

.apt-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.apt-search-clear:hover {
  color: var(--pond, #214a63);
  background: #e2e8f0;
}

.apt-search-clear[hidden] {
  display: none !important;
}

.apt-options-list {
  max-height: 190px;
  overflow-y: auto;
  padding: 4px;
}

.apt-option {
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s ease;
}

.apt-option:hover,
.apt-option.is-focused {
  background: #f1f5f9;
  color: var(--pond, #214a63);
}

.apt-option.is-selected {
  background: #eaf1f6;
  color: var(--pond, #214a63);
  font-weight: 700;
}

.apt-option-empty {
  padding: 14px;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
}

/* ==========================================================================
   BANNER DE SUGESTÃO E UNIFICAÇÃO (SEM SVG, CLEAN)
   ========================================================================== */
#new-occurrence-conflict-banner.ncb-suggestion-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: #f8fafc !important;
  border: 1px solid #dce5eb !important;
  border-left: 3px solid var(--pond, #214a63) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

.ncb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

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

.ncb-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}

.ncb-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.ncb-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ncb-count-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--pond, #214a63);
  background: #eaf1f6;
  border: 1px solid #c7d8e2;
  padding: 1px 6px;
  border-radius: 999px;
}

.ncb-toggle-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
}

.ncb-toggle-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.ncb-arrow {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#new-occurrence-conflict-banner.ncb-suggestion-card.is-minimized {
  gap: 0 !important;
  padding: 8px 12px !important;
}

#new-occurrence-conflict-banner.ncb-suggestion-card.is-minimized .ncb-list,
#new-occurrence-conflict-banner.ncb-suggestion-card.is-minimized .ncb-subtitle {
  display: none !important;
}

#new-occurrence-conflict-banner.ncb-suggestion-card.is-minimized .ncb-arrow {
  transform: rotate(-90deg) !important;
}

.ncb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.ncb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
}

.ncb-item:hover {
  border-color: #cbd5e1;
}

.ncb-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ncb-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ncb-item-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--pond, #214a63);
  background: #eaf1f6;
  border: 1px solid #c7d8e2;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.ncb-item-title {
  font-size: 11px;
  font-weight: 650;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ncb-item-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.ncb-btn-merge {
  background: #ffffff;
  color: var(--pond, #214a63);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ncb-btn-merge:hover {
  background: var(--pond, #214a63);
  color: #ffffff;
  border-color: var(--pond, #214a63);
}

/* Card de Unificação Ativa */
#new-occurrence-conflict-banner.ncb-merged-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  background: #f0f7fb !important;
  border: 1px solid #c9dbe7 !important;
  border-left: 3px solid var(--pond, #214a63) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  margin-bottom: 8px !important;
}

.ncb-merged-left {
  font-size: 11.5px;
  color: #1e3a5f;
  min-width: 0;
}

.ncb-merged-text strong {
  color: var(--pond, #214a63);
}

.ncb-btn-undo {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ncb-btn-undo:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ==========================================================================
   FUNCIONALIDADE DE COPIAR OS (SEM SVG)
   ========================================================================== */
.new-drawer-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ncb-btn-copy-header {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--pond, #214a63);
  font-size: 11px;
  font-weight: 650;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ncb-btn-copy-header:hover {
  background: #f1f5f9;
  border-color: var(--pond, #214a63);
}

/* Painel de busca rápida de OS para cópia */
.copy-os-panel {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.copy-os-panel[hidden] {
  display: none !important;
}

.copy-os-bar {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.copy-os-input {
  flex: 1;
  height: 28px !important;
  min-height: 28px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
  color: #0f172a !important;
  outline: none !important;
}

.copy-os-input:focus {
  border-color: var(--pond, #214a63) !important;
  box-shadow: 0 0 0 2px rgba(33, 74, 99, 0.15) !important;
}

.copy-os-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

.copy-os-close:hover {
  color: #0f172a;
}

.copy-os-list {
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.copy-os-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  transition: background 0.12s ease;
}

.copy-os-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.copy-os-item-title {
  color: #1e293b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-os-item-meta {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}

/* Botão Copiar na lista de sugestões */
.ncb-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ncb-btn-copy {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

/* Card avisando que os dados foram copiados para uma NOVA OS */
#new-occurrence-conflict-banner.ncb-copied-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-left: 3px solid #64748b !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  margin-bottom: 8px !important;
}

.ncb-copied-text {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.35;
}

.ncb-copied-text strong {
  color: var(--pond, #214a63);
}

/* ==========================================================================
   CORREÇÃO DEFINITIVA DO MENU MAPE (#start-drawer)
   ========================================================================== */

/* Garante que o botão da logo MAPE seja sempre clicável */
#start-menu-trigger {
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

#start-menu-trigger .taskbar-logo {
  pointer-events: none !important;
}

/* Força a abertura visual e altura do menu de painéis quando aberto */
#start-drawer.is-open {
  display: grid !important;
  grid-template-rows: 1fr !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1300 !important;
  transform: none !important;
}

#start-drawer.is-open > .drawer-surface {
  min-height: auto !important;
  overflow: visible !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Backdrop do menu */
#start-backdrop:not([hidden]) {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 34, 48, 0.22) !important;
  z-index: 1150 !important;
}


/* ==========================================================================
   ISOLAMENTO TOTAL ENTRE GAVETA DE OCORRÊNCIA E MENU DE APLICATIVOS
   ========================================================================== */

/* A gaveta de Nova Ocorrência SÓ abre se tiver a classe .is-open nela */
#new-occurrence-drawer:not(.is-open) {
  display: grid !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  grid-template-rows: 0fr !important;
}

/* O menu de aplicativos (start-drawer) SÓ abre se tiver a classe .is-open nele */
#start-drawer:not(.is-open) {
  display: grid !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  grid-template-rows: 0fr !important;
}

/* Quando o menu de aplicativos abre, ele é exibido com prioridade total */
#start-drawer.is-open {
  display: grid !important;
  grid-template-rows: 1fr !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1400 !important;
  top: calc(100% - 14px) !important;
}

#start-drawer.is-open > .drawer-surface {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #ffffff !important;
}

/* ==========================================================================
   CORREÇÃO DEFINITIVA DE POSICIONAMENTO E EXIBIÇÃO: #start-drawer
   ========================================================================== */

#start-menu-trigger {
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 1350 !important;
}

#start-menu-trigger * {
  pointer-events: none !important;
}

/* Estado Fechado */
#start-drawer:not(.is-open) {
  display: grid !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Estado Aberto: Força position absolute e dimensões sob a taskbar */
#start-drawer.is-open {
  display: grid !important;
  flex-direction: column !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-height: calc(100vh - 58px) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1400 !important;
  transform: translateY(0) !important;
  overflow: visible !important;
  filter: drop-shadow(0 18px 22px rgba(15, 34, 48, 0.22)) !important;
}

#start-drawer.is-open > .drawer-surface {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  background: #ffffff !important;
  border: 1px solid #c9d8e2 !important;
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: 0 20px 45px rgba(15, 34, 48, 0.26) !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: hidden !important;
}

/* Backdrop Escuro */
#start-backdrop:not([hidden]) {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 34, 48, 0.22) !important;
  z-index: 1150 !important;
}

/* ==========================================================================
   MENU MAPE: mesmo comportamento da gaveta Nova ocorrência
   sai de trás da taskbar (top calc(100% - 14px), z-index abaixo do fundo da barra)
   ========================================================================== */
#start-drawer.start-drawer {
  top: calc(100% - 14px) !important;
  z-index: 0 !important;
}

.start-drawer .new-drawer-head {
  padding-top: 30px !important;
}