/* ============================================================
   work-orders.css — Ordens de Serviço
   Precifika — Etapa 1 de 6
   ============================================================ */

/* ── Variáveis (herda do :root global quando disponível) ──── */
:root {
  --wo-primary:    #0f172a;
  --wo-accent:     #2563eb;
  --wo-accent-lt:  #eff6ff;
  --wo-green:      #16a34a;
  --wo-green-lt:   #f0fdf4;
  --wo-yellow:     #d97706;
  --wo-yellow-lt:  #fffbeb;
  --wo-red:        #dc2626;
  --wo-red-lt:     #fef2f2;
  --wo-gray:       #64748b;
  --wo-gray-lt:    #f8fafc;
  --wo-border:     #e2e8f0;
  --wo-radius:     12px;
  --wo-radius-sm:  8px;
  --wo-shadow:     0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

/* ════════════════════════════════════════════════════════════
   CABEÇALHO DA PÁGINA
   ════════════════════════════════════════════════════════════ */

#page-work-orders {
  padding-bottom: 80px;
}

.wo-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.wo-page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.wo-page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--wo-accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wo-page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--wo-primary);
  margin: 0 0 4px;
}

.wo-page-sub {
  font-size: 13px;
  color: var(--wo-gray);
  margin: 0;
}

/* ════════════════════════════════════════════════════════════
   LOADING / EMPTY / ERROR
   ════════════════════════════════════════════════════════════ */

.wo-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--wo-gray);
  font-size: 14px;
  justify-content: center;
}

.wo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 24px;
  color: var(--wo-gray);
  text-align: center;
}

.wo-empty i {
  font-size: 48px;
  color: #cbd5e1;
}

.wo-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.wo-empty p {
  font-size: 14px;
  margin: 0;
  max-width: 360px;
  line-height: 1.6;
}

.wo-error {
  padding: 24px;
  color: var(--wo-red);
  background: var(--wo-red-lt);
  border-radius: var(--wo-radius);
  font-size: 13px;
  text-align: center;
}

.wo-empty-section {
  color: var(--wo-gray);
  font-size: 13px;
  font-style: italic;
  padding: 12px 0;
}

/* ════════════════════════════════════════════════════════════
   CARDS DE LISTAGEM
   ════════════════════════════════════════════════════════════ */

#wo-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius);
  box-shadow: var(--wo-shadow);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.wo-card:hover {
  border-color: var(--wo-accent);
  box-shadow: 0 4px 20px rgba(37,99,235,.12);
  transform: translateY(-1px);
}

.wo-card:active { transform: translateY(0); }

.wo-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.wo-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--wo-accent-lt);
  color: var(--wo-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.wo-card-info { min-width: 0; }

.wo-card-number {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.wo-card-project {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.wo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--wo-gray);
}

.wo-card-meta i { margin-right: 3px; }

.wo-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.wo-obra-num {
  font-size: 11px;
  color: var(--wo-gray);
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   STATUS BADGES
   ════════════════════════════════════════════════════════════ */

.wo-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.wo-status--aguardando-configuracao { background: #fef3c7; color: #92400e; }
.wo-status--em-andamento            { background: #dbeafe; color: #1d4ed8; }
.wo-status--concluida               { background: #dcfce7; color: #15803d; }
.wo-status--cancelada               { background: #f1f5f9; color: #64748b; }

/* ════════════════════════════════════════════════════════════
   DETALHE — CABEÇALHO
   ════════════════════════════════════════════════════════════ */

.wo-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--wo-border);
}

.wo-detail-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.wo-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--wo-border);
  background: #fff;
  color: var(--wo-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-top: 4px;
}

.wo-back-btn:hover {
  background: var(--wo-accent-lt);
  color: var(--wo-accent);
  border-color: var(--wo-accent);
}

.wo-detail-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--wo-accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.wo-detail-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--wo-primary);
  margin: 0 0 3px;
}

.wo-detail-obra {
  font-size: 12px;
  color: var(--wo-gray);
  font-weight: 500;
}

.wo-detail-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wo-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius-sm);
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.wo-btn-secondary:hover {
  background: var(--wo-accent-lt);
  color: var(--wo-accent);
  border-color: var(--wo-accent);
}

