/* Grupo C: Agenda, Fechamentos, Metas, Config. Classes com prefixo c-.
   So' variaveis de tokens.css, para valer nos dois temas. */

.c-pag { padding-bottom: var(--s6); min-height: 100%; }
.c-pag > .c-nota, .c-pag > .c-busca, .c-pag > .c-filtros, .c-pag > .c-barra, .c-pag > [data-slot] { margin-left: var(--s5); margin-right: var(--s5); }
.c-cab { padding-bottom: 6px; }
.c-nota { color: var(--text-2); font-size: 12px; margin-bottom: var(--s4); }
.c-pag > .c-nota { margin-top: 0; }
.c-busca { margin-bottom: var(--s3); width: auto; display: block; }
.c-pag > .c-busca { width: calc(100% - 2 * var(--s5)); }
.c-filtros { display: flex; gap: var(--s3); margin-bottom: var(--s4); }
.c-sel { appearance: none; -webkit-appearance: none; cursor: pointer; padding: 0 12px; height: 30px; background: transparent; }
.c-sel option { background: var(--panel); color: var(--text); }
.c-barra { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }

/* navegacao prev / hoje / next */
.c-nav { display: flex; align-items: center; gap: var(--s3); }
.c-nav-b {
  height: 30px; min-width: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--chrome); color: var(--text); display: inline-grid; place-items: center; font-weight: 500;
}
.c-nav-b:hover { background: var(--hover); }
.c-nav-rot { margin-left: var(--s3); color: var(--text-2); min-width: 150px; text-align: right; }

.c-circ { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--focus); color: #fff; font-weight: 600; }
.c-novo { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; padding: 0 5px; border-radius: var(--r-kbd); background: var(--focus); color: #fff; margin-left: 4px; }

/* ─── semana ───────────────────────────────────────────────────────── */
.c-semana { border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--bg); }
.c-s-cab { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background: var(--chrome); border-bottom: 1px solid var(--line); }
.c-s-dia { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; color: var(--text-2); border-left: 1px solid var(--line); }
.c-s-dia b { color: var(--text); font-weight: 500; }
.c-s-dia.hoje { background: var(--raised); }
.c-s-corpo { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); height: calc(var(--hpx) * var(--horas)); }
.c-s-horas { background: var(--chrome); }
.c-s-h { height: var(--hpx); font-size: 11px; color: var(--text-2); text-align: right; padding: 3px 8px 0 0; }
.c-s-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hpx) - 1px), var(--line) calc(var(--hpx) - 1px), var(--line) var(--hpx));
}
.c-s-col.hoje { background-color: var(--panel); }
.c-agora { position: absolute; left: 0; right: 0; height: 2px; background: var(--focus); z-index: 3; pointer-events: none; }
.c-agora::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--focus); }

.c-ev {
  position: absolute; z-index: 2; display: flex; flex-direction: column; text-align: left; overflow: hidden; padding: 2px 6px;
  border: 0; border-left: 3px solid var(--c-emp, var(--text)); border-radius: 3px; background: var(--raised); color: var(--text);
  font-size: 12px; line-height: 1.3;
}
.c-ev .h { color: var(--text-2); font-size: 11px; white-space: nowrap; }
.c-ev .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-ev:hover { background: var(--hover); }
.c-ev.e0, .c-mchip.e0 { --c-emp: var(--caller); }
.c-ev.e1, .c-mchip.e1 { --c-emp: var(--agent); }
.c-ev.e2, .c-mchip.e2 { --c-emp: var(--warn); }
.c-ev.e3, .c-mchip.e3 { --c-emp: var(--focus); }
.c-ev.st-noshow, .c-mchip.st-noshow { background: var(--bad-bg); }
.c-ev.st-canceled, .c-mchip.st-canceled { opacity: .55; text-decoration: line-through; }
.c-ev.novo, .c-mchip.novo, .c-l-linha.novo { box-shadow: 0 0 0 1.5px var(--focus); background: var(--raised); }

