/* Agenda dos técnicos (agenda.js) — grade de horários (redesign 17/11/2026, referência redesigner/agenda-os.html).
   Fica dentro da tela de O.S.: abaixo do topo do kanban e ao lado do menu lateral recolhido (top/left vêm do agenda.js).
   Fica abaixo dos modais do app (.modal-overlay = 200) pra "Abrir O.S." aparecer por cima. Destaque = azul do Vortex. */
#agenda-ov, .ag-mov, #ag-toast, .ag-fundo, .oscfg-ag {
  --ag-bg: var(--tc-bg, #0A0C11); --ag-s1: var(--tc-surface, #12151C); --ag-s2: #171B24; --ag-s3: #1E2330;
  --ag-bd: var(--tc-border, #262B38); --ag-bds: var(--tc-border-soft, #1C202B);
  --ag-t1: #EDEFF3; --ag-t2: #9298A8; --ag-t3: #565C6C;
  --ag-ac: var(--accent, #00c6ff); --ag-ac-s: rgba(0, 198, 255, .12); --ag-ac-b: rgba(0, 198, 255, .32);
  --ag-amber: #E3A23F; --ag-amber-s: rgba(227, 162, 63, .12); --ag-amber-b: rgba(227, 162, 63, .30);
  --ag-green: #43BE7E; --ag-green-s: rgba(67, 190, 126, .12); --ag-green-b: rgba(67, 190, 126, .30);
  --ag-red: #E1555C; --ag-red-s: rgba(225, 85, 92, .12); --ag-red-b: rgba(225, 85, 92, .30);
  --ag-info: #6C93F0; --ag-info-s: rgba(108, 147, 240, .12);
  --ag-fd: 'Space Grotesk', 'Inter', sans-serif; --ag-fb: 'Inter', sans-serif;
  font-family: var(--ag-fb); color: var(--ag-t1); font-size: 13px; line-height: 1.45;
}
#agenda-ov { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 150; background: var(--ag-bg); display: flex; flex-direction: column; transition: left .2s; }
#agenda-ov.hidden { display: none; }
#agenda-ov *, .ag-mov *, .oscfg-ag * { box-sizing: border-box; }
#agenda-ov button, .ag-mov button, .oscfg-ag button, #ag-toast button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#agenda-ov svg, .ag-mov svg, .oscfg-ag svg { display: block; flex-shrink: 0; }
#agenda-ov .dot, .ag-mov .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ag-fbody, .ag-area, .ag-abas, .ag-mov .m-body { scrollbar-width: none; }
.ag-fbody::-webkit-scrollbar, .ag-area::-webkit-scrollbar, .ag-abas::-webkit-scrollbar, .ag-mov .m-body::-webkit-scrollbar { display: none; }
#view-kanban.com-agenda #kanban-search-wrap, #view-kanban.com-agenda #filter-tipo, #view-kanban.com-agenda #filter-periodo,
#view-kanban.com-agenda #filter-tech, #view-kanban.com-agenda #filter-periodo-custom { display: none !important; }

/* botões */
.ag-ib { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--ag-bd) !important; background: var(--ag-s1) !important; display: grid; place-items: center; color: var(--ag-t2) !important; }
.ag-ib:hover { color: var(--ag-t1) !important; background: var(--ag-s2) !important; }
.ag-ib:disabled { opacity: .35; cursor: default; }
.ag-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.ag-btn.sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.ag-btn-p { background: linear-gradient(135deg, #00c6ff, #0072ff) !important; color: #fff !important; }
.ag-btn-p:hover { filter: brightness(1.08); }
.ag-btn-o { border: 1px solid var(--ag-bd) !important; background: var(--ag-s2) !important; color: var(--ag-t1) !important; font-weight: 500; }
.ag-btn-o:hover { background: var(--ag-s3) !important; }
.ag-btn-r { color: var(--ag-red) !important; font-weight: 500; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.ag-btn-r:hover { background: var(--ag-red-s) !important; }

/* chips e pills */
.ag-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 500; background: var(--ag-s3); color: var(--ag-t2); border: 1px solid transparent; white-space: nowrap; }
.ag-chip.amber { color: var(--ag-amber); background: var(--ag-amber-s); border-color: var(--ag-amber-b); }
.ag-chip.red { color: var(--ag-red); background: var(--ag-red-s); border-color: var(--ag-red-b); }
.ag-chip.green { color: var(--ag-green); background: var(--ag-green-s); border-color: var(--ag-green-b); }
.ag-chip.accent { color: var(--ag-ac); background: var(--ag-ac-s); border-color: var(--ag-ac-b); }
.ag-chip.info { color: var(--ag-info); background: var(--ag-info-s); }
.ag-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.ag-pill .dot { width: 6px !important; height: 6px !important; background: currentColor; }
.ag-pill.green { color: var(--ag-green); background: var(--ag-green-s); border-color: var(--ag-green-b); }
.ag-pill.accent { color: var(--ag-ac); background: var(--ag-ac-s); border-color: var(--ag-ac-b); }
.ag-pill.info { color: var(--ag-info); background: var(--ag-info-s); border-color: rgba(108, 147, 240, .3); }
.ag-pill.neutral { color: var(--ag-t2); background: var(--ag-s3); border-color: var(--ag-bd); }
.ag-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6C93F0, #9C82ED); color: #0A0C11; font-family: var(--ag-fd); font-weight: 700; font-size: 11px; display: grid; place-items: center; flex-shrink: 0; object-fit: cover; }
.ag-av.xs { width: 22px; height: 22px; font-size: 9px; }
.ag-vazio { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--ag-bd); border-radius: 10px; color: var(--ag-t3); font-size: 12.5px; }

/* técnicos */
.ag-topo { display: flex; align-items: center; gap: 12px; padding: 14px 24px 0; }
.ag-abas { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; }
.ag-tt { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px !important; border-radius: 12px; border: 1px solid var(--ag-bd) !important; background: var(--ag-s1) !important; min-width: 178px; text-align: left; flex-shrink: 0; }
.ag-tt:hover { background: var(--ag-s2) !important; }
.ag-tt.on { border-color: var(--ag-ac-b) !important; background: var(--ag-ac-s) !important; }
.ag-tt .tx { flex: 1; min-width: 0; }
.ag-tt .nm { font-family: var(--ag-fd); font-weight: 600; font-size: 13.5px; color: var(--ag-t1); white-space: nowrap; }
.ag-tt .st { font-size: 11.5px; color: var(--ag-t2); white-space: nowrap; }
.ag-tt .st.red, .who-in .st.red { color: var(--ag-red); } .ag-tt .st.green, .who-in .st.green { color: var(--ag-green); }
.ag-tt .st.amber { color: var(--ag-amber); } .ag-tt .st.info { color: var(--ag-info); }
.ag-mb { height: 3px; border-radius: 3px; background: var(--ag-s3); margin-top: 5px; overflow: hidden; }
.ag-mb span { display: block; height: 100%; border-radius: 3px; }
.ag-ico-eq { width: 30px; height: 30px; border-radius: 50%; background: var(--ag-s3); display: grid; place-items: center; color: var(--ag-t2); flex-shrink: 0; }
.ag-luana-selo { font-size: 11px; }

/* semana */
.ag-semana { display: flex; align-items: center; gap: 14px; padding: 12px 24px; }
.ag-wnav { display: flex; align-items: center; gap: 6px; }
.ag-wtit { white-space: nowrap; font-family: var(--ag-fd); font-weight: 600; font-size: 15px; margin-left: 4px; }
.ag-kpis { display: flex; gap: 6px; margin-left: 10px; flex: 1; min-width: 0; }
.ag-kpi { display: flex; align-items: baseline; gap: 7px; padding: 6px 11px; border-radius: 9px; background: var(--ag-s1); border: 1px solid var(--ag-bds); font-size: 12px; color: var(--ag-t3); white-space: nowrap; }
.ag-kpi b { font-family: var(--ag-fd); font-size: 14px; font-weight: 600; color: var(--ag-t1); }
.ag-kpi.red b { color: var(--ag-red); } .ag-kpi.amber b { color: var(--ag-amber); } .ag-kpi.green b { color: var(--ag-green); }
.ag-legenda { display: flex; align-items: center; gap: 12px; color: var(--ag-t3); font-size: 12px; }
.ag-legenda span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ag-legenda i { width: 3px; height: 12px; border-radius: 2px; display: block; }
.ag-ajuda { position: relative; }
.ag-ajuda .tip { position: absolute; right: 0; top: 36px; width: 320px; padding: 12px 14px; border-radius: 12px; background: var(--ag-s3); border: 1px solid var(--ag-bd); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); color: var(--ag-t2); font-size: 12px; line-height: 1.6; display: none; z-index: 20; }
.ag-ajuda .tip b { color: var(--ag-t1); }
.ag-ajuda:hover .tip { display: block; }
@media (max-width: 1500px) { .ag-legenda { display: none; } }

/* corpo: fila + grade */
.ag-corpo { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 24px 18px; }
.ag-fila { width: 268px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--ag-s1); border: 1px solid var(--ag-bd); border-radius: 16px; min-height: 0; transition: .15s; }
.ag-fila.over { border-color: var(--ag-ac-b); background: linear-gradient(var(--ag-ac-s), var(--ag-ac-s)), var(--ag-s1); }
.ag-fhead { padding: 14px 16px 12px; border-bottom: 1px solid var(--ag-bds); }
.ag-fhead .row { display: flex; align-items: center; gap: 8px; }
.ag-fhead h3 { font-family: var(--ag-fd); font-size: 14px; font-weight: 600; margin: 0; }
.ag-fhead p { color: var(--ag-t3); font-size: 12px; margin: 4px 0 0; }
.ag-count { font-family: var(--ag-fd); font-size: 12px; font-weight: 600; color: var(--ag-t2); background: var(--ag-s3); border-radius: 6px; padding: 1px 7px; }
.ag-fbody { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ag-qc { position: relative; background: var(--ag-s2); border: 1px solid var(--ag-bd); border-radius: 11px; padding: 10px 10px 10px 14px; cursor: grab; }
.ag-qc:hover { border-color: #323849; }
.ag-qc.drag { opacity: .4; }
.ag-qc::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc); }
.ag-qc .l1 { display: flex; align-items: center; gap: 8px; }
.ag-qc .ty { font-family: var(--ag-fd); font-weight: 600; font-size: 13px; }
.ag-qc .du { margin-left: auto; color: var(--ag-t3); font-size: 12px; }
.ag-qc .cl { color: var(--ag-t2); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-qc .l3 { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.ag-agendar { margin-left: auto; color: var(--ag-ac) !important; font-weight: 600; font-size: 12px; padding: 3px 7px !important; border-radius: 6px; }
.ag-agendar:hover { background: var(--ag-ac-s) !important; }
.ag-mais { color: var(--ag-t3) !important; font-size: 11.5px; padding: 6px !important; text-decoration: underline; }

.ag-area { flex: 1; min-width: 0; background: var(--ag-s1); border: 1px solid var(--ag-bd); border-radius: 16px; overflow: auto; position: relative; }
.ag-grade { display: grid; min-width: max-content; }
.ag-canto, .ag-dh { position: sticky; top: 0; z-index: 6; background: var(--ag-s1); border-bottom: 1px solid var(--ag-bd); }
.ag-canto { left: 0; z-index: 7; }
.ag-dh { padding: 12px 14px 10px; border-left: 1px solid var(--ag-bds); display: flex; flex-direction: column; gap: 7px; }
.ag-dh.hoje { background: linear-gradient(var(--ag-ac-s), var(--ag-ac-s)), var(--ag-s1); box-shadow: inset 0 2px 0 var(--ag-ac); }
.ag-dh .r1 { display: flex; align-items: baseline; gap: 6px; }
.ag-dh .dn { font-family: var(--ag-fd); font-weight: 600; font-size: 14px; }
.ag-dh.hoje .dn { color: var(--ag-ac); }
.ag-dh .dd { color: var(--ag-t3); font-family: var(--ag-fd); font-size: 13px; }
.ag-dh .met { margin-left: auto; font-family: var(--ag-fd); font-weight: 600; font-size: 12.5px; color: var(--ag-t2); white-space: nowrap; }
.ag-dh .met.red { color: var(--ag-red); }
.ag-cap { height: 4px; border-radius: 4px; background: var(--ag-s3); overflow: hidden; }
.ag-cap span { display: block; height: 100%; border-radius: 4px; }
.ag-dh .r3 { font-size: 12px; color: var(--ag-t3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ag-dh .r3 .red { color: var(--ag-red); font-weight: 500; } .ag-dh .r3 .green { color: var(--ag-green); }
.ag-exc { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-width: 0; min-height: 28px; padding: 0 8px; white-space: nowrap; overflow: hidden; border-radius: 8px; border: 1px solid var(--ag-red-b) !important; background: var(--ag-red-s) !important; color: var(--ag-red) !important; font-weight: 600; font-size: 12px; }
.ag-exc:hover { filter: brightness(1.15); }
.ag-exc span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ag-exc svg { flex-shrink: 0; }
.ag-eixo { position: sticky; left: 0; z-index: 5; background: var(--ag-s1); border-right: 1px solid var(--ag-bds); }
.ag-eixo .hl { position: absolute; right: 8px; transform: translateY(-50%); font-family: var(--ag-fd); font-size: 11px; color: var(--ag-t3); }
.ag-agora-l { position: absolute; right: 4px; transform: translateY(-50%); font-family: var(--ag-fd); font-size: 11px; font-weight: 600; color: var(--ag-ac); background: var(--ag-s1); padding: 1px 3px; border-radius: 4px; }
.ag-db { position: relative; border-left: 1px solid var(--ag-bds); background: var(--ag-bg); transition: background .12s; }
.ag-db.over { background: var(--ag-ac-s); }
.ag-hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--ag-bds); pointer-events: none; }
.ag-band { position: absolute; left: 0; right: 0; background: var(--ag-s1); pointer-events: none; }
.ag-alm { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255, 255, 255, .025) 7px 14px), var(--ag-bg); display: grid; place-items: center; color: var(--ag-t3); font-size: 11.5px; pointer-events: none; z-index: 2; }
.ag-fim { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--ag-red); pointer-events: none; z-index: 2; }
.ag-fim span { position: absolute; right: 6px; top: -9px; font-size: 10.5px; color: var(--ag-red); background: var(--ag-bg); padding: 0 5px; border-radius: 4px; font-weight: 500; }
.ag-agora { position: absolute; left: 0; right: 0; border-top: 2px solid var(--ag-ac); z-index: 6; pointer-events: none; }
.ag-agora::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ag-ac); }
.ag-livre { position: absolute; left: 8px; right: 8px; border: 1px dashed var(--ag-bd); border-radius: 9px; display: grid; place-items: center; color: var(--ag-t3); font-size: 12px; pointer-events: none; }
.ag-feriado { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(108, 147, 240, .05) 9px 18px); display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; color: var(--ag-info); font-size: 12px; text-align: center; pointer-events: none; }
.ag-desl { position: absolute; left: 14px; right: 8px; display: flex; align-items: center; gap: 5px; color: var(--ag-t3); font-size: 10.5px; pointer-events: none; transform: translateY(-50%); z-index: 1; }
.ag-drop { display: none; position: absolute; left: 0; right: 0; border-top: 2px solid var(--ag-ac); z-index: 8; pointer-events: none; }
.ag-drop span { position: absolute; left: 6px; top: -10px; font-family: var(--ag-fd); font-size: 11px; font-weight: 600; color: #fff; background: var(--ag-ac); border-radius: 4px; padding: 0 5px; }
.ag-db.over .ag-drop { display: block; }

/* cartão na grade */
.ag-ev { position: absolute; left: 6px; right: 6px; border-radius: 9px; background: var(--ag-s2); border: 1px solid var(--ag-bd); padding: 5px 8px 5px 11px; overflow: hidden; cursor: grab; z-index: 3; transition: border-color .12s, box-shadow .12s; }
.ag-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
.ag-ev:hover { border-color: #3a4155; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); z-index: 5; }
.ag-ev.drag { opacity: .4; }
.ag-ev .l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
#agenda-ov .ag-pin { flex: none; padding: 5px; margin: -5px -5px -5px -7px; border: 0; border-radius: 7px; background: none; font-size: 12px; line-height: 1; cursor: pointer; }
#agenda-ov .ag-pin:hover { background: rgba(255, 255, 255, .14); }
#agenda-ov .ag-pin:focus-visible { outline: 2px solid currentColor; }
.ag-ev .num { color: var(--ag-t3); font-family: var(--ag-fd); font-size: 11px; font-weight: 600; }
/* Número que vira alfinete no hover: clique fixa a O.S. na posição */
#agenda-ov .ag-fixa { flex: none; display: inline-grid; place-items: center; min-width: 20px; padding: 3px 4px; margin: -3px -4px; border: 0; border-radius: 6px; background: none; line-height: 1; cursor: pointer; }
#agenda-ov .ag-fixa .n, #agenda-ov .ag-fixa .p { grid-area: 1 / 1; }
#agenda-ov .ag-fixa .p { visibility: hidden; font-size: 12px; }
#agenda-ov .ag-fixa:hover, #agenda-ov .ag-fixa:focus-visible { background: rgba(255, 255, 255, .14); }
#agenda-ov .ag-fixa:hover .n, #agenda-ov .ag-fixa:focus-visible .n { visibility: hidden; }
#agenda-ov .ag-fixa:hover .p, #agenda-ov .ag-fixa:focus-visible .p { visibility: visible; }
#agenda-ov .ag-fixa:focus-visible { outline: 2px solid currentColor; }
.ag-ev .ty { font-family: var(--ag-fd); font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* online/offline do cliente (os-conexao-auto.js) */
.ag-wifi { display: inline-flex; flex: none; align-items: center; }
.ag-wifi.on { color: var(--ag-green); }
.ag-wifi.off { color: var(--ag-red); }
.ag-ev .tm { margin-left: auto; display: flex; align-items: center; gap: 3px; font-family: var(--ag-fd); font-size: 11.5px; color: var(--ag-t2); white-space: nowrap; }
.ag-ev .cl { color: var(--ag-t2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ag-ev.compacto .cl { margin: 0; flex-shrink: 1; min-width: 0; }
.ag-ev .l3 { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; max-height: 20px; overflow: hidden; }
.ag-ev.alto .l3 { max-height: 44px; }
.ag-ev.compacto { padding-top: 3px; padding-bottom: 3px; }
.ag-ev.feita { background: var(--ag-s1); border-color: var(--ag-bds); cursor: pointer; }
.ag-ev.feita::before { background: var(--ag-t3); }
.ag-ev.feita .ty, .ag-ev.feita .cl { color: var(--ag-t3); }
.ag-ev.feita .tm { color: var(--ag-green); }
.ag-ev.andando { border-color: var(--ag-ac-b); box-shadow: 0 0 0 1px var(--ag-ac-b); cursor: pointer; }
.ag-ev .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ag-ac); border-radius: 0 3px 0 0; }
.ag-ev.cont { cursor: pointer; border-style: dashed; padding-top: 2px; padding-bottom: 2px; }
.ag-ev.cont .ty { font-weight: 500; color: var(--ag-t2); font-size: 11.5px; }
.ag-ev.fora { background: linear-gradient(var(--ag-red-s), var(--ag-red-s)), var(--ag-s2); border-color: var(--ag-red-b); }

/* visão da equipe */
.ag-eq table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; }
.ag-eq th { position: sticky; top: 0; background: var(--ag-s1); z-index: 2; text-align: left; padding: 12px 12px 10px; font-weight: 500; color: var(--ag-t3); font-size: 12px; border-bottom: 1px solid var(--ag-bd); }
.ag-eq th b { display: block; font-family: var(--ag-fd); font-weight: 600; color: var(--ag-t1); font-size: 13.5px; }
.ag-eq th.hoje b { color: var(--ag-ac); }
.ag-eq td { padding: 8px; border-bottom: 1px solid var(--ag-bds); vertical-align: top; }
.ag-eq td.who { width: 210px; padding-left: 16px; }
.who-in { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.who-in .nm { font-family: var(--ag-fd); font-weight: 600; }
.who-in .st { font-size: 11.5px; color: var(--ag-t3); }
.ag-cell { border: 1px solid var(--ag-bd); background: var(--ag-s2); border-radius: 10px; padding: 9px 10px; cursor: pointer; min-height: 68px; transition: .12s; }
.ag-cell:hover { border-color: #3a4155; }
.ag-cell.over { border-color: var(--ag-ac-b); background: var(--ag-ac-s); }
.ag-cell .c1 { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--ag-t3); }
.ag-cell .c1 b { font-family: var(--ag-fd); font-size: 15px; color: var(--ag-t1); font-weight: 600; }
.ag-cell .c2 { font-size: 11.5px; margin-top: 6px; color: var(--ag-t3); }
.ag-cell .c2.red { color: var(--ag-red); } .ag-cell .c2.green { color: var(--ag-green); }
.ag-cell .dots { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.ag-cell .dots i { width: 6px; height: 6px; border-radius: 2px; display: block; }
.ag-cell.off { background: transparent; border-style: dashed; color: var(--ag-info); font-size: 12px; display: grid; place-items: center; cursor: default; }

/* detalhe da O.S. e tempos (modal) */
.ag-mov { position: fixed; inset: 0; background: rgba(5, 6, 9, .66); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 160; padding: 24px; }
.ag-modal { width: min(860px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--ag-s1); border: 1px solid var(--ag-bd); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: agPop .16s ease-out; }
@keyframes agPop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.ag-mov .m-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--ag-bds); }
.ag-mov .eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-mov .osid { font-family: var(--ag-fd); font-weight: 600; color: var(--ag-ac); }
.ag-mov .eyebrow .ty { display: flex; align-items: center; gap: 6px; color: var(--ag-t2); }
.ag-mov h2 { font-family: var(--ag-fd); font-size: 19px; font-weight: 600; margin: 6px 0 0; }
.ag-mov .m-head p { font-size: 12.5px; margin: 6px 0 0; line-height: 1.5; }
.ag-mov .close { margin-left: auto; flex-shrink: 0; }
.ag-mov .m-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ag-panel { background: var(--ag-s2); border: 1px solid var(--ag-bd); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.ag-panel h4 { display: flex; align-items: center; gap: 8px; font-family: var(--ag-fd); font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.ag-panel h4 svg { color: var(--ag-t3); }
.ag-kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 12.5px; margin: 0; }
.ag-kv dt { color: var(--ag-t3); }
.ag-kv dd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; margin: 0; }
.ag-kv dd.end { display: block; color: var(--ag-t2); line-height: 1.45; }
.ag-kv select { height: 30px; border-radius: 8px; border: 1px solid var(--ag-bd); background: var(--ag-s1); color: var(--ag-t1); padding: 0 8px; color-scheme: dark; font: inherit; }
.ag-mov .muted { color: var(--ag-t3); }
.ag-mov .span2 { grid-column: 1 / -1; }
.ag-mov .note { color: var(--ag-t2); line-height: 1.6; margin: 0; white-space: pre-wrap; }
.ag-mov .m-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--ag-bds); flex-wrap: wrap; }
.ag-mov .sep { flex: 1; }
.ag-mw { position: relative; }
.ag-menu { position: absolute; bottom: 42px; left: 0; min-width: 240px; max-height: 320px; overflow-y: auto; background: var(--ag-s3); border: 1px solid var(--ag-bd); border-radius: 12px; padding: 6px; display: none; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); z-index: 5; }
.ag-menu.on { display: block; }
.ag-menu button { display: flex !important; align-items: center; gap: 9px; width: 100%; padding: 7px 10px !important; border-radius: 8px; color: var(--ag-t2) !important; text-align: left; white-space: nowrap; }
.ag-menu button:hover { background: var(--ag-s2) !important; color: var(--ag-t1) !important; }
.ag-menu button .r { margin-left: auto; padding-left: 12px; font-size: 11.5px; color: var(--ag-t3); }
.ag-menu button.cur { color: var(--ag-t3) !important; cursor: default; }
.ag-menu button.cur:hover { background: none !important; }
.ag-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ag-tab th { text-align: left; color: var(--ag-t3); font-weight: 500; padding: 0 4px 6px; }
.ag-tab td { padding: 5px 4px; border-bottom: 1px solid var(--ag-bds); }
.ag-tab .r { text-align: right; color: var(--ag-t2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ag-tab td.r b { color: var(--ag-t1); }
.ag-tab small { color: var(--ag-t3); }
.ag-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ag-bds); font-size: 12.5px; }
.ag-field:last-child { border-bottom: 0; }
.ag-field label { color: var(--ag-t2); }
.ag-field input { width: 104px; height: 32px; border-radius: 8px; border: 1px solid var(--ag-bd); background: var(--ag-s1); padding: 0 10px; outline: 0; text-align: right; color: var(--ag-t1); color-scheme: dark; font: inherit; }
.ag-field input:focus { border-color: var(--ag-ac-b); }
@media (max-width: 760px) { .ag-mov .m-body { grid-template-columns: 1fr; } }

