/* ASM OS — modulos/agenda.css (prefixo .ag-; tema black: só tokens do tema.css) */
/* cor de cada tipo de compromisso: a do tópico quando existe (O.S. = atendimento, orçamento = comercial, manutenção = campo) */
.t-os { --c: var(--sec-atendimento); }
.t-manutencao { --c: var(--sec-campo); }
.t-pmoc { --c: var(--cat-agua); }
.t-cert { --c: var(--info); }
.t-orcamento { --c: var(--sec-comercial); }
.t-ocorrencia { --c: var(--perigo); }
.st-pendente { --c: var(--aviso); } .st-agendado { --c: var(--info); } .st-concluido { --c: var(--sucesso); }

.ag-alerta { display: flex; align-items: center; gap: 12px; background-color: var(--sup-1); border: 1px solid color-mix(in srgb, var(--aviso) 28%, transparent); border-radius: var(--r-lg); padding: 12px 14px 12px 16px; margin-bottom: 14px; box-shadow: var(--brilho); }
.ag-alerta-ic { width: 32px; height: 32px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--aviso) 12%, transparent); color: var(--aviso); }
.ag-alerta-tx { flex: 1; min-width: 0; }
.ag-alerta-t { font-size: 13.5px; font-weight: 500; color: var(--texto); line-height: 20px; }
.ag-alerta-s { font: 400 12px/18px var(--mono); color: var(--texto-suave); }
.ag-alerta-x { border: 0; background: none; color: var(--texto-suave); padding: 6px; border-radius: 8px; cursor: pointer; display: flex; }
.ag-alerta-x:hover { background: var(--sup-3); color: var(--texto); }

.ag-cal { display: flex; background-color: var(--sup-1); border: 1px solid var(--borda); border-radius: var(--r-xl); box-shadow: var(--brilho); overflow: hidden; }
.ag-lateral { width: 228px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--borda); background: var(--fundo-nav); }
.ag-lat-cab { display: flex; align-items: center; gap: 10px; padding: 16px; height: 64px; border-bottom: 1px solid var(--borda); }
.ag-lat-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--topico-suave); border: 1px solid color-mix(in srgb, var(--topico) 22%, transparent); color: var(--topico); display: flex; align-items: center; justify-content: center; }
.ag-lat-tit { font-size: 14px; font-weight: 500; color: var(--texto); }
.ag-sec { padding: 16px; }
.ag-sec + .ag-sec { border-top: 1px solid var(--borda); }
.ag-sec-t, .ag-resumo .ag-sec-t { font: 400 11.5px/16px var(--mono); color: var(--texto-fraco); margin-bottom: 8px; }
.ag-tipo { display: flex; align-items: center; gap: 10px; height: 30px; cursor: pointer; font-size: 13px; color: var(--texto-suave); }
.ag-tipo:hover { color: var(--texto); }
.ag-tipo input { width: 14px; height: 14px; margin: 0; flex: none; }
.ag-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--c); }
.ag-tecs { display: flex; flex-direction: column; gap: 2px; }
.ag-tec { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 9px; border: 0; background: none; cursor: pointer; font: 400 13px var(--fonte); color: var(--texto-suave); text-align: left; width: 100%; transition: background var(--anim), color var(--anim); }
.ag-tec span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ag-tec:hover { background: var(--sup-2); color: var(--texto); }
.ag-av { width: 24px; height: 24px; border-radius: 50%; background: var(--sup-3); border: 1px solid var(--borda); color: var(--texto-suave); font: 500 9.5px var(--mono); display: flex; align-items: center; justify-content: center; flex: none; }
.ag-tec.ativo { background: var(--sup-3); color: var(--texto); box-shadow: var(--brilho); }
.ag-tec.ativo span { font-weight: 500; }
.ag-tec.ativo .ag-av { background: var(--destaque); border-color: transparent; color: var(--sobre-destaque); }
.ag-resumo { margin-top: auto; border-top: 1px solid var(--borda); padding: 16px 16px 20px; }
.ag-res-l { display: flex; align-items: center; justify-content: space-between; height: 28px; font-size: 13px; color: var(--texto-suave); }
.ag-res-n { min-width: 28px; text-align: center; font: 500 12px/18px var(--mono); font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 6px; color: var(--texto); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }

.ag-princ { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--borda); }
.ag-tb-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ag-tb-linha.dir { justify-content: flex-end; margin-left: auto; }
.ag-nav { display: flex; align-items: center; gap: 6px; }
.ag-navbtn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--borda-2); background: var(--sup-2); border-radius: 9px; color: var(--texto-suave); padding: 0; cursor: pointer; transition: background var(--anim), color var(--anim); }
.ag-navbtn:hover { background: var(--sup-3); color: var(--texto); }
.ag-mes { min-width: 150px; text-align: center; font-family: var(--fonte-titulo); font-size: 16px; font-weight: 600; color: var(--texto); text-transform: capitalize; }
.ag-hoje { height: 34px; border: 1px solid var(--borda-2); background: var(--sup-2); color: var(--texto); border-radius: 9px; font: 500 13px var(--fonte); padding: 0 14px; cursor: pointer; }
.ag-hoje:hover { background: var(--sup-3); }
.ag-data { height: 34px; width: 150px; border: 1px solid var(--borda-2); border-radius: 9px; background: var(--sup-2); color: var(--texto); font: 400 12.5px var(--mono); padding: 0 10px; color-scheme: dark; }
.ag-data:focus { outline: none; border-color: var(--destaque-borda); box-shadow: 0 0 0 3px var(--destaque-suave); }
.ag-vistas { display: flex; gap: 2px; background: var(--fundo-nav); border: 1px solid var(--borda); border-radius: 10px; padding: 2px; }
.ag-vbtn { border: 0; background: none; border-radius: 7px; font: 500 12.5px var(--fonte); color: var(--texto-suave); padding: 6px 13px; cursor: pointer; line-height: 18px; }
.ag-vbtn:hover { color: var(--texto); }
.ag-vbtn.ativo { background: var(--sup-3); color: var(--texto); box-shadow: var(--brilho); }
.ag-imprimir { display: inline-flex; align-items: center; gap: 7px; height: 34px; border: 1px solid var(--borda-2); background: transparent; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--texto-suave); padding: 0 13px; }
.ag-imprimir:hover { background: var(--sup-2); color: var(--texto); }
.ag-novo { display: inline-flex; align-items: center; gap: 6px; height: 34px; border: 0; border-radius: 9px; background: var(--destaque); color: var(--sobre-destaque); font: 600 13px var(--fonte); padding: 0 15px 0 12px; cursor: pointer; }
.ag-novo:hover { filter: brightness(1.08); }

.ag-sem-cab { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--borda); }
.ag-sem-cab div { padding: 10px 10px; font: 400 11.5px/16px var(--mono); color: var(--texto-fraco); }
.ag-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ag-cel { min-height: 112px; padding: 6px 6px 8px; border-bottom: 1px solid var(--borda-3); border-right: 1px solid var(--borda-3); cursor: pointer; display: flex; flex-direction: column; gap: 5px; min-width: 0; transition: background var(--anim); }
.ag-cel:nth-child(7n) { border-right: 0; }
.ag-cel:hover { background: rgba(255,255,255,.02); }
.ag-cel.fora { background: rgba(0,0,0,.18); }
.ag-cel.fora .ag-dia { color: var(--texto-fraco); opacity: .6; }
.ag-dia { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font: 500 12px var(--mono); color: var(--texto-suave); flex: none; }
.ag-cel.hoje { background: color-mix(in srgb, var(--destaque) 7%, transparent); }
.ag-cel.hoje .ag-dia { background: var(--destaque); color: var(--sobre-destaque); }
.ag-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ag-ev { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 0; background: color-mix(in srgb, var(--c) 11%, var(--sup-2)); color: var(--texto); box-shadow: inset 2px 0 0 var(--c); border-radius: 5px; padding: 3px 7px 3px 8px; font: 500 11.5px/17px var(--fonte); cursor: pointer; min-width: 0; height: 24px; transition: background var(--anim); }
.ag-ev:hover { background: color-mix(in srgb, var(--c) 20%, var(--sup-2)); }
.ag-ev-h { font: 400 10.5px var(--mono); color: var(--texto-suave); flex: none; }
.ag-ev-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ag-ev.longo { height: auto; align-items: flex-start; flex-direction: column; gap: 1px; padding: 6px 8px; }
.ag-ev.longo .ag-ev-tx { white-space: normal; overflow: visible; }