/* ─── mes ──────────────────────────────────────────────────────────── */
.c-m-cab { display: grid; grid-template-columns: repeat(7, 1fr); color: var(--text-2); padding: 0 8px 6px; font-size: 13px; }
.c-m-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.c-mcel { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 5px 4px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.c-mcel:nth-child(7n) { border-right: 0; }
.c-mcel.fora { color: var(--text-off); background: var(--chrome); }
.c-mcel.hoje { background: var(--panel); }
.c-mtop { display: flex; justify-content: space-between; align-items: center; padding: 0 3px; min-height: 24px; }
.c-mais { color: var(--text-2); font-size: 12px; }
.c-mchip {
  display: block; width: 100%; text-align: left; border: 0; border-left: 2px solid var(--c-emp, var(--text)); border-radius: 3px; padding: 1px 6px;
  background: var(--raised); color: var(--text); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.c-mchip:hover { background: var(--hover); }

/* ─── lista ────────────────────────────────────────────────────────── */
.c-l-dia { padding: 18px 12px 8px; color: var(--text-2); font-size: 13px; text-transform: none; }
.c-l-dia:first-child { padding-top: 6px; }
.c-l-linha {
  display: flex; align-items: center; gap: var(--s5); width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line);
  background: none; padding: 10px 12px; min-height: 55px; border-radius: 0;
}
.c-l-linha:hover { background: var(--panel); }
.c-l-hora { width: 76px; flex: none; font-family: var(--sans); font-weight: 500; }
.c-l-txt { display: flex; flex-direction: column; min-width: 0; }
.c-l-txt .tit { font-weight: 500; }
.c-l-txt .sub { color: var(--text-2); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.c-l-linha.novo { box-shadow: inset 2px 0 0 var(--focus); background: var(--raised); }

/* ─── popup (agenda e fechamento) ──────────────────────────────────── */
.c-fundo { position: fixed; left: 88px; top: 52px; right: 0; bottom: 0; z-index: 20; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 24px; }
.c-pop {
  width: min(520px, 100%); max-height: calc(100vh - 220px); overflow: auto; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-window); padding: 20px; box-shadow: var(--shadow);
}
.c-pop h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.c-pop-dl { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.c-pop-dl dt { color: var(--text-2); }
.c-pop-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.c-quando { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.c-pop-rot { color: var(--text-2); width: 80px; margin-right: 4px; }
.c-quando-dia { min-width: 120px; text-align: center; padding: 6px 10px; border: 1px solid var(--focus); border-radius: var(--r-control); background: var(--raised); }
.c-quando-dur { margin-left: auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--raised); color: var(--text-2); }
.c-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: var(--s4); }
.c-slot { height: 30px; border: 1px solid transparent; border-radius: var(--r-control); background: none; color: var(--text-2); font-size: 13px; }
.c-slot:hover { background: var(--hover); color: var(--text); }
.c-slot.sel { border-color: var(--focus); color: var(--text); background: var(--raised); }
.c-pop-msg { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; }
.c-pop-rod { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }

/* ─── fechamentos ──────────────────────────────────────────────────── */
.c-fe-lista { margin: 0 var(--s5); }
.c-fe-linha {
  display: flex; align-items: center; gap: var(--s5); padding: 7px 12px; min-height: 51px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.c-fe-linha:hover { background: var(--panel); }
.c-fe-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-fe-nome .tit { font-weight: 500; }
.c-fe-nome .sub { color: var(--text-2); font-size: 13px; }
.c-fe-pontos { display: flex; gap: 3px; }
.c-dispo { padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--r-control); color: var(--text-2); font-size: 12px; white-space: nowrap; }
.c-dispo.ok { color: var(--text-ok); border-color: var(--text-ok); background: var(--ok-bg); }
.c-fe-hora { color: var(--text-2); font-size: 13px; width: 148px; text-align: right; flex: none; }
.c-fe-st { width: 118px; flex: none; }

.c-fe-pop { width: min(560px, 100%); display: flex; flex-direction: column; padding: 20px 20px 16px; max-height: calc(100vh - 220px); } /* a janela tem margem, barra de titulo e topo */
.c-fe-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.c-fe-cab h2 { margin-bottom: 2px; }
.c-fe-cab p { font-size: 13px; }
.c-fe-corpo { overflow: auto; flex: 1; min-height: 0; padding-right: 6px; }
.c-rot { display: block; color: var(--text-2); font-size: 13px; margin: 10px 0 3px; }
.c-orig { display: block; color: var(--text-2); font-size: 12px; margin-top: 3px; }
.c-fe-aviso { font-size: 12px; margin: 10px 0 0; }
.c-fe-etapa { font-weight: 500; }
.c-passos { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.c-passos li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.c-passos .ponto { align-self: center; }
.c-p-nome { color: var(--text); font-size: 14px; }
.c-p-msg { font-size: 13px; }
.c-p-env { font-size: 12px; }
.c-fe-corpo textarea.campo { min-height: 84px; }
.c-gira { display: inline-flex; animation: c-gira .8s linear infinite; }
@keyframes c-gira { to { transform: rotate(360deg); } }

/* ─── metas ────────────────────────────────────────────────────────── */
.c-met-grade { display: grid; gap: var(--s4); margin: 0 var(--s5) var(--s4); }
.c-met-grade.c-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-met-grade.c-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c-met { padding: 16px; margin: 0; }
.c-pag > .c-met { margin: 0 var(--s5) var(--s4); }
.c-met-v { font-size: 24px; font-weight: 600; margin: 4px 0; letter-spacing: -.01em; }
.c-met-n { font-size: 12px; }
.c-faixa-top { display: flex; justify-content: space-between; }
.c-barra-meta { position: relative; height: 10px; border-radius: 5px; background: var(--raised); margin: 14px 0 30px; }
.c-barra-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--text-2); }
.c-faixa-seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--panel); background: transparent; }
.c-tick { position: absolute; top: 0; bottom: 0; width: 0; }
.c-tick i { position: absolute; left: -1px; top: -3px; width: 2px; height: 16px; background: var(--line); }
.c-tick em { position: absolute; top: 16px; left: 0; font-style: normal; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.c-tick:last-child em { transform: translateX(-100%); }
.c-tick:last-child i { left: -2px; }
.c-faixa-prox { font-size: 13px; margin-bottom: 8px; }
.c-faixa-leg { font-size: 12px; }
.c-dias { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 12px; }
.c-dia { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.c-dia-b { display: block; width: 100%; max-width: 28px; background: var(--checked); border-radius: 3px 3px 0 0; min-height: 2px; flex: none; }
.c-dia.hoje .c-dia-b { background: var(--text-ok); }
.c-dia-n, .c-dia-d { font-size: 11px; color: var(--text-2); }
.c-rodape { margin: 0 var(--s5); }

/* ─── config ───────────────────────────────────────────────────────── */
.c-cf { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; min-height: 0; }
.c-cf-menu { padding: 20px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.c-cf-voltar { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; font-weight: 600; padding: 0 8px 14px; color: var(--text); }
.c-cf-voltar .ico { color: var(--text-2); }
.c-cf-item { display: block; padding: 11px 16px; border-radius: var(--r-panel); text-decoration: none; color: var(--text-2); position: relative; }
.c-cf-item:hover { background: var(--panel); color: var(--text); }
.c-cf-item.on { background: var(--panel); color: var(--text); font-weight: 500; }
.c-cf-item.on::before { content: ""; position: absolute; left: -16px; top: 4px; bottom: 4px; width: 2px; background: var(--focus); border-radius: 2px; }
.c-cf-painel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 20px 20px 0 24px; }
.c-cf-cab { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.c-cf-cab h2 { font-size: 18px; font-weight: 600; }
.c-cf-corpo { overflow: auto; flex: 1; min-height: 0; padding: 4px 8px 32px 0; max-width: 780px; }
.c-cf-bloco { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.c-cf-bloco:last-child { border-bottom: 0; }
.c-cf-bloco h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.c-cf-bloco > p { font-size: 13px; margin-bottom: 8px; max-width: 420px; }
.c-cf-lin { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding: 9px 0; min-height: 50px; }
.c-cf-txt .sub { color: var(--text-2); font-size: 12px; }
.c-sw { width: 36px; height: 22px; border-radius: 11px; border: 0; background: var(--raised); position: relative; flex: none; box-shadow: 0 0 0 1px var(--line) inset; transition: background .12s; }
.c-sw i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: left .12s, background .12s; }
.c-sw.on { background: var(--ok); box-shadow: none; }
.c-sw.on i { left: 17px; background: #0B0B0D; }
.c-cf-sel-bloco { margin: 10px 0 14px; max-width: 620px; }
.c-cf-sel-rot { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.c-cf-sel { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--raised); }
.c-cf-sobre { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.c-cf-sobre .tit { font-weight: 600; font-size: 16px; }
.c-cf-aviso { color: var(--text-2); font-size: 13px; padding-bottom: 12px; }

@media (max-width: 1100px) {
  .c-met-grade.c-3 { grid-template-columns: 1fr; }
  .c-cf { grid-template-columns: 240px minmax(0, 1fr); }
}

a.btn { text-decoration: none; }
.c-pop select.campo { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