/* toast com "Desfazer" */
#ag-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--ag-s3); border: 1px solid var(--ag-bd); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); transition: .2s; z-index: 180; }
#ag-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#ag-toast button { color: var(--ag-ac); font-weight: 600; padding: 4px 8px; border-radius: 7px; }
#ag-toast button:hover { background: var(--ag-ac-s); }

/* diálogos antigos que continuam (Adiar várias, "A Luana avisa?") */
.ag-fundo { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 170; display: flex; align-items: center; justify-content: center; }
.ag-dlg { width: 520px; max-width: calc(100% - 32px); max-height: calc(100vh - 60px); overflow: auto; background: var(--ag-s1); border: 1px solid var(--ag-bd); border-radius: 14px; padding: 18px; }
.ag-dlg h3 { margin: 0 0 4px; font-size: 15px; font-family: var(--ag-fd); }
.ag-dlg p { margin: 0 0 12px; color: var(--ag-t2); font-size: 12.5px; line-height: 1.45; }
.ag-dlg .it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--ag-s2); margin-bottom: 5px; cursor: pointer; }
.ag-dlg .it input { accent-color: var(--ag-ac); width: 16px; height: 16px; }
.ag-dlg .it .pb { width: 3px; align-self: stretch; border-radius: 2px; background: var(--pc); }
.ag-dlg .it .tx { flex: 1; } .ag-dlg .it .tx small { display: block; color: var(--ag-t3); font-size: 11.5px; }
.ag-dlg .it .tg { font-size: 11px; color: var(--ag-t3); text-align: right; }
.ag-dlg .res { font-size: 12px; color: var(--ag-t2); background: var(--ag-s2); border-radius: 8px; padding: 8px 10px; margin: 8px 0; line-height: 1.5; }
.ag-dlg .bts { display: flex; gap: 8px; margin-top: 10px; }
.ag-dlg .bts button { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--ag-bd); background: var(--ag-s2); color: var(--ag-t1); cursor: pointer; font: inherit; }
.ag-dlg .bts .ok { background: linear-gradient(135deg, #00c6ff, #0072ff); color: #fff; border: 0; font-weight: 600; }

.col-agenda-btn { background: none; border: none; color: var(--tc-text-3, #565c6c); cursor: pointer; padding: 2px 4px; display: flex; align-items: center; margin-left: 4px; flex-shrink: 0; }
.col-agenda-btn:hover { color: var(--accent, #00c6ff); }

/* Pilha por dia (18/11/2026, a pedido): sem eixo de horas; cartões todos do mesmo tamanho, em sequência,
   com o almoço como divisória no meio da coluna e a linha do fim da jornada onde a previsão passa dela. */
.ag-grade { min-width: 0; }
.ag-dh { border-left: 0; border-right: 1px solid var(--ag-bds); }
.ag-db { display: flex; flex-direction: column; gap: 6px; padding: 10px 8px 16px; min-height: 100%; border-left: 0; border-right: 1px solid var(--ag-bds); }
.ag-db.folga { background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(108, 147, 240, .05) 9px 18px), var(--ag-bg); }
.ag-ev { position: relative; left: auto; right: auto; top: auto; flex: none; height: 84px; display: flex; flex-direction: column; padding: 8px 10px 6px 13px; }
.ag-ev .l3 { flex-wrap: nowrap; max-height: none; margin-top: auto; overflow: hidden; }
.ag-ev:hover { z-index: auto; }
.ag-desl { position: static; transform: none; padding-left: 8px; height: 12px; margin: -2px 0; }
.ag-alm-div { display: flex; align-items: center; gap: 8px; color: var(--ag-t3); font-size: 11px; margin: 4px 0; }
.ag-alm-div::before, .ag-alm-div::after { content: ""; flex: 1; height: 10px; background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .06) 5px 10px); border-radius: 3px; }
.ag-fim-div { position: relative; border-top: 1px dashed var(--ag-red); margin: 10px 0 6px; }
.ag-fim-div span { position: absolute; right: 4px; top: -9px; font-size: 10.5px; color: var(--ag-red); background: var(--ag-bg); padding: 0 5px; font-weight: 500; }
.ag-livre { position: static; height: 56px; flex: none; }
.ag-feriado-tag { color: var(--ag-info); font-size: 12px; text-align: center; padding: 6px 0 8px; }
.ag-drop { top: 0; height: 0; }
.ag-ev .l3 { flex-wrap: wrap; height: 20px; overflow: hidden; }

/* Arrastando: no topo de cada dia, área "entra pela prioridade" (soltar entre os cartões = ordem escolhida). */
.ag-auto { display: none; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; overflow: hidden; height: 44px; flex: none; border: 1.5px dashed var(--ag-ac-b); border-radius: 10px; color: var(--ag-ac); font-size: 12px; font-weight: 600; background: var(--ag-ac-s); }
.ag-auto svg { pointer-events: none; }
#agenda-ov.arrastando .ag-auto { display: flex; }
.ag-auto.on { border-style: solid; border-color: var(--ag-ac); background: rgba(0, 198, 255, .2); }
.ag-db.auto .ag-drop { display: none; }

/* Atalhos no topo do detalhe da O.S.: ficha do cliente e conversa no Atendimento. */
.ag-mov .m-atalhos { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ag-mov .m-atalhos .close { margin-left: 4px; }

.ag-fseta { display: none; }
/* ── Agenda no celular (23/11/2026) ──
   A fila lateral (268px fixos) tomava quase a tela toda e a grade dos dias ficava numa tira. No celular a fila vira uma
   faixa recolhida no topo (toque abre) e a grade ocupa a largura inteira, rolando de lado entre os dias. */
@media (max-width: 768px) {
  #agenda-ov .ag-topo { flex-wrap: wrap; padding: 8px 10px 0; gap: 8px; }
  #agenda-ov .ag-abas { flex: 1 1 100%; scrollbar-width: none; }
  #agenda-ov .ag-abas::-webkit-scrollbar { display: none; }
  #agenda-ov .ag-tt { flex-shrink: 0; }
  #agenda-ov .ag-semana { padding: 8px 10px; gap: 8px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  #agenda-ov .ag-semana::-webkit-scrollbar { display: none; }
  #agenda-ov .ag-semana > * { flex-shrink: 0; }
  #agenda-ov .ag-corpo { flex-direction: column; padding: 0 8px 10px; gap: 8px; }
  #agenda-ov .ag-fila { width: 100%; flex-shrink: 0; border-radius: 12px; max-height: 46vh; }
  #agenda-ov .ag-fhead { padding: 10px 14px; border-bottom: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  #agenda-ov .ag-fhead p { display: none; }
  #agenda-ov .ag-fseta { display: inline-block; margin-left: auto; color: var(--ag-t3); transition: transform .15s; }
  #agenda-ov .ag-fila.aberta .ag-fseta { transform: rotate(180deg); }
  #agenda-ov .ag-fila .ag-fbody { display: none; }
  #agenda-ov .ag-fila.aberta .ag-fhead { border-bottom: 1px solid var(--ag-bds); }
  #agenda-ov .ag-fila.aberta .ag-fbody { display: flex; }
  #agenda-ov .ag-area { flex: 1 1 auto; min-height: 0; width: 100%; border-radius: 12px; -webkit-overflow-scrolling: touch; }
  #agenda-ov .ag-qc .cl { white-space: normal; }
  .ag-mov { max-width: 100vw; }
  /* Kanban por baixo: fica só a barra do topo (abas e busca); filtros, quadro e contadores somem enquanto a agenda está aberta */
  #view-kanban.com-agenda > :not(.view-topbar) { display: none !important; }
  #view-kanban.com-agenda { overflow: hidden; }
  /* barra da semana: cada bloco com o tamanho do conteúdo (o "?" ficava por cima dos números) */
  #agenda-ov .ag-kpis { flex: none; margin-left: 2px; }
  #agenda-ov .ag-wtit { font-size: 14px; }
  #agenda-ov .ag-ajuda .tip { position: fixed; left: 10px; right: 10px; top: auto; bottom: 14px; width: auto; }
  #agenda-ov .ag-ajuda:focus-within .tip { display: block; }
  /* dias: um por vez na tela, com a beirada do próximo aparecendo; o dedo para em cada dia */
  #agenda-ov .ag-grade { --ag-col: 78vw; }
  #agenda-ov .ag-area { scroll-snap-type: x proximity; overscroll-behavior: contain; }
  #agenda-ov .ag-dh { scroll-snap-align: start; }
  /* alvos de toque maiores */
  #agenda-ov .ag-ib { min-width: 36px; min-height: 36px; }
  #agenda-ov .ag-atd { width: 34px; height: 28px; border-radius: 7px; }
  #agenda-ov .ag-atd svg { width: 15px; height: 15px; }
  #agenda-ov .ag-agendar { padding: 6px 4px 6px 10px; }
  #agenda-ov .ag-exc { min-height: 36px; }
}
/* Botão "Atend." nos cards: abre a conversa do cliente em popup */
.ag-atd { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 20px; width: 24px; padding: 0; border-radius: 5px; font: 500 11px inherit; font-family: inherit; background: transparent; color: #25D366; border: 1px solid rgba(37,211,102,.35); white-space: nowrap; cursor: pointer; }
.ag-atd:hover { background: rgba(37,211,102,.14); }

/* Pausar despachos (pausa-despacho.js) */
.pd-faixa { display: flex; align-items: center; gap: 10px; margin: 12px 24px 0; padding: 10px 14px; border-radius: 12px; background: var(--ag-amber-s); border: 1px solid var(--ag-amber-b); }
.pd-faixa .pd-tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pd-faixa b { color: var(--ag-amber); display: block; }
@media (max-width: 768px) { .pd-faixa { margin: 10px 12px 0; flex-wrap: wrap; } .pd-faixa .pd-tx { flex-basis: 100%; } }