.ag-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 420px; flex: 1; }
.ag-scol { border-right: 1px solid var(--borda-3); padding: 0 6px 10px; cursor: pointer; min-width: 0; }
.ag-scol:last-child { border-right: 0; }
.ag-scol.hoje { background: color-mix(in srgb, var(--destaque) 7%, transparent); }
.ag-scab { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 4px; gap: 2px; font: 400 11.5px var(--mono); color: var(--texto-fraco); }
.ag-scab b { font: 500 20px var(--mono); color: var(--texto); }
.ag-dia-lista { display: flex; flex-direction: column; gap: 8px; padding: 18px; min-height: 300px; }
.ag-dcard { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--sup-2); border: 1px solid var(--borda); box-shadow: inset 2px 0 0 var(--c); border-radius: 11px; cursor: pointer; }
.ag-dcard:hover { background: var(--sup-3); }
.ag-dhora { display: flex; flex-direction: column; min-width: 52px; font-family: var(--mono); }
.ag-dhora b { font-size: 15px; font-weight: 500; color: var(--texto); }
.ag-dhora small { font-size: 11px; color: var(--texto-fraco); }
.ag-dinfo { flex: 1; min-width: 0; }
.ag-dtit { font-size: 14px; font-weight: 500; color: var(--texto); }
.ag-dtipo { font: 400 11.5px var(--mono); color: var(--c); }
.ag-dsub { font-size: 12.5px; color: var(--texto-suave); }
.ag-vazio { min-height: 300px; display: flex; align-items: center; justify-content: center; }
.ag-lista { padding: 14px 18px; min-height: 300px; overflow-x: auto; }
.ag-lista .tabela-caixa { background: none; box-shadow: none; }
.ag-lt { display: inline-flex; align-items: center; gap: 8px; color: var(--texto-suave); }
.ag-lt i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.ag-rodape { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; border-top: 1px solid var(--borda); margin-top: auto; }
.ag-card { --c: var(--texto-fraco); display: flex; align-items: center; gap: 12px; border: 1px solid var(--borda); background: var(--sup-2); border-radius: 12px; padding: 10px 14px; box-shadow: var(--brilho); }
.ag-card.total { --c: var(--destaque-texto); }
.ag-card.st-pendente { --c: var(--aviso); } .ag-card.st-agendado { --c: var(--info); } .ag-card.st-concluido { --c: var(--sucesso); }
.ag-card-ic { width: 30px; height: 30px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.ag-card-n { font: 500 20px/24px var(--mono); font-variant-numeric: tabular-nums; color: var(--texto); }
.ag-card-r { font-size: 12px; line-height: 16px; color: var(--texto-suave); }

@media (max-width: 991px) {
  .ag-cal { flex-direction: column; }
  .ag-lateral { width: auto; border-right: 0; border-bottom: 1px solid var(--borda); }
  .ag-lat-cab { height: auto; }
  .ag-sec { padding: 12px 14px; }
  .ag-tipo { display: inline-flex; margin-right: 14px; }
  .ag-tecs { flex-direction: row; flex-wrap: wrap; }
  .ag-tec { width: auto; }
  .ag-resumo { margin-top: 0; }
  .ag-toolbar { padding: 12px 14px; }
  .ag-mes { min-width: 0; }
  .ag-cel { min-height: 64px; padding: 4px; }
  .ag-ev { height: 6px; padding: 0; font-size: 0; box-shadow: none; background: var(--c); border-radius: 3px; }
  .ag-ev-h, .ag-ev-tx { display: none; }
  .ag-sem-cab div { padding: 8px 4px; font-size: 10px; text-align: center; }
  .ag-dia { margin: 0 auto; }
  .ag-rodape { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px; }
  .ag-semana { grid-template-columns: minmax(0, 1fr); }
  .ag-scol { border-right: 0; border-bottom: 1px solid var(--borda-3); }
}
