/* ==================================================================
   JurisCRM v7.1 — Timesheet, Workflows e Portal do Cliente
   ================================================================== */

/* ---------------- abas comuns ---------------- */
.ts-abas { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #e3e8ee);
  margin-bottom: 18px; overflow-x: auto; }
.ts-aba { padding: 11px 18px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--text-secondary, #5a6b7b);
  border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap; }
.ts-aba:hover { color: var(--primary, #1f4e79); }
.ts-aba-on { color: var(--primary, #1f4e79); font-weight: 600;
  border-bottom-color: var(--primary, #1f4e79); }

/* ---------------- filtros / topo ---------------- */
.ts-filtros { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--card, #fff); border: 1px solid var(--border, #e3e8ee);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.ts-filtros label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  font-weight: 600; color: var(--text-secondary, #5a6b7b); }
.ts-filtros input, .ts-filtros select { padding: 8px 10px;
  border: 1px solid var(--border, #e3e8ee); border-radius: 8px; font-size: 13.5px;
  font-family: inherit; min-width: 140px; }

.ts-topo { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap;
  margin-bottom: 16px; }
.ts-kpi { background: var(--card, #fff); border: 1px solid var(--border, #e3e8ee);
  border-radius: 10px; padding: 13px 18px; min-width: 150px; }
.ts-kpi-n { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.ts-kpi-r { font-size: 12px; color: var(--text-secondary, #5a6b7b); }
.ts-kpi-alerta { border-color: #e8b98f; background: #fdf7f0; }
.ts-kpi-alerta .ts-kpi-n { color: #b4541c; }

/* ---------------- tabela ---------------- */
.ts-tabela-wrap { overflow-x: auto; }
.ts-tabela { width: 100%; border-collapse: collapse; background: var(--card, #fff);
  border: 1px solid var(--border, #e3e8ee); border-radius: 10px; overflow: hidden;
  font-size: 13.5px; }
.ts-tabela th { text-align: left; padding: 10px 13px; background: #f8fafc;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-secondary, #5a6b7b); border-bottom: 1px solid var(--border, #e3e8ee);
  white-space: nowrap; }
.ts-tabela td { padding: 10px 13px; border-bottom: 1px solid #f1f4f8;
  vertical-align: top; }
.ts-tabela tr:last-child td { border-bottom: none; }
.ts-tabela small { color: var(--text-secondary, #5a6b7b); font-size: 12px; }
.ts-num { text-align: right; white-space: nowrap; }
.ts-aberto { color: #b4541c; font-weight: 600; }
.ts-acoes { white-space: nowrap; }
.ts-acoes .btn { margin-left: 4px; }
.ts-travado { background: #fafbfc; }
.ts-lock { opacity: .55; font-size: 14px; }
.ts-del { color: #b32d2d; }
.ts-tag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; background: #eef1f5; color: #5a6b7b; vertical-align: middle; }
.ts-tag-fat { background: #e8f1fa; color: #1f4e79; }

.ts-bloco { margin-bottom: 26px; }
.ts-bloco h3 { font-size: 14px; font-weight: 700; margin-bottom: 9px;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-secondary, #5a6b7b); }
.ts-vazio { background: var(--card, #fff); border: 1px dashed var(--border, #e3e8ee);
  border-radius: 10px; padding: 38px 20px; text-align: center;
  color: var(--text-secondary, #5a6b7b); }
.ts-vazio small { display: inline-block; margin-top: 7px; font-size: 12.5px; }
.ts-vazio-mini { padding: 16px; text-align: center; font-size: 13px;
  color: var(--text-secondary, #5a6b7b); }

/* ---------------- formulários em modal ---------------- */
.ts-form label { display: block; margin-bottom: 13px; font-size: 13px;
  font-weight: 600; }
.ts-form input[type=text], .ts-form input[type=date], .ts-form input[type=number],
.ts-form select { width: 100%; padding: 9px 11px; margin-top: 4px;
  border: 1px solid var(--border, #e3e8ee); border-radius: 8px; font-size: 14px;
  font-family: inherit; font-weight: 400; }
.ts-form small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 400;
  color: var(--text-secondary, #5a6b7b); }
.ts-row { display: flex; gap: 12px; }
.ts-row > label { flex: 1; }
.ts-check { display: flex !important; align-items: center; gap: 7px; align-self: flex-end;
  padding-bottom: 11px; white-space: nowrap; }
.ts-check input { width: auto !important; margin: 0 !important; }
.ts-dica { background: #f3f7fb; border-left: 3px solid #2d6da3; border-radius: 0 8px 8px 0;
  padding: 10px 13px; font-size: 12.5px; line-height: 1.55; color: #37506a;
  margin-bottom: 12px; }
.ts-dica-grande { font-size: 13.5px; }

/* ==================================================================
   WORKFLOWS
   ================================================================== */
.wf-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 13px; }
.wf-card { background: var(--card, #fff); border: 1px solid var(--border, #e3e8ee);
  border-radius: 12px; padding: 15px 17px; cursor: pointer;
  transition: box-shadow .15s, transform .15s; }
.wf-card:hover { box-shadow: 0 5px 16px rgba(20, 40, 60, .1); transform: translateY(-1px); }
.wf-modelo { cursor: default; }
.wf-modelo:hover { transform: none; }
.wf-card-topo { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; }
.wf-card-topo strong { font-size: 14.5px; line-height: 1.35; }
.wf-card-sub { font-size: 12.5px; color: var(--text-secondary, #5a6b7b); margin-top: 4px; }
.wf-card-modelo { font-size: 12px; color: #2d6da3; margin-top: 8px; font-weight: 600; }
.wf-card-pe { font-size: 11.5px; color: var(--text-secondary, #5a6b7b); margin-top: 8px; }
.wf-card-bt { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.wf-badge-atraso { font-size: 10.5px; font-weight: 700; background: #fdecec;
  color: #b32d2d; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.wf-atraso { border-color: #efc4c4; }
.wf-ok { border-color: #c3e6d2; }
.wf-barra { height: 6px; background: #eef1f5; border-radius: 20px; overflow: hidden;
  margin-top: 11px; }
.wf-barra-in { height: 100%; background: linear-gradient(90deg, #2d6da3, #1f4e79);
  border-radius: 20px; transition: width .3s; }
.wf-ok .wf-barra-in { background: linear-gradient(90deg, #35a86b, #1b7f4d); }
.wf-atraso .wf-barra-in { background: linear-gradient(90deg, #d47b47, #b4541c); }

.wf-detalhe { margin-bottom: 22px; }
.wf-detalhe-h { font-size: 14px; font-weight: 700; display: flex;
  justify-content: space-between; align-items: center; }
.wf-detalhe-prog { font-size: 12.5px; color: var(--text-secondary, #5a6b7b);
  font-weight: 600; }
.wf-passos { list-style: none; margin: 14px 0 0; padding: 0; }
.wf-passo { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0;
  border-bottom: 1px solid #f1f4f8; }
.wf-passo:last-child { border-bottom: none; }
.wf-passo-i { width: 26px; height: 26px; border-radius: 50%; background: #eef1f5;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  flex-shrink: 0; }
.wf-passo-c { flex: 1; min-width: 0; }
.wf-passo-c strong { font-size: 13.5px; }
.wf-passo-d { font-size: 12.5px; color: var(--text-secondary, #5a6b7b); margin-top: 2px; }
.wf-passo-m { font-size: 11.5px; color: var(--text-secondary, #5a6b7b); margin-top: 4px; }
.wf-passo-a { display: flex; gap: 5px; flex-shrink: 0; }
.wf-concluido .wf-passo-i { background: #e4f4ec; }
.wf-concluido .wf-passo-c strong { text-decoration: line-through; opacity: .65; }
.wf-dispensado .wf-passo-i { background: #f1f1f1; }
.wf-dispensado .wf-passo-c strong { opacity: .5; }
.wf-passo-atraso .wf-passo-i { background: #fdecec; }
.wf-atrasado-tx { color: #b32d2d; font-weight: 700; }
.wf-feito-tx { color: #1b7f4d; font-weight: 600; }
.wf-disp-tx { color: #7a7a7a; font-weight: 600; }

.wf-editor-h { font-size: 13px; font-weight: 700; margin: 6px 0 9px; }
.wf-editor-h small { display: block; font-weight: 400; font-size: 11.5px;
  color: var(--text-secondary, #5a6b7b); margin-top: 2px; }
.wf-ed-passo { display: flex; gap: 9px; align-items: flex-start; padding: 10px;
  background: #f8fafc; border: 1px solid var(--border, #e3e8ee); border-radius: 9px;
  margin-bottom: 8px; }
.wf-ed-num { width: 23px; height: 23px; border-radius: 50%; background: #1f4e79;
  color: #fff; font-size: 11.5px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; margin-top: 5px; }
.wf-ed-campos { flex: 1; min-width: 0; }
.wf-ed-campos input, .wf-ed-campos select { width: 100%; padding: 7px 9px;
  border: 1px solid var(--border, #e3e8ee); border-radius: 7px; font-size: 13px;
  font-family: inherit; }
.wf-ed-linha { display: flex; gap: 7px; align-items: center; margin-top: 6px; }
.wf-ed-linha select { max-width: 130px; }
.wf-ed-linha input[type=number] { max-width: 68px; }
.wf-ed-linha span { font-size: 11.5px; color: var(--text-secondary, #5a6b7b);
  white-space: nowrap; }
.wf-ed-x { background: none; border: none; color: #b32d2d; font-size: 15px;
  cursor: pointer; padding: 4px 6px; line-height: 1; margin-top: 4px; }

/* ==================================================================
   PORTAL — aba no cadastro do cliente
   ================================================================== */
.pcl-cab { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pcl-tit { font-size: 15.5px; font-weight: 700; }
.pcl-sub { font-size: 12.5px; color: var(--text-secondary, #5a6b7b); margin-top: 3px;
  max-width: 560px; line-height: 1.5; }
.pcl-estado { font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 20px;
  white-space: nowrap; }
.pcl-on { background: #e4f4ec; color: #1b7f4d; }
.pcl-off { background: #f1f1f1; color: #6b6b6b; }
.pcl-alerta { background: #fdf4e7; border: 1px solid #f3dcbd; color: #8a4a15;
  border-radius: 9px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pcl-alerta-forte { background: #fdecec; border-color: #f5c6c6; color: #8f2626;
  display: block; }
.pcl-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 11px; margin-bottom: 16px; }
.pcl-info > div { background: var(--card, #fff); border: 1px solid var(--border, #e3e8ee);
  border-radius: 9px; padding: 11px 13px; }
.pcl-info span { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-secondary, #5a6b7b); }
.pcl-info strong { display: block; font-size: 14px; margin-top: 3px;
  word-break: break-word; }
.pcl-info small { display: block; font-size: 11px; color: #2d6da3; margin-top: 2px; }
.pcl-bts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pcl-rev { color: #b32d2d; }
.pcl-nota { background: #f3f7fb; border-left: 3px solid #2d6da3;
  border-radius: 0 8px 8px 0; padding: 11px 13px; font-size: 12.5px; line-height: 1.6;
  color: #37506a; margin-bottom: 20px; }
.pcl-h4 { font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-secondary, #5a6b7b); margin-bottom: 9px; }
.pcl-log td { font-size: 12.5px; }

.pcl-senha-box { background: #f8fafc; border: 1px solid var(--border, #e3e8ee);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.pcl-senha-l { font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-secondary, #5a6b7b); margin-top: 11px; }
.pcl-senha-l:first-child { margin-top: 0; }
.pcl-senha-v { font-size: 15px; font-weight: 600; margin-top: 2px;
  word-break: break-all; }
.pcl-senha-forte { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px; letter-spacing: 2px; color: #1f4e79; }

@media (max-width: 600px) {
  .ts-row { flex-direction: column; }
  .ts-check { align-self: flex-start; padding-bottom: 0; }
  .wf-grade { grid-template-columns: 1fr; }
  .wf-passo { flex-wrap: wrap; }
  .wf-passo-a { width: 100%; padding-left: 37px; }
}
