/* ══════════════════════════════════════
   PORTAL DO TÉCNICO — tecnico.css
══════════════════════════════════════ */

/* ── HEADER ── */
.tec-header{background:#1A3F80;padding:0 28px;height:58px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:10;box-shadow:0 2px 12px rgba(0,0,0,.18);}
.tec-header-left{display:flex;align-items:center;gap:14px;}
.tec-portal-tag{background:rgba(255,255,255,.14);color:#fff;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1px;padding:3px 10px;border-radius:20px;}
.tec-header-right{display:flex;align-items:center;gap:10px;color:#fff;}
.tec-header-nome{font-size:14px;font-weight:600;color:#fff;}
.tec-sair-btn{background:rgba(255,255,255,.15);color:#fff;border:none;padding:7px 14px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:5px;min-height:36px;}
.tec-sair-btn:hover{background:rgba(255,255,255,.27);}

/* ── CONTEÚDO ── */
.tec-content{max-width:900px;margin:0 auto;padding:24px 20px;}
.tec-page-title{font-family:'Syne',sans-serif;font-size:19px;font-weight:800;color:#1A3F80;margin-bottom:16px;}
.tec-empty,.tec-loading{text-align:center;padding:52px 24px;color:#9CA3AF;font-size:15px;}

/* ── LISTA DE CARDS (foi grid) ── */
.tec-cards-grid{display:flex;flex-direction:column;border:1.5px solid #E2E8F0;border-radius:12px;overflow:hidden;background:#fff;}

/* ── CARD — novo layout horizontal ── */
.tec-card{
  background:#F3F4F6;
  border-radius:0;
  padding:14px 16px 14px 0;
  cursor:pointer;
  border:none;
  border-left:5px solid #D1D5DB;
  border-bottom:1px solid #EEF1F7;
  display:flex;
  gap:0;
  align-items:stretch;
  transition:background .12s;
}
.tec-card:last-child{border-bottom:none;}
.tec-card:hover{background:#F8FAFC;}
.tec-card-inner{display:flex;flex:1;gap:10px;align-items:flex-start;padding-left:14px;}

/* Card body (esquerda — informações) */
.tec-card-body{flex:1;min-width:0;}

/* Card right (SLA + índice) */
.tec-card-r{flex-shrink:0;text-align:right;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;padding-left:12px;min-width:72px;}

/* Linhas do card */
.tec-card-l1{font-size:14px;font-weight:700;color:#1A202C;margin-bottom:3px;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;}
/* Era 'Syne' (fonte de destaque/título do portal) a peso 900 — os
   numerais dessa fonte são estilizados/geométricos, difíceis de ler rápido
   num número de O.S.. Troca pra --font-b ('DM Sans', a fonte de TEXTO do
   design system — ver css/style.css :root), que é a mesma usada no corpo
   do site inteiro; mantém negrito e sobe 1px o tamanho pra continuar tendo
   destaque sem depender da fonte estilizada. */
.tec-card-num{font-family:var(--font-b);font-size:14px;font-weight:700;color:#1A3F80;flex-shrink:0;}
.tec-card-cliente-nome{font-size:14px;font-weight:700;color:#1A202C;}
.tec-card-cod{font-size:11px;color:#9CA3AF;font-weight:400;}
.tec-card-l2{font-size:12px;color:#6B7280;margin-bottom:3px;}
.tec-card-l3{font-size:11.5px;color:#374151;font-family:monospace;margin-bottom:6px;letter-spacing:.2px;}
.tec-card-l4{display:flex;gap:5px;align-items:center;flex-wrap:wrap;}

/* SLA display (lado direito) */
.tec-card-sla-val{font-size:19px;font-weight:800;color:#374151;font-family:'Syne',sans-serif;line-height:1.1;}
.tec-card-sla-unit{font-size:9.5px;color:#9CA3AF;font-weight:500;text-transform:uppercase;letter-spacing:.3px;}
.tec-card-idx{font-size:10px;color:#CBD5E1;font-weight:700;margin-top:6px;}
.tec-sla-atrasado{color:#DC2626!important;}

/* Borda esquerda por TIPO */
.tec-tipo-brd-corretiva{border-left-color:#DC2626;}
.tec-tipo-brd-manutencao,.tec-tipo-brd-manutencao_preventiva{border-left-color:#1D4ED8;}
.tec-tipo-brd-instalacao{border-left-color:#16A34A;}
.tec-tipo-brd-desinstalacao{border-left-color:#F97316;}
.tec-tipo-brd-vistoria,.tec-tipo-brd-visita_tecnica{border-left-color:#7C3AED;}
.tec-tipo-brd-troca_pecas,.tec-tipo-brd-troca_de_pecas{border-left-color:#CA8A04;}
.tec-tipo-brd-assistencia{border-left-color:#6B7280;}
.tec-tipo-brd-aguardando_peca{border-left-color:#BE123C;}

/* Fundo pastel por TIPO (mesma classe tec-tipo-brd-*, já aplicada em todo
   card — cor de fundo suave, além do accent da borda esquerda acima).
   corretiva/assistencia dividem o mesmo tom porque, na prática, são o
   mesmo balde de "atendimento corretivo" (tipo_servico='corretiva' só
   aparece em alguns registros; a maioria usa 'assistencia' — sondagem em
   produção: hoje 100% dos chamados reais estão como tipo_chamado=
   tipo_servico='assistencia', 'corretiva' nunca foi usado ainda, mas o
   rótulo existe em _TEC_TIPO_MAP como valor distinto). Tipos sem regra
   própria (vistoria, visita_tecnica, troca_pecas, troca_de_pecas,
   suprimento, avulso, outro, e qualquer valor futuro não mapeado) caem no
   cinza neutro herdado da base .tec-card acima — não precisam de regra
   dedicada, é o comportamento padrão do card.  */
.tec-tipo-brd-corretiva,.tec-tipo-brd-assistencia{background:#FEE2E2;}
.tec-tipo-brd-instalacao{background:#DBEAFE;}
.tec-tipo-brd-desinstalacao{background:#FEF9C3;}
.tec-tipo-brd-manutencao,.tec-tipo-brd-manutencao_preventiva,.tec-tipo-brd-preventiva{background:#DCFCE7;}

/* ── BADGES DE STATUS ── */
.tec-badge-st{font-size:10px;font-weight:700;padding:2px 8px;border-radius:20px;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap;}
.tec-st-aberto,.tec-st-despachado{background:#DBEAFE;color:#1D4ED8;}
.tec-st-em_deslocamento{background:#FEF3C7;color:#92400E;}
.tec-st-em_atendimento,.tec-st-andamento{background:#FFEDD5;color:#C2410C;}
.tec-st-aguardando_peca{background:#FFE4E6;color:#BE123C;}
.tec-st-peca_entregue{background:#DCFCE7;color:#16A34A;}
.tec-st-pendente{background:#E5E7EB;color:#374151;}
.tec-st-encerrado{background:#DCFCE7;color:#166534;}

/* ── BADGES DE TIPO ── */
.tec-tipo-badge{display:inline-block;font-size:10px;font-weight:700;padding:2px 7px;border-radius:10px;letter-spacing:.2px;white-space:nowrap;}
.tec-tipo-corretiva{background:#FEE2E2;color:#DC2626;}
.tec-tipo-manutencao,.tec-tipo-manutencao_preventiva{background:#DBEAFE;color:#0A4B8D;}
.tec-tipo-instalacao{background:#DCFCE7;color:#16A34A;}
.tec-tipo-desinstalacao{background:#FFEDD5;color:#F97316;}
.tec-tipo-vistoria,.tec-tipo-visita_tecnica{background:#EDE9FE;color:#7C3AED;}
.tec-tipo-troca_pecas,.tec-tipo-troca_de_pecas{background:#FEF9C3;color:#CA8A04;}
.tec-tipo-assistencia{background:#F3F4F6;color:#6B7280;}

/* ── BADGES DE PEÇAS (status) ── */
.tec-pecas-badge{display:inline-block;font-size:10px;font-weight:700;padding:3px 9px;border-radius:12px;white-space:nowrap;}
.tec-pecas-solicitado{background:#FEF9C3;color:#CA8A04;}
.tec-pecas-faturado{background:#DBEAFE;color:#0A4B8D;}
.tec-pecas-despachado{background:#FFEDD5;color:#F97316;}
.tec-pecas-entregue{background:#DCFCE7;color:#16A34A;}
/* Badge simplificado (2 estados) em cima de chamado_pecas_pendentes.status,
   exibido no card de "Meus Chamados" — ver _tecPecaBadgeHtml. */
.tec-pecas-aguardando{background:#FFE4E6;color:#BE123C;}

/* ── MODAL DO CHAMADO ── */
.tec-modal-header{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.tec-modal-header h2{font-family:'Syne',sans-serif;font-size:19px;font-weight:900;color:#1A3F80;margin:0;}
.tec-modal-sla{display:inline-block;font-size:12.5px;font-weight:600;color:#4B5563;background:#F0F4FA;padding:5px 12px;border-radius:8px;margin-bottom:14px;}

/* Grid de detalhes */
.tec-det-grid{border:1px solid #EEF1F7;border-radius:10px;overflow:hidden;margin-bottom:14px;}
.tec-det-row{display:flex;align-items:stretch;border-bottom:1px solid #EEF1F7;}
.tec-det-row:last-child{border-bottom:none;}
.tec-det-lbl{min-width:130px;width:130px;flex-shrink:0;padding:8px 12px;font-size:11px;font-weight:700;color:#1A3F80;background:#F0F4FA;text-transform:uppercase;letter-spacing:.3px;}
.tec-det-val{padding:8px 12px;font-size:13px;color:#222;flex:1;}
.tec-det-row-full{flex-direction:column;}
.tec-det-row-full .tec-det-lbl{width:100%;border-bottom:1px solid #EEF1F7;}
.tec-det-row-full .tec-det-val{padding:10px 12px;}
.tec-det-section{margin-bottom:14px;}
.tec-det-lbl-standalone{font-size:11px;font-weight:700;color:#1A3F80;text-transform:uppercase;letter-spacing:.3px;margin-bottom:8px;}

/* Obs. interna */
.tec-obs-interna-box{background:#FFFBEB;border:1.5px solid #FCD34D;border-radius:9px;padding:10px 12px;font-size:13px;color:#374151;margin-top:6px;white-space:pre-wrap;}

/* ── BOTÕES DE AÇÃO ── */
.tec-acoes{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid #EEF1F7;}
.tec-btn{padding:10px 18px;min-height:48px;border:none;border-radius:9px;font-size:13px;font-weight:700;cursor:pointer;font-family:'Syne',sans-serif;transition:opacity .15s;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;}
.tec-btn:hover{opacity:.83;}
.tec-btn-amarelo{background:#F59E0B;color:#fff;}
.tec-btn-laranja{background:#F97316;color:#fff;}
.tec-btn-verde{background:#22C55E;color:#fff;}
.tec-btn-vermelho{background:#EF4444;color:#fff;}
.tec-btn-cinza{background:#6B7280;color:#fff;}
.tec-btn-fechar{background:#EEF1F7;color:#4A5568;padding:10px 22px;min-height:44px;border:none;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}
.tec-btn-fechar:hover{background:#E2E8F0;}

/* ── FOTOS ── */
.tec-fotos-section{margin-top:14px;padding-top:14px;border-top:1px solid #EEF1F7;}
.tec-fotos-grid{display:flex;flex-wrap:wrap;gap:8px;min-height:8px;margin-bottom:10px;}
.tec-foto-thumb{width:68px;height:68px;object-fit:cover;border-radius:8px;border:2px solid #EEF1F7;transition:opacity .15s;}
.tec-foto-thumb:hover{opacity:.85;}
.tec-btn-foto{display:inline-block;background:#EBF4FF;color:#1A3F80;border:1.5px solid #BFDBFE;padding:8px 14px;min-height:40px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}
.tec-btn-foto:hover{background:#DBEAFE;}

/* ── LINHA DE PEÇA (modal encerrar) ── */
.tec-peca-row{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
.tec-peca-row .ac-input{margin:0;}

/* ── LISTA DE PEÇAS DISPONÍVEIS (modal solicitar peças) ── */
.tec-peca-disponivel-wrap{max-height:300px;overflow-y:auto;border:1.5px solid #EEF1F7;border-radius:10px;padding:6px 10px;margin-bottom:14px;}
.tec-peca-check-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 2px;border-bottom:1px solid #F3F4F6;}
.tec-peca-check-row:last-child{border-bottom:none;}
.tec-peca-check{display:flex;align-items:center;gap:8px;font-size:13px;color:#374151;cursor:pointer;flex:1;min-width:0;}
.tec-peca-check input{width:16px;height:16px;flex-shrink:0;cursor:pointer;}
.tec-peca-check span{overflow-wrap:anywhere;}
.tec-peca-qtd-input{width:56px;flex-shrink:0;padding:5px 6px;border:1.5px solid #E5E7EB;border-radius:6px;font-size:13px;text-align:center;}
.tec-peca-qtd-input:disabled{opacity:.4;background:#F9FAFB;}

/* ── BOTÃO AZUL ── */
.tec-btn-azul{background:#1A3F80;color:#fff;display:flex;align-items:center;gap:6px;white-space:nowrap;}
.tec-btn-azul:hover{opacity:.85;}

/* ── NAV TABS ── */
.tec-nav-tabs{display:flex;gap:0;margin-bottom:20px;border-bottom:2px solid #DEE3ED;}
.tec-nav-tab{background:none;border:none;border-bottom:3px solid transparent;padding:10px 22px;font-size:14px;font-weight:700;color:#6B7A99;cursor:pointer;margin-bottom:-2px;transition:all .2s;font-family:'Syne',sans-serif;}
.tec-nav-tab:hover{color:#1A3F80;}
.tec-nav-tab.active{color:#1A3F80;border-bottom-color:#1A3F80;}

/* ── HISTÓRICO DE EQUIPAMENTO ── */
.tec-hist-search{display:flex;gap:10px;margin-bottom:20px;}
.tec-hist-search .ac-input{flex:1;min-width:0;}
.tec-hist-equip-info{background:#fff;border:1.5px solid #DEE3ED;border-radius:12px;padding:16px 20px;margin-bottom:16px;}
.tec-hist-equip-info .he-title{font-size:11px;font-weight:700;color:#1A3F80;margin-bottom:10px;text-transform:uppercase;letter-spacing:.5px;}
.tec-hist-equip-info .he-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;}
.tec-hist-equip-info .he-field{font-size:12px;color:#4A5568;line-height:1.5;}
.tec-hist-equip-info .he-field b{color:#1A2E5A;font-size:10px;text-transform:uppercase;letter-spacing:.3px;display:block;margin-bottom:2px;}
.tec-hist-empty{text-align:center;padding:48px 20px;color:#9CA3AF;font-size:14px;}
.tec-hist-paginacao{display:flex;align-items:center;justify-content:center;gap:16px;padding:20px 0;margin-top:4px;}
.tec-hist-paginacao span{font-size:13px;color:#6B7A99;font-weight:500;}
.tec-hist-paginacao button{background:#fff;border:1.5px solid #DEE3ED;border-radius:8px;padding:10px 18px;min-height:44px;font-size:13px;font-weight:600;color:#1A3F80;cursor:pointer;transition:all .2s;}
.tec-hist-paginacao button:hover:not(:disabled){background:#EEF1F7;}
.tec-hist-paginacao button:disabled{opacity:.4;cursor:default;}
.tec-card-hist{cursor:pointer;}

/* ── RESPONSIVO MOBILE ── */
@media(max-width:640px){
  /* Layout base */
  .tec-content{padding:12px;}
  .tec-header{padding:0 14px;height:52px;}
  .tec-header-left svg{height:26px;}
  .tec-portal-tag{display:none;}
  .tec-header-right{gap:6px;}
  .tec-header-nome{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

  /* Tabs */
  .tec-nav-tabs{overflow-x:auto;white-space:nowrap;}
  .tec-nav-tab{padding:9px 14px;font-size:13px;}

  /* Cards */
  .tec-card-r{min-width:60px;}
  .tec-card-sla-val{font-size:16px;}

  /* Botões de ação — grandes e fáceis de tocar */
  .tec-acoes{flex-direction:column;gap:8px;}
  .tec-btn{width:100%;justify-content:center;min-height:52px;font-size:14px;}
  .tec-btn-fechar{width:100%;text-align:center;min-height:50px;}

  /* Modal como bottom sheet no mobile */
  #tec-chamado-modal.open,
  #tec-hist-modal.open,
  #tec-encerrar-modal.open,
  #tec-pend-modal.open,
  #tec-peca-modal.open{
    align-items:flex-end;
    padding:0;
  }
  #tec-chamado-modal .modal,
  #tec-hist-modal .modal,
  #tec-encerrar-modal .modal,
  #tec-pend-modal .modal,
  #tec-peca-modal .modal{
    max-width:100%;
    width:100%;
    border-radius:20px 20px 0 0;
    max-height:92vh;
    margin:0;
    padding:20px 16px 24px;
  }

  /* Histórico */
  .tec-hist-search{flex-direction:column;}
  .tec-hist-equip-info .he-grid{grid-template-columns:1fr 1fr;}
}