/* ════════════════════════════════════════════════════════════
   DETALHE — SEÇÕES
   ════════════════════════════════════════════════════════════ */

.wo-section {
  background: #fff;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--wo-shadow);
}

.wo-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wo-section-title i { color: var(--wo-accent); }

/* Grid de informações */
.wo-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.wo-info-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wo-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--wo-gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wo-info-label i { color: var(--wo-accent); font-size: 10px; }

.wo-info-value {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
}

/* Escopo */
.wo-scope-text {
  font-size: 13px;
  color: #334155;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ════════════════════════════════════════════════════════════
   ETAPAS E SERVIÇOS
   ════════════════════════════════════════════════════════════ */

.wo-stage-block {
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.wo-stage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--wo-border);
}

.wo-stage-seq {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--wo-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wo-stage-name {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  flex: 1;
}

.wo-stage-count {
  font-size: 11px;
  color: var(--wo-gray);
  font-weight: 500;
}

.wo-svc-table-wrap {
  overflow-x: auto;
}

.wo-svc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wo-svc-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--wo-gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #fafbfc;
  border-bottom: 1px solid var(--wo-border);
  white-space: nowrap;
}

.wo-th-name   { width: auto; }
.wo-th-unit   { width: 70px;  text-align: center; }
.wo-th-qty    { width: 90px;  text-align: right;  }
.wo-th-status { width: 130px; text-align: center; }

