/* Relatório da Terceirizada — página independente do sistema-login.html,
   reaproveita variáveis e componentes (.card, .btn, .form-control, .auth-*, .toast) de css/styles.css. */

.tc-shell { min-height: 100vh; display: flex; flex-direction: column; }

.tc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: var(--rule-body) solid var(--void-line-strong);
  background: var(--void-2);
}

.tc-header-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tc-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.tc-logo { width: 38px; height: 34px; object-fit: contain; flex-shrink: 0; }
.tc-brand strong { display: block; font-size: var(--t-lg); color: var(--on-void); line-height: var(--lh-tight); }
.tc-brand span { display: block; font-size: .74rem; color: var(--muted); line-height: 1.3; }

.tc-header-meta { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.tc-user { font-size: .8rem; color: var(--text-soft, var(--muted)); white-space: nowrap; }

.tc-content {
  flex: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  gap: 1rem;
}

.tc-content .card + .card { margin-top: 0; }

.tc-intro { display: grid; gap: .3rem; margin-bottom: .25rem; }
/* A sobrancelha acima do título saiu: o título carrega o próprio peso. */
.tc-intro .eyebrow { display: none; }
.tc-intro h1 { font-size: var(--t-doc); color: var(--text); }
.tc-intro p { font-size: .86rem; color: var(--muted); max-width: 640px; }

.tc-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
  padding: 1.1rem;
}

.tc-field label { display: block; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .35rem; }

.tc-team-groups { display: grid; gap: 1.4rem; }

.tc-team-group { display: grid; gap: .75rem; }

.tc-team-group-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-left: .1rem;
}

.tc-teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  align-items: start;
}

.tc-team-card { padding: .95rem 1rem; display: grid; gap: .65rem; }

.tc-team-title { font-size: .92rem; font-weight: 700; color: var(--text); }

.tc-team-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.tc-team-numbers .tc-field label { font-size: .68rem; }

.tc-team-card textarea.form-control { min-height: 64px; resize: vertical; }

.tc-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 1.1rem; }
.tc-actions .btn { flex: 0 0 auto; }

.tc-history-list { display: grid; gap: .55rem; padding: 1.1rem; }
.tc-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.tc-history-item:hover { border-color: var(--border-strong, var(--primary)); background: rgba(255, 255, 255, .045); }
.tc-history-item .tc-history-main strong { display: block; color: var(--text); font-size: var(--t-sm); }
.tc-history-item .tc-history-main span { display: block; font-size: .76rem; color: var(--muted); margin-top: .15rem; }
.tc-history-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.tc-photo-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tc-photo-empty { font-size: .78rem; color: var(--muted); }
.tc-photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.tc-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  padding: 0;
}
.tc-photo-remove:hover { background: rgba(220, 38, 38, .85); }
.tc-photo-add { align-self: flex-start; }

.tc-badge-count { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.tc-badge-count span {
  font-size: .72rem;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: .15rem .55rem;
}

@media (max-width: 720px) {
  .tc-teams-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .tc-header-inner { padding: .7rem 1rem; }
  .tc-brand span { display: none; }
  .tc-content { padding: 1.1rem .9rem 2.5rem; }
  .tc-fields-grid { grid-template-columns: 1fr 1fr; }
}

/* Identificação pela planilha de equipes */
.tc-roster-hint {
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--muted);
}
.tc-roster-hit {
  margin-top: .75rem;
  padding: .55rem .8rem;
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: var(--radius);
  background: var(--success-soft);
  font-size: .8rem;
  color: var(--text-soft);
}

.tc-print-report { display: none; }