.wo-svc-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.wo-svc-row:last-child { border-bottom: none; }
.wo-svc-row:hover { background: #f8fafc; }

.wo-svc-row td {
  padding: 10px 14px;
  vertical-align: middle;
}

.wo-td-unit   { text-align: center; color: var(--wo-gray); }
.wo-td-qty    { text-align: right;  font-weight: 600; color: #1e293b; }
.wo-td-status { text-align: center; }

.wo-svc-name {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.wo-svc-desc {
  font-size: 11px;
  color: var(--wo-gray);
  margin-top: 2px;
}

.wo-svc-loc {
  font-size: 11px;
  color: var(--wo-accent);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Badges de status do serviço */
.wo-svc-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.wo-svc-status--pendente     { background: #f1f5f9; color: #475569; }
.wo-svc-status--em_andamento { background: #dbeafe; color: #1d4ed8; }
.wo-svc-status--concluido    { background: #dcfce7; color: #15803d; }
.wo-svc-status--cancelado    { background: #f8fafc; color: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   RODAPÉ DO DETALHE
   ════════════════════════════════════════════════════════════ */

.wo-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: #f8fafc;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius);
  margin-top: 8px;
}

.wo-footer-label {
  font-size: 12px;
  color: var(--wo-gray);
}

.wo-footer-note {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   BOTÃO "GERAR OS" — no builder do orçamento
   ════════════════════════════════════════════════════════════ */

.eb-btn-gerar-os {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid #059669;
  border-radius: 8px;
  background: #f0fdf4;
  color: #065f46;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  margin-left: 8px;
  letter-spacing: 0.2px;
}

.eb-btn-gerar-os i { font-size: 13px; }

.eb-btn-gerar-os:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5,150,105,.25);
}

.eb-btn-gerar-os:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ════════════════════════════════════════════════════════════
   ETAPA 5 — BOTÃO FINANCEIRO DA OBRA
   (visível apenas para usuários com view_financial — controlado por JS)
   ════════════════════════════════════════════════════════════ */

.wo-btn-financial {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.wo-btn-financial:hover {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
  box-shadow: 0 2px 8px rgba(234,88,12,.25);
}
.wo-btn-label { /* span dentro dos botões do header */
  display: inline;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVIDADE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .wo-card { flex-direction: column; align-items: flex-start; }
  .wo-card-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .wo-info-grid { grid-template-columns: 1fr 1fr; }
  .wo-detail-header { flex-direction: column; }
  .wo-detail-header-right { width: 100%; justify-content: flex-start; }
  .wo-svc-table { min-width: 480px; }
  .wo-th-status, .wo-td-status { display: none; }
}

@media (max-width: 480px) {
  .wo-page-title { font-size: 20px; }
  .wo-info-grid { grid-template-columns: 1fr; }
  .wo-card-meta { gap: 6px; }
  .eb-btn-gerar-os span { display: none; }
  .eb-btn-gerar-os { padding: 8px 10px; }
}

/* ════════════════════════════════════════════════════════════
   ETAPA 2 — CONFIGURAÇÃO OPERACIONAL
   ════════════════════════════════════════════════════════════ */

/* ── Visibilidade Desktop/Mobile ── */
.wo-desktop-only { display: block; }
.wo-mobile-only  { display: none;  }

/* ── Campos de formulário base ── */
.wo-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  display: block;
}
.wo-req { color: #dc2626; }

.wo-field-select,
.wo-field-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.wo-field-select:focus,
.wo-field-input:focus {
  outline: none;
  border-color: var(--wo-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.wo-field-select:disabled,
.wo-field-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.wo-field-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.wo-field-textarea:focus {
  outline: none;
  border-color: var(--wo-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* ── Responsáveis Gerais ── */
.wo-resp-section {
  background: #fff;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius);
  padding: 20px;
  margin-bottom: 16px;
}
.wo-resp-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.wo-resp-section-title i { color: var(--wo-accent); }

.wo-resp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.wo-resp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Responsáveis Externos — Painel Múltiplo (Req 3) ── */
.wo-ext-panel {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.wo-ext-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.wo-ext-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wo-ext-panel-title i { color: #3b82f6; }

.wo-ext-panel-hint {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.wo-ext-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wo-ext-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 20px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wo-ext-empty i { font-size: 16px; }

/* Card individual de responsável externo */
.wo-ext-card {
  background: #ffffff;
  border: 1px solid #dde1ea;
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wo-ext-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}

.wo-ext-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wo-ext-card-num {
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.wo-ext-card-num i { font-size: 13px; }

.wo-ext-card-remove {
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.wo-ext-card-remove:hover {
  background: #fef2f2;
  color: #dc2626;
}

.wo-ext-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.wo-ext-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wo-ext-field label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Botão Adicionar Responsável Externo */
.wo-btn-add-ext {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  border-top: 1px dashed #c7d2fe;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0 0 10px 10px;
}
.wo-btn-add-ext:hover {
  background: #eef2ff;
  color: #3730a3;
}
.wo-btn-add-ext i {
  font-size: 15px;
  color: #6366f1;
  transition: transform 0.2s;
}
.wo-btn-add-ext:hover i {
  transform: rotate(90deg) scale(1.1);
}

.wo-btn-link {
  background: none;
  border: none;
  color: var(--wo-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: opacity 0.15s;
}
.wo-btn-link:hover { opacity: 0.75; }

.wo-section-hint {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  margin-top: 6px;
  display: block;
}

/* ── Configuração por Etapa ── */
.wo-stage-resp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px 14px;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
}
.wo-stage-resp-label {
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.wo-stage-resp-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
  flex: 1;
}
.wo-btn-stage-apply {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: #0369a1;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  align-self: flex-end;
}
.wo-btn-stage-apply:hover {
  background: #0284c7;
  box-shadow: 0 2px 8px rgba(3,105,161,.3);
}

/* ── Tabela de configuração de serviços (desktop) ── */
.wo-svc-table--config th,
.wo-svc-table--config td { vertical-align: middle; }

.wo-th-chk  { width: 36px;  text-align: center; padding: 9px 8px !important; }
.wo-td-chk  { text-align: center; padding: 8px 8px !important; }
.wo-th-exec { width: 150px; }
.wo-th-date { width: 120px; }
.wo-th-dur  { width: 100px; }
.wo-th-prio { width: 90px;  }
.wo-th-par  { width: 60px;  text-align: center; }
.wo-th-act  { width: 70px;  text-align: center; }
.wo-td-act  { text-align: center; padding: 6px 8px !important; }

/* ── Controles inline na tabela ── */
.wo-inline-select,
.wo-inline-input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.wo-inline-select:focus,
.wo-inline-input:focus {
  outline: none;
  border-color: var(--wo-accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.wo-inline-select:disabled,
.wo-inline-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
.wo-inline-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--wo-accent);
}
.wo-dur-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.wo-dur-val {
  flex: 1;
  min-width: 52px;
}
.wo-dur-unit {
  width: 70px;
  flex-shrink: 0;
}

/* ── Seleção em massa ── */
.wo-bulk-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(109,40,217,.08);
}
.wo-bulk-count {
  font-size: 12px;
  font-weight: 700;
  color: #5b21b6;
  flex: 1;
}
.wo-btn-bulk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid #7c3aed;
  border-radius: 7px;
  background: #fff;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.wo-btn-bulk:hover {
  background: #7c3aed;
  color: #fff;
}

/* ── Cartões mobile ── */
.wo-svc-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wo-svc-card {
  background: #fff;
  border: 1px solid var(--wo-border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.wo-svc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.wo-svc-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}
.wo-svc-card-qty {
  font-size: 11px;
  color: var(--wo-gray);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.wo-svc-card-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.5;
}
.wo-svc-card-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.wo-svc-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wo-btn-card-detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e0e7ff;
  border-radius: 8px;
  background: #f5f3ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  justify-content: center;
  transition: all 0.15s;
}
.wo-btn-card-detail:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

/* ── Barra de ações principal ── */
.wo-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--wo-border);
  border-radius: var(--wo-radius);
  margin-top: 16px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
}
.wo-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wo-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wo-autosave-status {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wo-autosave-status.saved  { color: #16a34a; }
.wo-autosave-status.saving { color: #d97706; }
.wo-autosave-status.error  { color: #dc2626; }

.wo-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--wo-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.wo-btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 3px 10px rgba(99,102,241,.35);
}
.wo-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
.wo-btn-sm {
  padding: 7px 13px;
  font-size: 12px;
}

/* ── Modal de detalhe do serviço ── */
.wo-svc-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
}
.wo-svc-detail-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wo-svc-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wo-border);
  background: #f8fafc;
}
.wo-svc-detail-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.wo-svc-detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.wo-svc-detail-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--wo-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f8fafc;
}
.wo-svc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.wo-svc-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wo-svc-detail-full {
  grid-column: 1 / -1;
}
.wo-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.wo-modal-close:hover { color: #dc2626; background: #fee2e2; }

/* ── Chips de executores auxiliares ── */
.wo-aux-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}
.wo-aux-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.wo-aux-chip button {
  background: none;
  border: none;
  color: #7c3aed;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.wo-aux-chip button:hover { color: #dc2626; }

.wo-aux-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.wo-aux-add-row select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 12px;
  color: #1e293b;
}
.wo-aux-add-row button {
  padding: 6px 12px;
  background: var(--wo-accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.wo-aux-add-row button:hover { background: #4338ca; }

/* ── Responsividade Etapa 2 ── */
@media (max-width: 768px) {
  .wo-desktop-only { display: none !important; }
  .wo-mobile-only  { display: block; }

  .wo-resp-grid        { grid-template-columns: 1fr; }
  .wo-ext-card-grid    { grid-template-columns: 1fr; }
  .wo-ext-panel-header { flex-direction: column; gap: 4px; }

  .wo-stage-resp-row {
    flex-direction: column;
    align-items: stretch;
  }
  .wo-stage-resp-field { min-width: unset; width: 100%; }
  .wo-btn-stage-apply  { width: 100%; justify-content: center; }

  .wo-bulk-toolbar { flex-direction: column; align-items: flex-start; }
  .wo-btn-bulk     { width: 100%; justify-content: center; }

  .wo-actions-bar { flex-direction: column; align-items: stretch; }
  .wo-actions-left,
  .wo-actions-right { width: 100%; justify-content: center; }
  .wo-btn-primary  { width: 100%; justify-content: center; }

  .wo-svc-detail-box { max-width: 100%; border-radius: 12px 12px 0 0; }
  .wo-svc-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .wo-svc-card-fields-row { grid-template-columns: 1fr; }
  .wo-resp-section { padding: 14px; }
  .wo-svc-detail-body { padding: 14px; }
}