@media print {
  .tc-header, .toast, .auth-gate, #tcFormSections { display: none !important; }
  html, body { width: auto; min-height: auto; background: #fff !important; color: var(--ink) !important; }
  body { font-family: 'Archivo', Arial, Helvetica, sans-serif; font-size: 9.5pt; line-height: 1.3; }
  .tc-shell, .tc-content { display: block !important; min-height: auto !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
  .tc-print-report { display: block !important; color: var(--ink) !important; background: #fff !important; max-width: none; margin: 0; padding: 0; }
  /* Mesmos dois registros da tela e da outra folha. */
  .tc-print-report th { font-family: 'Archivo', Arial, sans-serif; font-stretch: 78%; text-transform: uppercase; letter-spacing: .07em; }
  .tc-print-report td { font-family: 'Fira Mono', 'Courier New', monospace; font-variant-numeric: tabular-nums; }
}

/* Console operacional · refinamento da tela da terceirizada */
.terceirizada-page { background: var(--console-bg); color: var(--console-text); }
.tc-header {
  background: rgba(7, 17, 27, .96);
  border-bottom: 1px solid var(--console-line);
  backdrop-filter: blur(12px);
}
.tc-header-inner { width: min(1240px, 100%); min-height: 70px; padding: .7rem 1.5rem; }
.tc-logo { width: 42px; height: 38px; }
.tc-brand strong { color: var(--console-text); font-size: 1.15rem; letter-spacing: .02em; }
.tc-brand span, .tc-user { color: var(--console-muted); }
.tc-content { width: min(1240px, 100%); padding: 1.6rem 1.5rem 3.5rem; gap: 1.2rem; }
#tcFormSections { display: grid; gap: 1.15rem; }
.tc-intro { margin: .3rem 0 .15rem; padding-bottom: .9rem; border-bottom: 1px solid var(--console-line); }
.tc-intro h1 { color: var(--console-text); font-size: clamp(1.5rem, 2vw, 2rem); letter-spacing: .015em; }
.tc-fields-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 1.15rem 1.25rem 1.3rem; gap: 1rem; }
.tc-field label { color: var(--console-muted); letter-spacing: .055em; }
.tc-team-groups { gap: 1.1rem; }
.tc-team-group { gap: .65rem; }
.tc-team-group-title {
  color: var(--stamp-void);
  font-size: .78rem;
  padding: .2rem 0 .25rem;
  border-bottom: 1px solid var(--console-line);
}
.tc-teams-grid { gap: 1rem; }
.tc-team-card { padding: 1.05rem 1.15rem 1.2rem; gap: .8rem; box-shadow: none; }
.tc-team-title { color: var(--console-text); font-size: 1rem; }
.tc-team-numbers { gap: .75rem; }
.tc-team-card textarea.form-control { min-height: 86px; line-height: 1.5; }
.tc-photo-thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); border-color: var(--console-line-strong); }
.tc-photo-add { min-height: 42px; }
.tc-actions {
  justify-content: flex-end;
  padding: .85rem 1rem;
  background: var(--console-panel) !important;
  box-shadow: 0 12px 36px rgba(0,0,0,.24) !important;
}
.tc-actions .btn-primary { order: 4; min-width: 154px; }
.tc-history-list { padding: .9rem 1rem 1rem; }
.tc-history-item { background: transparent; border-color: var(--console-line); border-radius: var(--radius-sm); }
.tc-history-item:hover { border-color: var(--stamp-void); background: rgba(255,122,26,.05); }
.tc-history-item .tc-history-main strong { color: var(--console-text); }
.tc-history-item .tc-history-main span { color: var(--console-muted); }
.tc-badge-count span { border-radius: var(--radius-sm); background: var(--console-panel-2); border-color: var(--console-line); }
.tc-roster-hit { border-color: rgba(76,201,131,.42); background: rgba(76,201,131,.1); color: var(--console-text); }

@media (max-width: 1040px) {
  .tc-fields-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tc-header-inner { padding-inline: 1rem; }
  .tc-content { padding: 1.1rem .85rem 2.5rem; }
  .tc-fields-grid { grid-template-columns: 1fr 1fr; padding: 1rem; }
  .tc-actions .btn { flex: 1 1 calc(50% - .4rem); justify-content: center; }
}
@media (max-width: 480px) {
  .tc-fields-grid, .tc-team-numbers { grid-template-columns: 1fr; }
  .tc-header-meta { gap: .4rem; }
  .tc-user { display: none; }
  .tc-actions .btn { flex-basis: 100%; }
}

.terceirizada-page .modal { max-height: min(88vh, 900px); }
.terceirizada-page .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.terceirizada-page .modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--console-panel);
  border-top: 1px solid var(--console-line);
}
.terceirizada-page .table-wrap { scrollbar-color: var(--stamp-void) var(--console-panel-2); }
.tc-actions {
  position: sticky;
  bottom: .75rem;
  z-index: 20;
  border-color: var(--console-line-strong) !important;
}
.tc-intro::after {
  content: "Identificação · Equipes · Complementos · Envio";
  display: block;
  margin-top: .35rem;
  color: var(--console-muted);
  font-size: var(--t-sm);
}
@media (max-width: 720px) {
  .terceirizada-page .modal { width: 100%; max-height: 94dvh; }
  .terceirizada-page .modal-foot { padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
  .tc-actions { bottom: max(.5rem, env(safe-area-inset-bottom)); }
}
